Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I move 2 internal tables to 1 internal table using move-corresponding statement?

walkerist
Participant
0 Kudos
1,276

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?

5 REPLIES 5

_4ndr3as_
Explorer
0 Kudos
1,167

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

raymond_giuseppi
Active Contributor
0 Kudos
1,167

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.

0 Kudos
1,167

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

FredericGirod
Active Contributor
0 Kudos
1,167

Start with items table, otherwise you should have less entries than the lt_vbup table

Sandra_Rossi
Active Contributor
0 Kudos
1,167

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.