Imposta categorie su DateNavigator
Domanda
Il mio amico sembra avere qualche problema con ABAP. Ecco una copia della sua domanda -. Postato sul forum della comunità SAP
Ciao a tutti, Sto cercando di segnare il DateNavigator con due categorie. Ho fatto un contesto chiamato marcatura, con gli attributi data, categoria e Tooltip.
Node: Marcatura
- Date:
- Categoria:
- Descrizione comando:
Ho riempito attributo categoria con due categorie: e_category-three
e e_category-four
. Ho riempito l'attributo data con date. Voglio un po 'di queste date da categoria-tre e altri categoria quattro.
Al momento, tutte le date sono impostate per la prima categoria (e_category-three
) e il codice simile a questo.
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.
" ...
Soluzione
Sto assumendo che ls_dates_shared
è di marcatura tipo?
Se questo è il caso si deve riempire i campi ls_dates_shared-category
e ls_dates_shared-tooltip
esplicitamente.
Al momento questa può essere riempito prima il frammento di codice che ci date. Provare qualcosa di simile:
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.
...