Application Development and Automation 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: 
Read only

Apend data's from one internal table to another which has diff. structures

Former Member
0 Likes
469

Hello all,

DATA: BEGIN OF I_PUT_DATA OCCURS 0,

SOLD_TO TYPE /BIC/AZVAITM00-SOLD_TO,

MATERIAL TYPE /BIC/AZVAITM00-material,

ORDER_QTY TYPE /BIC/AZVAITM00-ORDER_QTY,

DOC_TYPE TYPE /BI0/OIDOC_TYPE,

END OF I_PUT_DATA.

DATA: BEGIN OF I_AZVAITM00 OCCURS 0,

DOC_NUMBER TYPE /BIC/AZVAITM00-D OC_NUMBER,

S_ORD_ITEM TYPE /BIC/AZVAITM00-S_ORD_ITEM,

FISCVARNT TYPE /BIC/AZVAITM00-FISCVARNT,

SOLD_TO TYPE /BIC/AZVAITM00-SOLD_TO,

MATERIAL TYPE /BIC/AZVAITM00-material,

ORDER_QTY TYPE /BIC/AZVAITM00-ORDER_QTY,

DOC_TYPE TYPE /BI0/OIDOC_TYPE,

END OF I_AZVAITM00.

There are above two internal table (I_PUT_DATA , I_AZVAITM00 ). data got selected into I_AZVAITM00 .

Now I want to copy data from I_AZVAITM00 to I_PUT_DATA .

I am doing in following way.

LOOP AT I_AZVAITM00.

MOVE-CORRESPONDING I_AZVAITM00 TO I_PUT_DATA.

APPEND I_PUT_DATA.

ENDLOOP.

Is there is another way. Outside loop only how can we assign/Move data?

3 REPLIES 3
Read only

former_member386202
Active Contributor
0 Likes
450

Hi,

Try like this

LOOP AT I_AZVAITM00.

I_PUT_DATA-field1 = I_AZVAITM00-field1.

I_PUT_DATA-field2 = I_AZVAITM00-field2.

I_PUT_DATA-field3 = I_AZVAITM00-field3.

like this.........

APPEND I_PUT_DATA.

ENDLOOP.

Regards,

Prashant

Read only

Former Member
0 Likes
450

HI

Its not possible because ITABs are having different structure.

Aditya

Read only

Former Member
0 Likes
450

Hi,

move-corresponding itab2 to itab1.r

move itab2-field1 = itab1-field1,.

move itab2-field2 = itab1-field2.

like this we can move the data between two internal tables.

please reward points, if it is useful,

regards,

satish.