cancel
Showing results for 
Search instead for 
Did you mean: 

bind data to node under node under node

UmaArjunan
Active Participant
0 Kudos

WD Experts,

     I have a table wherein user has to do F4 based on corresponding description in the right side ,

     Each line will have different F4 value based on value in right side.

     Qn 1 . How to dynamically populate different F4 in WD tables for each row.

For that purpose , i have created the context node in the below format

     node1

          Node 1.1

          Node 1.2

               Node 1.2.1

         

i can able to bind data to the nodes till node 1.1 & node 1.2 and stuck up with the node 1.2.1 . In the above fig source_f4.

I searched in sdn and tried to populate the data to nodes 1.1 & 1.2

Code snippet :

LOOP AT lt_target_dim INTO ls_target_dim.
     lr_element = lo_nd_target_dim->get_element( sy-tabix ).
     wd_node = lr_element->get_child_node( 'CRITERIA' ).
     wd_node->bind_table( lt_criteria ).
     wd_node = lr_element->get_child_node( 'SOURCE_DIM ').
     wd_node->bind_table( lt_source_dim ).

ENDLOOP.

Qn2 : In the above , how to bind data to inner node under node source_dim. i tried to get the reference and populate as node1 . but it is not working.

Please suggest how to bind data to node under node under node.

Thanks....

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Below is a link for Dynamic population of F4 help in Web Dynpro ABAP:

Dynamic population of F4 help in Webdynpro ABAP based on user's selection

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Try  below code


LOOP AT lt_target_dim INTO ls_target_dim.
     lr_element = lo_nd_target_dim->get_element( sy-tabix ).
     wd_node = lr_element->get_child_node( 'CRITERIA' ).
     wd_node->bind_table( lt_criteria ).
     wd_node = lr_element->get_child_node( 'SOURCE_DIM ').
     wd_node->bind_table( lt_source_dim ).

         

         "as each element of SOURCE_DIM must have a child node SOURCE_F4

          free lr_element.


          loop at lt_source_dim into ls_source_dim.

               lr_element = wd_node->get_element( sy-tabix ).

         

               wd_node = lr_element->get_child_node( ).

         

     " you can bind different F4 values from internal table entries per element instance of SOURCE_DIM

               wd_node->bind_table( lt_source_f4 ).


          endloop.

ENDLOOP.

Hope this helps you.

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

Use get_path_node( ) method of context to read sub nodes.

lo_nd_node = wd_context->path_get_node( path = `NODE1.NODE1_2.NODE1_2_1` ).

In your case, try this code:

LOOP AT lt_target_dim INTO ls_target_dim.
     lr_element = lo_nd_target_dim->get_element( sy-tabix ).
     wd_node = lr_element->get_child_node( 'CRITERIA' ).
     wd_node->bind_table( lt_criteria ).
     wd_node = lr_element->get_child_node( 'SOURCE_DIM ').
     wd_node->bind_table( lt_source_dim ).

     wd_node = lr_element->get_path_node( 'SOURCE_DIM.SOURCE_f4 ').

     wd_node->bind_table( lt_source_f4 ).

ENDLOOP.

Regards,

Kiran