2

我的朋友似乎在使用 ABAP 时遇到了一些问题。这是他的问题的副本 - 发布在 SAP 社区论坛上。


大家好,我正在尝试用两个类别标记 DateNavigator。我创建了一个名为 Marking 的上下文,具有 Date、Category 和 Tooltip 属性。

节点:标记

  • 日期:
  • 类别:
  • 工具提示:

我用两个类别填充类别属性:e_category-threee_category-four。我用日期填充了 Date 属性。我希望其中一些日期为第三类,而其他日期为第四类。

目前,所有日期都设置为第一类 ( 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-category字段ls_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 回答