‎2008 Apr 10 6:00 AM
hi,
there is one fuction module from standard program.
CALL FUNCTION '/SAPTRX/EVENT_MGR_FILL_TABCONT'
EXPORTING
tabledef1 = 'GENERAL_HEADER_DATA'
tabledef2 = 'HU_HEADER'
tabledef3 = 'HU_ITEM'
tabledef4 = 'HU_HISTORY_ENTRIES'
opt_init_container = 'X'
TABLES
table1 = ls_general_data
table2 = it_header
table3 = it_items
table4 = it_history
CHANGING
table_container = datacontainer.
i want to create another internal table some field from
it_header and it_item how to crate it ?
‎2008 Apr 10 6:17 AM
Declare another internal table that have your required fields i.e. some from IT_HEADER & some from IT_ITEMS.
Loop at it_header.
read table it_item with key f1 = it_header-f1.
if sy-subrc = 0.
v_tabix = sy-tabix.
loop at it_item index sy-tabix.
if it_item-f1 <> it_header-f1.
exit.
endif.
it_final-f1 = it_hedaer-f1.
it_final-f2 = it_item-f2.
append it_final.
endloop.
endif.
endloop.
‎2008 Apr 10 6:10 AM
Hi,
The new table should have some fields that are common to both tables.
The logic to use is:
loop at header table
loop at detail table where field = header-field
move-corresponding header to newtable
move-corresponding detail to newtable
append newtable
clear newtable
endloop
endloop.
‎2008 Apr 10 6:17 AM
Declare another internal table that have your required fields i.e. some from IT_HEADER & some from IT_ITEMS.
Loop at it_header.
read table it_item with key f1 = it_header-f1.
if sy-subrc = 0.
v_tabix = sy-tabix.
loop at it_item index sy-tabix.
if it_item-f1 <> it_header-f1.
exit.
endif.
it_final-f1 = it_hedaer-f1.
it_final-f2 = it_item-f2.
append it_final.
endloop.
endif.
endloop.
‎2008 Apr 10 6:23 AM
Hi,
DATA : BEGIN OF it_details OCCURS 0,
Declare all your hearder and line items fields here.
END OF it_details.
If lot of fields are there
‎2008 Jun 07 1:21 PM