在DateNavigator上设置类别

时间:2009-09-03 17:29:22

标签: sap abap webdynpro

我的朋友似乎在使用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.
      " ... 

1 个答案:

答案 0 :(得分: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.
...