Skip to Content
avatar image
Former Member

Conversion from One Internal table to another

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 22, 2008 at 10:07 AM

    Hi,

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

    use nested loop.

    Regards,

    Anirban

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 22, 2008 at 10:08 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 22, 2008 at 10:21 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 09:56 AM

    Thanks all of you. That solved my problem

    Add comment
    10|10000 characters needed characters exceeded