‎2009 Feb 10 10:10 AM
Hai all,
I have declared item no(EBELP) in my internal table(itab). When i give document no(EBELN) as input the
itab may contain 1 or 2 or 3 values.
My requirement is how to increase the column number dynamically as the itab increases?
if itab has 1 row means then output should contain 1 column,
if itab has 2 rows means then output should contain 2 columns....and so on
Regards
‎2009 Feb 10 10:25 AM
Hi,
You can do this using Dynamic Internal Tables. Get the Number of rows first. Then use a Do statement and populate the internal table of type field catalog. After this create a dynamic internal table. so if you have 10 records you get 10 columns if you have 100 then you get 100 columns.
Regarding creation of internal table there are lots of threads and blogs available in SDN.
Hope this would have helped you.
Thanks,
Prashanth
‎2009 Feb 10 10:15 AM
Check this program
HTWLINF0
or this link
[https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/dynamic%252binternal%252btable]
Regards
Sathar
‎2009 Feb 10 10:17 AM
‎2009 Feb 10 10:25 AM
Hi,
You can do this using Dynamic Internal Tables. Get the Number of rows first. Then use a Do statement and populate the internal table of type field catalog. After this create a dynamic internal table. so if you have 10 records you get 10 columns if you have 100 then you get 100 columns.
Regarding creation of internal table there are lots of threads and blogs available in SDN.
Hope this would have helped you.
Thanks,
Prashanth