cancel
Showing results for 
Search instead for 
Did you mean: 

date_navigator select week

Former Member
0 Kudos

hi

I add a date_navigotor on my page

how can i learn selected day and week and i 'm click week number error message :

" Parameter NODE contains an invalid value "

thanks .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

your answer thanks .

i define a node it's name daten and a attribute it's name date and type datum

and Bind the firstSelectedDate property to daten node

but error message: Adapter error in &VIEW_ELEMENT_TYPE& "DATE_NAVIGATOR" of view "YDND_WDPP033807.PANEL": Context binding of property FIRST_SELECTED_DATE cannot be resolved: PANEL.1.DATEN absent.

Former Member
0 Kudos

I think there is some problem in binding....

Bind it to to ATTRIBUTE of the node and then before executing the application, activiate all component, and then run it.

Answers (1)

Answers (1)

Former Member
0 Kudos

Follow these steps,

1- Create date navigator

2- create a attribute in some view context as data type first_Date suppose... and provide the data type as datum

3- Go to the view and click on the properties of date navigator

4- Bind the firstSelectedDate property to first_Date attribute

5- create an event handler for week (onWeekSelect). So in the method write the below code.(change the code as per ur data declaration)

DATA lo_nd_flag1 TYPE REF TO if_wd_context_node.
    DATA lo_el_flag1 TYPE REF TO if_wd_context_element.
    DATA ls_flag1 TYPE wd_this->element_flag1.
    DATA lv_date LIKE ls_flag1-date.
*   navigate from <CONTEXT> to <FLAG1> via lead selection
    lo_nd_flag1 = wd_context->get_child_node( name = wd_this->wdctx_flag1 ).

*   get element via lead selection
    lo_el_flag1 = lo_nd_flag1->get_element(  ).

*   get single attribute
    lo_el_flag1->get_attribute(
      EXPORTING
        name =  `DATE`
      IMPORTING
        value = lv_date ).

Here my context attribute name is 'date'.

Now in lv_Date variable you have the selected date.

Now call this FM to get the week of selected date.

GET_WEEK_INFO_BASED_ON_DATE

and pass lv_date as importing paramters. you will get the week number.

Hope it works.