You are on page 1of 1

** this action handle method triggered when the user selects any row of the head er table.

** here the primary focus is to read the particular line of the header table tha t user selects and ** then based on that reading the data from VBAP table and filling the internal table and binding ** view context node SALES_ITEM. DATA : lo_hdr_node TYPE REF TO if_wd_context_node, lo_hdr_elem TYPE REF TO if_wd_context_element, lo_item_node TYPE REF TO if_wd_context_node, ls_vbak TYPE wd_this->element_sales_hdr, lt_vbap TYPE wd_this->elements_sales_item. ** READ THE HEADER NODE REFERENCE CALL METHOD wd_context->get_child_node EXPORTING name = 'SALES_HDR' " Name of Lower-Level Node RECEIVING child_node = lo_hdr_node. " Lower-Level Node ** GET THE REFERENCE OF TEH SELECTED ROW CALL METHOD lo_hdr_node->get_lead_selection RECEIVING element = lo_hdr_elem. ** READ THE CONTENT OF THE SELECTED ROW AND STORE IT IN WORK AREA CALL METHOD lo_hdr_elem->get_static_attributes IMPORTING static_attributes = ls_vbak. IF ls_vbak IS NOT INITIAL. SELECT * FROM vbap INTO CORRESPONDING FIELDS OF TABLE lt_vbap WHERE vbeln = ls_vbak-vbeln. CLEAR ls_vbak. CALL METHOD wd_context->get_child_node EXPORTING name = 'SALES_ITEM' " Name of Lower-Level Node RECEIVING child_node = lo_item_node. " Lower-Level Node CALL METHOD lo_item_node->bind_table EXPORTING new_items = lt_vbap. " List of Elements or Model Data ENDIF.

You might also like