08-20-2013 7:14 PM
Hi People ,
I have to declare data dynamically . In my requirement there is an internal table in which there will be some record , I have to put loop on the internal table and declare data dynamically with the same name that is there in internal table ..
Ex.
Category |
---|
AA |
BB |
CC |
I will put above internal table in loop and I have to dynamically declare data with character 2 with the name AA, BB, CC.
Please suggest me the coding for this .
Thanks
Kumar saurabh
08-21-2013 7:43 AM
Hi Kumar,
Firstly a direct solution will not be possible....
You can create a dynamic table with the field names as AA, BB, CC and create a line type of this dynamic table and use that with field symbols.
How to define a dynamic tab and use it.
http://wiki.sdn.sap.com/wiki/display/ABAP/Dynamic+Internal+table
Let me know if you need further help.
Regards
08-21-2013 7:55 AM
Hi Yakub ,
first of all thanks for your reply . See I just have to create dynamic variable with name AA, BB, CC .
similar to
Data aa(2) type c .
Data bb(2) type c .
Data cc(2) type c .
08-21-2013 8:13 AM
Yes Kumar I understand but how will you address something you don't know the name.....
SO you will need to collate these as a structure assignment you can referit directly in that case.
Still if you insist there is a possible solution of creating the entire report itself dynamically with include.
check this link.