How to add two internal tables
in third internal table
Can anyone help me on how to add the contents of two different
internal tables in a third final table to print a report.
I have fetched data in first and second internal table
on some condition but I have to move the data into a final internal table
so I can perform some more condition.
----------------------------------------------------------------------------------------
Go throw this Example I hope that this will helps you.
DATA : BEGIN OF IT_VBAK OCCURS 0,
VBELN LIKE VBAK-VBELN,
KUNNR LIKE VBAK-KUNNR,
END OF IT_VBAK.
* Sales Order Line Item Data
DATA : BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
MATNR LIKE VBAP-MATNR,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE VBAP-KWMENG,
MEINS LIKE VBAP-MEINS,
NETPR LIKE VBAP-NETPR,
waerk like vbap-waerk,
NETWR LIKE VBAK-NETWR,
END OF IT_VBAP.
* Final Internal Table for Display
DATA : BEGIN OF IT_FINAL OCCURS 0,
VBELN LIKE VBAK-VBELN,
KUNNR LIKE VBAK-KUNNR,
MATNR LIKE VBAP-MATNR,
ARKTX LIKE VBAP-ARKTX,
KWMENG LIKE
VBAP-KWMENG,
MEINS LIKE VBAP-MEINS,
NETPR LIKE VBAP-NETPR,
WAERK like vbap-WAERK,
NETWR LIKE VBAK-NETWR,
END OF IT_FINAL.
loop at it_vbak.
LOOP AT IT_VBAP
WHERE VBELN EQ IT_VBAK-VBELN.
MOVE : IT_VBAK-KUNNR TO
IT_FINAL-KUNNR,
IT_VBAK-VBELN TO IT_FINAL-VBELN,
IT_VBAP-MATNR TO IT_FINAL-MATNR,
IT_VBAP-ARKTX TO IT_FINAL-ARKTX,
IT_VBAP-KWMENG TO IT_FINAL-KWMENG,
IT_VBAP-MEINS tO IT_FINAL-MEINS,
IT_VBAP-NETPR TO IT_FINAL-NETPR,
IT_VBAP-NETWR TO IT_FINAL-NETWR,
IT_VBAP-WAERK to it_final-waerk.
APPEND IT_FINAL.
CLEAR IT_FINAL.
ENDLOOP.
endloop.
See Also:
Help
on Conversion From Numbers to Text Amount
More Function Module
Functions /
SAP Script / ALV
Tables
Database Table
ABAP Books List
ABAP/4 Certification,
Programming, Smartforms, Sapscripts and Object Oriented Programming Books
Smart Forms
SAP Smartforms
ABAP Menu:
ABAP Example Hints
and Tips
Return to Index:-
SAP ABAP/4 Programming,
Basis Administration, Configuration Hints and Tips
(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.
Information used on this site is at your own risk.
All product names are trademarks of their respective
companies. The site www.gotothings.com is in no way affiliated with
SAP AG.
Any unauthorised copying or mirroring is prohibited.
|