2

私の友人はABAPに問題を抱えているようです。これが彼の質問のコピーです-SAPコミュニティフォーラムに投稿されています。


みなさん、こんにちは。DateNavigatorを2つのカテゴリでマークしようとしています。日付、カテゴリ、ツールチップの属性を使用して、マーキングと呼ばれるコンテキストを作成しました。

ノード:マーキング

  • 日にち:
  • カテゴリー:
  • ツールチップ:

カテゴリ属性に2つのカテゴリを入力しました:e_category-threee_category-four。Date属性に日付を入力しました。これらの日付のいくつかをカテゴリー3にし、他の日付をカテゴリー4にします。

現在、すべての日付は最初のカテゴリ(e_category-three)に設定されており、コードは次のようになります。

if ls_host_name-host_name <> host_msg and ls_vm_name-vm_name = vm_msg.
  loop at lt_machine_booking into wa.
    if ls_host_name-host_name = wa-host_name.
        date = wa-reserved_from.
      while date <= wa-reserved_till.
        ls_dates_shared-dates = date.     > i want these dates to be e_category-three
        append ls_dates_shared to lt_dates_shared.
        add 1 to date.
      ENDWHILE.
    endif.
    ENDLOOP.
elseif ls_host_name-host_name <> host_msg and ls_vm_name-vm_name <> vm_msg.
    loop at lt_machine_booking into wa.
      if ls_host_name-host_name = wa-host_name and ls_vm_name-vm_name = wa-vm_name.
        date = wa-reserved_from.
        while date <= wa-reserved_till.
          ls_dates_shared = date.       > i want these dates to be e_category-four
          append ls_dates_shared to lt_dates_shared.
          add 1 to date.
        ENDWHILE.
      endif.
      " ... 
4

1 に答える 1

2

それls_dates_sharedはタイプマーキングだと思いますか?

この場合、フィールドls_dates_shared-categoryls_dates_shared-tooltip明示的に入力する必要があります。

現在、これはあなたが私たちに提供するコードスニペットの前に記入されるかもしれません。次のようなものを試してください。

if ls_host_name-host_name <> host_msg and ls_vm_name-vm_name = vm_msg.
  loop at lt_machine_booking into wa.
    if ls_host_name-host_name = wa-host_name.
        date = wa-reserved_from.
      while date <= wa-reserved_till.
        ls_dates_shared-dates = date.     "i want these dates to be e_category-three"
        ls_dates_shared-category = e_category-three.
        "ls_dates-tooltip = appropriate_tooltip for e_category-three"
        append ls_dates_shared to lt_dates_shared.
        add 1 to date.
      ENDWHILE.
    endif.
  ENDLOOP.

elseif ls_host_name-host_name <> host_msg and ls_vm_name-vm_name <> vm_msg.
  loop at lt_machine_booking into wa.
    if ls_host_name-host_name = wa-host_name and ls_vm_name-vm_name = wa-vm_name.
      date = wa-reserved_from.
      while date <= wa-reserved_till.
        ls_dates_shared = date.       "i want these dates to be e_category-four"
        ls_dates_shared-category = e_category-four.
        "ls_dates-tooltip = appropriate_tooltip for e_category-four"
        append ls_dates_shared to lt_dates_shared.
        add 1 to date.
      ENDWHILE.
    endif.
...
于 2009-09-06T01:49:39.853 に答える