cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with method IF_WD_CONTEXT_NODE->GET_ELEMENT( )

danilo_cardoso
Participant
0 Kudos

Hi experts!

I am coding the following lines on my method:

data: lo_node type ref to if_wd_context_node.

data: lo_elem type ref to if_wd_context_element.

lo_node = wd_context->get_child_node( name = wd_this->my_context_name ).

lo_elem = lo_node->get_element( ). 

I'm using Wed Dynpro code Wizard to do this in three diferent methods, in two of them it works fine, but, in the third method it is not working. The DATA lo_elem is returned as INITIAL.

What can be wrong?

Thanks in advance.

Danny

Accepted Solutions (1)

Accepted Solutions (1)

former_member199125
Active Contributor
0 Kudos

Danny,

Get_element( ) will return the selected row values( lead selection ) ,and check the initialize lead seleection property of node.

Now if node have some values," get _element method is initial" will not execute.

Regards

Srinivas

danilo_cardoso
Participant
0 Kudos

Hi!

Thanks for the answers.

My context refers to a TABLE Element, so, to do this, I needed to fill table first as follow:

data: lo_node type ref to if_wd_context_node.
 
data: lo_elem type ref to if_wd_context_element.

data: lt_table typewd_this->elements_my_table.
 
lo_node = wd_context->get_child_node( name = wd_this->my_context_name.

lo_node->bind_table( lt_table ). "Considering that LT_TABLE is filled"
 
lo_elem = lo_node->get_element( ).

Issue is solved.

Thanks again and regards.

Danny

Edited by: Danilo Cardoso on Jul 1, 2011 3:19 PM

Answers (1)

Answers (1)

saravanan_narayanan
Active Contributor
0 Kudos

Hello Danny,

Since you are not passing the index, the method will try to return the lead selected element. If there is no lead selection in the node, then you will get initial element.

BR, Saravanan