Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Structure with dynamical Table-Type

Private_Member_19084
Active Contributor
0 Kudos

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

2 REPLIES 2

marcin_makowski
Explorer
0 Kudos

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

0 Kudos

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.