cancel
Showing results for 
Search instead for 
Did you mean: 

set_attribute doubt

former_member425121
Participant
0 Kudos

Hi

I am creating a date field wich must appears in screen with default value.

In COMPONENTCONTROLER i created a node GLOBAL_DATA with attribute DATE (DATE is type date).

In WDDOINIT i try to set the default value:

DATA: lo_nd_global_data TYPE REF TO if_wd_context_node,

lo_el_global_data TYPE REF TO if_wd_context_element,

lv_date TYPE wd_this->Element_global_data-date.

lv_date = sy-datum.

lo_nd_global_data = wd_context->get_child_node( name = wd_this->wdctx_GLOBAL_DATA ).

lo_el_global_data = lo_nd_global_data->get_element( ).

lo_el_global_data->set_attribute( name = `DATE`

value = lv_date ).

But lo_el_global_data receives NULL , so the set_attribute fails (abort).

Is this the right way to set the value to attribute node ?

Note: if i create the DATE directly (not inside Node) it works , but i need to create it in node because that data is going to send to Flash Island , and if i use an attribute the value is not transfered, but the nodes works ok.

Regards

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member425121
Participant
0 Kudos

Done, i was checking and i made a mistake when i created the node with cardinality 0..n , instead 1..1.

Best regards

Frank