2023 May 09 3:14 AM
I have lt_vbuk, lt_vbup. can I use move-corresponding statement to move this to tables to 1 internal table named lt_vbup_key?
2023 May 09 6:34 AM
Hi Wane,
Depends on the structures of your defined internal tables. Check out this link MOVE-CORRESPONDING for Internal Tables - ABAP Keyword Documentation (sap.com)
Regards Andreas
2023 May 09 6:34 AM
In recent versions there is a statement MOVE-CORRESPONDING itab1 TO itab2. Also use the option KEEPING TARGET LINES if you don't want to remove already existing records.
2023 May 09 8:36 AM
Using
MOVE-CORRESPONDING itab1 TO itab3.
MOVE-CORRESPONDING itab2 TO itab3 KEEPING TARGET LINES.
Will append both tables records in a single table, and not merge records of course.
NB: If you call SD_VBUP_READ_FROM_DOC_MULTI with this data to prevent dumpo, you wont get result for records without item number (from lt_vbuk) you should call the FM twice, once with vbuk key once with vbup key
2023 May 09 6:38 AM
Start with items table, otherwise you should have less entries than the lt_vbup table
2023 May 09 7:48 AM
With MOVE-CORRESPONDING only, no it's not possible to merge 2 internal tables into 1.
As you can imagine, this statement takes only 1 internal table as source:
MOVE-CORRESPONDING itab1 TO itab2.
But of course, using other statements, you can merge 2 source internal tables into 1.