Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RE:simple tree list(oops concept)

alex_georgek
Associate
Associate
0 Likes
398

Hi all,

In class CL_GUI_LIST_TREE we have a method called

add_nodes_and_items>.In that method you are exporting

2 tables ie node_table and item_table.I want to know how to populate these 2 tables and also what is the purpose for these 2 tables.

Please explain with a sample code.

Thanks in advance.

Alex.

1 ACCEPTED SOLUTION
Read only

dhruv_shah3
Active Contributor
0 Likes
378

Hi,

This method is used for Inserting Nodes and Items.

It takes parameters Item_Table and Item_Table_Structure

Where, Item_table is your Internal Table data and Item_Table_Structure which is name of the Structure of the Item in ABAP Dictionary.




CALL METHOD me->ADD_NODES_AND_ITEMS
                   EXPORTING
*                     NODE_TABLE                     =
                     ITEM_TABLE                     = it_tab1
                     ITEM_TABLE_STRUCTURE_NAME      = zitab1
*                   EXCEPTIONS
*                     FAILED                         = 1
*                     CNTL_SYSTEM_ERROR              = 2
*                     ERROR_IN_TABLES                = 3
*                     DP_ERROR                       = 4
*                     TABLE_STRUCTURE_NAME_NOT_FOUND = 5
*                     others                         = 6
                         .
                 IF SY-SUBRC <> 0.
*                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             ENDIF.

HTH

Regards,

Dhruv Shah

2 REPLIES 2
Read only

Former Member
0 Likes
378

Hello,

Pls refer the standard pgm SAPTLIST_TREE_CONTROL_DEMO.

Regards

Read only

dhruv_shah3
Active Contributor
0 Likes
379

Hi,

This method is used for Inserting Nodes and Items.

It takes parameters Item_Table and Item_Table_Structure

Where, Item_table is your Internal Table data and Item_Table_Structure which is name of the Structure of the Item in ABAP Dictionary.




CALL METHOD me->ADD_NODES_AND_ITEMS
                   EXPORTING
*                     NODE_TABLE                     =
                     ITEM_TABLE                     = it_tab1
                     ITEM_TABLE_STRUCTURE_NAME      = zitab1
*                   EXCEPTIONS
*                     FAILED                         = 1
*                     CNTL_SYSTEM_ERROR              = 2
*                     ERROR_IN_TABLES                = 3
*                     DP_ERROR                       = 4
*                     TABLE_STRUCTURE_NAME_NOT_FOUND = 5
*                     others                         = 6
                         .
                 IF SY-SUBRC <> 0.
*                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
             ENDIF.

HTH

Regards,

Dhruv Shah