0

Covert column into row of internal table into another internal table

Apr 13 at 07:12 AM

103

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.

10 |10000 characters needed characters left characters exceeded

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

What do you mean with convert? Sum them up or whatsoever?

0
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Blesso Joshua Arulraj Apr 17 at 04:31 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Richard Harper Apr 13 at 07:38 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Richard,

Thanks for your instant reply :-)

I didn't get you, I am little new in ABAP. I need a logic for that. Can you help me please.

0

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

0
Ujjwala Thorave Apr 21 at 11:48 AM
0

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/

Share
10 |10000 characters needed characters left characters exceeded