cancel
Showing results for 
Search instead for 
Did you mean: 

how can i insert a new element into a context node?

Former Member
0 Kudos

Hi

can any one help?

best regards

Accepted Solutions (1)

Accepted Solutions (1)

former_member226203
Active Contributor
0 Kudos

u mean u need to create a node or attribute....?

if so..jus go to the context tab, u will see context node..right click on CONTEXT..and create a node..

now right click on the created node and create an attribute..

Former Member
0 Kudos

Hi Kalyan Chakravarthi

thanks for your reply,

I mean in the run time, how can I insert a new created element into the context node.

regards

Former Member
0 Kudos

hi,

use the following code for inserting the row at run time.

just make a button for adding the row and type the following code in the action of the method.

DATA lo_nd_cn_try1 TYPE REF TO if_wd_context_node.

DATA lo_el_cn_try1 TYPE REF TO if_wd_context_element.

DATA ls_cn_try1 TYPE wd_this->element_cn_try1.

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

lo_nd_cn_try1 = wd_context->get_child_node( name = wd_this->wdctx_cn_try1 ).

lo_el_cn_try1 = lo_nd_cn_try1->create_element( ).

lo_nd_cn_try1->bind_element( NEW_ITEM = lo_el_cn_try1 SET_INITIAL_ELEMENTS = abap_false )

Node name is: cn_try1

Regards

Pankaj Aggarwal

Former Member
0 Kudos

Hi Pankaj Aggarwal

it works, thank you

thank you all

regards

Answers (2)

Answers (2)

former_member226203
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi qq,

Regards,

Sravanthi