Skip to Content
avatar image
Former Member

Covert column into row of internal table into another internal table

Hello,

I have one internal table lt_werlgo

TYPES : BEGIN OF ty_werlgo,
werks TYPE werks_d,
lgort TYPE lgort_d,
werlgo TYPE char9,END OF ty_werlgo.

Now I want to convert entries of column werlgo into one row.

How can I do this? Please help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 17, 2017 at 04:31 AM

    Your requirement is like dynamic internal table.

    You can form fieldcatlog from that you can create the internal table.

    Search for dynamic internal table and you will get idea.

    Answered and example link

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 13, 2017 at 07:38 AM

    I'm not sure I understand fully what you're asking, but if you mean you want to be able to have multiple values of werlgo in each row then create a deep structure, something like:

    Types: Begin Of Werglo,
                 Werglo Type Char9,
           End Of Werglo,
           Werglos Type Standard Table Of Werglo With Default Key,
    *
           Begin Of ty_Werglo,
                 Werks  Type Werks_d,
                 LgOrt  Type LgOrt_d,
                 WerGlo Type Werglos,
           End Of ty_Werglo,
           ty_Werglos Type Standard Table Of ty_Werglo With Default Key.

    Rich

    Add comment
    10|10000 characters needed characters exceeded

    • Sorry - we've had a bout of public holidays here. The above is a type declaration .

      You read the itab with your source data. Each time you encounter a new combination of werks and lgort append a new row (using field symbols....) and just keep appending your werglo's to field WerGlo in the current record.

      Rich

  • avatar image
    Former Member
    Apr 21, 2017 at 11:48 AM

    Hi All,

    Thank you very much for all replies.

    Now I am able to convert entries of column werlgo into one row.

    Helpful link -

    https://blogs.sap.com/2013/06/11/dynamic-internal-table-iilustrated-with-an-example-of-creating-the-transpose-of-internal-table/

    Add comment
    10|10000 characters needed characters exceeded