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

Create Dynamic internal table

praveen_kumar132
Participant
0 Likes
338

I have an requirement to list out the quantity sold to customers.....but i need to list out the columns dynamically ie the column should contain customer only if sale done to him for the given period.for example - if sale is done for 15 customer for the given period then i need to have 15 +1(column for material) columns...if sale done for 30 customer then i need to have 30 + 1 columns in my report..

i ve tried this call method cl_alv_table_create=>create_dynamic_table and

created dynamic table but i cant move datas into the dynamic table as per my requirement..how is it possible? plz help me.............

1 ACCEPTED SOLUTION
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
314

hi ,

check below links..

hope , this may help U

With Warm Regards.

Always Learner

2 REPLIES 2
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
315

hi ,

check below links..

hope , this may help U

With Warm Regards.

Always Learner

Read only

Former Member
0 Likes
314

Hi,

this is indeed a strange requirement. That means that material1 in line 1 has been sold to 5 clients, material2 in line2 was sold to 25 clients, material3 in line 3 was sold to 1 client ......

First you must understand that you don´t need a dynamic table for reading and storing temporarily the information. You just need 2 fields:

data: begin of mytable occurs 0,

material type mara-matnr,

client type vbpa-kunnr,

end of mytable.

select information from somewhere

sort table mytable by material client.

loop at mytable.

at new material. "<-- every time there´s a new material

uline /10.

pos = 10.

endat

write at pos mytable-client. "<-- print all clients with 15 chars space inbetween

pos = pos + 15. "<-- KUNNR is 10 chars long, so 15 is Ok

endloop.

I didn´t check the code at runtime but this will give you an idea on how to handle this.

Mark points if helpful.