cancel
Showing results for 
Search instead for 
Did you mean: 

How move some fields of internal table to other without any loop?

Former Member
0 Kudos

Hi,

I have my all data in xvbap internal table.

i want to move 2 fields MATNR and quantity into second internal table,

without any loop.

how i will do that?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Shefali,

You cant move the some of the fields from one table to another table, if the tables identical also itab1[] = itab2[] will not work for your scenario as it will move all the fields. You have to loop the first table and append the required data into to second table.

Regards,

Arun.

Former Member
0 Kudos

Well the MOVE-CORRESPONDING will work only in case the itab has a header line, moreover only one record (contained by header line) will be moved.

And if the internal tables are identical with respect to fields , itab1[] = itab2[] is handy.

aris_hidalgo
Contributor
0 Kudos

Hi,

you can try read table itab transporting f1 f2 or some other conditions.

then:

itab2-f1 = f1.

itab2-f2 = f2.

Regards!

Former Member
0 Kudos

Hi,

Use the below statement.

MOVE-CORRESPONDING xbap-matnr TO itab-matnr.

MOVE-CORRESPONDING xbap-quantity TO itab-quantity.

Hope it helps.

Regards,

Maheswaran.B

Message was edited by: Maheswaran B

Former Member
0 Kudos

Hi shefali,

1. IF we follow some discipline, than

this can be done in one simple statement.

2. itab[] = xvbap[]

3. but the condition is :

a) the field name and field sequence (from left to right) should be same

b) if xvbap contains field A,B,C,D,E,F

and itab contains A,B

then this will work fantastic.

regards,

amit m.