10-14-2010 7:03 AM
Dear All,
I am having a similar requirement. I have an internal table.. which contains "N" number of unique records based on combination of Bukrs and Branch.
EG:
1. C1 B1
2. C1 B2
3. C1 B3
4. C2 B1
5. C2 B2
6. C3 B1
7. C3 B4
8. C3 B5
9. C4 B1
10.C5 B1
C Indicates Company Code
B Indicates Branch
is it possible to create 10 unique internal tables at run time based on these combinations ? IF yes , can any1 guide me how to create the same.
My concerns.. if it is possible .. how do i create unique names of Internal table for the same.
Regards,
Jitesh.
Edited by: kishan P on Oct 14, 2010 1:38 PM
10-14-2010 8:30 AM
if you have a fixed structure for the internal tables, you can just create a table of tables in se11 and use that to create a internal table.
and if you don't, you can create the table of tables dynamically too but it would become a bit complex.
10-14-2010 8:46 AM
Sure it is.
You can either use RTTS -> for this refer [Do you really know everything about typing? - part 2|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20887] [original link is broken] [original link is broken] [original link is broken];
The easier approach would be using CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE . Just type this class & method name in SCN search and you will find lots of resources.
Note!
You can't however generate dynamic named tables. Any apoprach you choose will result in data/object reference you will use as a pointer to dynamically created table. So no name here applies. However the components' names can be whatever you want.
Regards
Marcin