Set Categories in DateNavigator

My friend seems to have problems with ABAP. Here's a copy of his question - posted on the SAP community forums.


Hi everyone, I am trying to tag DateNavigator with two categories. I created a context called Marking with Date, Category and Tooltip attributes.

Node: Marking

  • Date:
  • Category:
  • hint:

I filled the category attribute with two categories: e_category-three

and e_category-four

. I filled in Date attribute with dates. I want some of these dates to be category three and another category four.

Currently all dates are set to first category ( e_category-three

) and the code looks like this.

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.
      " ... 

      

+2


source to share


1 answer


I'm assuming it ls_dates_shared

has type markings?

If so, you must explicitly fill in the ls_dates_shared-category

and fields ls_dates_shared-tooltip

.



Currently this can be filled in before the code snippet you give us. Try something like this:

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.
...

      

+2


source







All Articles