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

Conversion from One Internal table to another

Former Member
0 Likes
530

Hello,

I need to convert the below to the one I mention below that.

Row Column Value

1 1 X1

1 2 Y1

1 3 Z1

2 1 X2

2 2 Y2

2 3 Z3

Col_1 Col_2 Col_3

X1 Y1 Z1

X2 Y2 Z2

Is there any special ABAP statement or FM which does this already ?

Thanks,

Kiran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
480

Hi,

there is no ready made one .. you have to use logic.

use nested loop.

Regards,

Anirban

4 REPLIES 4
Read only

Former Member
0 Likes
481

Hi,

there is no ready made one .. you have to use logic.

use nested loop.

Regards,

Anirban

Read only

Former Member
0 Likes
480

Hi,

Except field name, data type and length are same, then you can directly use 'APPEND LINES OF ITAB1 TO ITAB2'.

Try this.

Regards,

R.Nagarajan.

Read only

Former Member
0 Likes
480

hi,

Iam giving u the code samples.

1.LOOP AT IT_EXCEL INTO WA_EXCEL.

ASSIGN COMPONENT WA_EXCEL-COL OF STRUCTURE WA_EKKO TO <FEX>.

MOVE WA_EXCEL-VALUE TO <FEX>.

AT END OF ROW.

APPEND WA_EXCEL TO IT_EXCEL.

CLEAR WA_EXCEL.

ENDAT.

ENDLOOP.

2.

***SORT IT_EXCEL BY ROW COL.

***

***LOOP AT IT_EXCEL INTO WA_EXCEL.

***

***CASE WA_EXCEL-COL.

***

***WHEN 1.

***WA_EKKO-EBELN = WA_EXCEL-VALUE.

***

***WHEN 2.

***WA_EKKO-BUKRS = WA_EXCEL-VALUE.

***

***WHEN 3.

***WA_EKKO-BSTYP = WA_EXCEL-VALUE.

***

***WHEN OTHERS.

***

***ENDCASE.

***

***AT END OF ROW.

***APPEND IT_EKKO .

***CLEAR WA_EKKO.

***ENDAT.

***

***ENDLOOP.

Regards,

deepthi.

Read only

Former Member
0 Likes
480

Thanks all of you. That solved my problem