SAP FI, CO, MM, PP, SD, PM, PS, QM, SM, HR, WF, BW, APO, Basis,  ABAP/4, Certification, Books
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.

Return to :-
SAP Hints and Tips on Configuration and ABAP/4 Programming

(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.