2007 Jan 30 1:41 AM
I have 3 internal, for example, one of header table, one of item table, one of result table.
How can i insert header and item into result table.
Like.
Insert header-f1 header-f2 item-f1 item-f2 item-f3 into result
Thanks.
I have 3 internal, for example, one of header table, one of item table, one of result table.
How can i insert header and item into result table.
Like.
Insert header-f1 header-f2 item-f1 item-f2 item-f3 into result
Thanks.
2007 Jan 30 2:30 AM
Hi,
Try as below -
Loop at header.
Loop at item.
Append the required fields from header and item itabs to result itab.
endloop.
endloop.
Reward ponits if found useful..!
Cheers
Abhishek
2007 Jan 30 2:31 AM
Hi ,
create a work area for the result table and then move the values to the work area followed by appending to the result internal table.
wa-f1 = header-f1.
wa-f2 = header-f2
append wa to result.
clear wa.
wa-f1 = item-f1.
wa-f2 = item-f2
append wa to result.
Now the result itab contains 2 records.
Pls reward if found useful.
Thanks
Shyam
2007 Jan 30 3:25 AM
Hi,
Since you have more than one record in the item table for a corresponding header table entry.Consider the following steps.
1. Do a loop at the item table.
2. Read the header table for the above key combination from the item table.
For eg: Read it_header with key xxx from the it-item-xxx.
3. Populate the final internal table. You can append the new internal table.
4. Endloop.
Hope this helps..
Regards
Deepu.
2007 Jan 30 3:40 AM
loop at ititem.
move-corresponding ititem to itresult.
read table itheader with key f1 = ititem-f1.
if sy-subrc = 0.
move-corresponding itheader to itresult.
endif.
append itresult.
endloop.
here all the tables are with header line if your table is without header line you have to use explicit work area.
regards
shiba dutta
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |