cancel
Showing results for 
Search instead for 
Did you mean: 

Set Categories on DateNavigator

Former Member
0 Kudos

Hey Everyone,

i am trying to mark the Datenavigator with two categories...

I made a context called Marking, with attributes Date, Category and Tooltip.

Node: Marking

-Date:

-Category:

-Tooltip:

I filled category attribute with two categories : e_category-three and e_category-four.

I filled the Date attribute with dates.. i want some of these dates to be category-three and others category-four.

Currenty, all dates are set to the first category(three)..

My code looks like this...

-


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 need these dates to be 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 category-four]

append ls_dates_shared to lt_dates_shared.

add 1 to date.

ENDWHILE.

endif.

-


Thnaks for your help...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

sorry i ddnt mean to post here..

Edited by: imatari on Jul 24, 2010 6:22 PM

Former Member
0 Kudos

To mark Date Navigator with Different colors do this:

Node: Dates ( 0..n ) -> bind to datenavigatormarking - dataSource

Att1: Category -> bind to datenavigatormarking - category - type WDUI_DATE_MARKING_CATEGORY

att2: dates -> bind to datenavigatormarking - date - type D

to mark calendar, fill the dates and category attributes and bind to node.

DATA lo_nd_dates TYPE REF TO if_wd_context_node.

DATA lo_el_dates TYPE REF TO if_wd_context_element.

DATA ls_dates TYPE wd_this->Element_dates_shared.

DATA lt_dates TYPE wd_this->Elements_dates_shared.

  • navigate from <CONTEXT> to <DATES_SHARED> via lead selection

lo_nd_dates_shared = wd_context->path_get_node( path = `CAL_MARK.DATES_SHARED` ).

  • get element via lead selection

lo_el_dates_shared = lo_nd_dates_shared->get_element( ).

data date type D.

date = sy-datum.

ls_dates-dates = date.

ls_dates-category_marking = CL_WD_DATE_NAV_MARKING=>E_CATEGORY-FOUR.

append ls_dates_shared to lt_dates_shared.

lo_nd_dates->bind_elements( lt_dates_shared ).

-


there is category:

ONE , TWO, THREE, FOUR

if you put this part in a loop, each time passing a different date value, you can mark dates alot of dates:

ls_dates-dates = date.

ls_dates-category_marking = CL_WD_DATE_NAV_MARKING=>E_CATEGORY-FOUR.

append ls_dates_shared to lt_dates_shared.

-


bind the elements outside the loop.

-


anways, hope this helps..