07-14-2011 10:22 AM
Hi experts,
is there a possibility, to create a structure via SE11 and including there a field which referes to a dynamic table-type.
So that I can append to this structure-field all different table-types?
for example: ones I append MARA[] and ones AFKO[]
Thx for help
07-14-2011 2:26 PM
Hi Christian,
There's not predefined generic type to do that, but you could create your own field type (deep structure) which would be able to keep table lines after transposition (90 degree flip) where in example it would have four columns: Table type, row id(index) field name, value. That way you could store ANY table row you need... This will not come cheap and will involve some work of course.
You may want have a look at standard ABAP services RRTS and RTTI (see classes and structures used in attributes an parameters) - these are two services for handling data types and metadata related operations during runtime. You may want to use them for flipping your table entries to the tabular form and so on. You may also find some ideas there on how to compose your own data type for your purposes.
Good luck!
Marcin
07-14-2011 2:34 PM
I already found the solution on my own:
fieldtype must be DATA and you have to set the flag at ReferenceType
In Programm you can append different table-types with the use of field-symbols and "create object".
example on mara:
field-symbols: <fs_mara> type standard table.
create data <struct>-dyn_table type table of MARA.
assign <struct>-dyn_table->* to <fs_mara>.
<fs_mara> = mara[].
thats it.