Application Development 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: 

Rows to Columns conversion in an Internal Table

0 Kudos

Hello All,

I have data like below:

Matnr1 ABC 100

Matnr1 ABC 200

Matnr1 ABC 500

Matnr2 XYZ 300

Matnr2 XYZ 600

I want data like this:

Matnr1 ABC 100 200 500

Matnr2 XYZ 300 600

Is it possible? If yes, could anybody help achieving this?

Thanks a lot in advance.

Ajay

5 REPLIES 5

Former Member
0 Kudos

You can possibly use loop.

Matnr1 ABC and then use the command <b>ON CHANGE OF</b>

and when it got changed u can print the value suppose counting the charaters as in this case it could be

Matnr1 ABC 100 Matnr1 ABC 100 +15(3)

and so on try to do it

if it works award points to me .

Thanks

Rahul

0 Kudos

Rahul,

The final data is being displayed in ALV format. The field catalog is also being created dynamically. In simple report, your solution will definitely work, but mine is AVL report. Can you advise any solution for AVL report?

Thanks and regards,

Ajay

former_member188829
Active Contributor
0 Kudos

Hi,

Check the links..

Former Member
0 Kudos

Hi Ajay,

Try this.

( this is temp table for your formate)

data: begin of itab1 occurs 10,

line(150),

end of itab1.

Sort itab by col1 col2. ( Here itab is your table )

loop at itab.

at new col2.

write: / itab-col1,

itab-col2.

concatenate itab-col1

itab-col2

into itab1.

endat.

write itab-col3.

concatenate itab1

itab-col3

into itab1.

at end.

append itab1.

clear itab1.

endat.

endloop.

loop at itab1.

write / itab1.

endloop.

Plzzz Reward if useful,

Mahi.

Message was edited by:

Maheswari Chegu

Former Member
0 Kudos

Hi,

use field symbols for ur requirement it will easy and simple.

plzz reward points if it helps.