‎2008 Aug 11 12:31 PM
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.............
‎2008 Aug 11 12:35 PM
‎2008 Aug 11 12:35 PM
‎2008 Aug 11 12:50 PM
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.