Any table structure in a DDIC structure

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Posts: 490
Joined: Fri Jan 23, 2004 10:39 am

Any table structure in a DDIC structure

Post by sapmanie » Tue Jul 25, 2017 10:44 am

I need a field in a DDIC structure (SE11) to hold table data. Normally I would use a table type reference, however the table structure containing the data can change. is it possible to create a structure with a "dynamic" table field?

e.g. If the structure was defined in a program, it would look something like the code below. I am looking to have the equivalent of "type any table" defined in the DDIC structure:

[code]data: begin of t_structure
tabname type string,
tabdata type any table, "ddic error
tabdata2 type lvc_t_fcat, "ddic ok but is fixed to the lvc_t_fcat structure
end of t_structure.[/code]


Posts: 1
Joined: Wed Nov 27, 2013 2:31 pm
Location: Россия

Any table structure in a DDIC structure

Post by Maxmerdins » Fri Mar 02, 2018 6:53 am

When youre looking at the structure of a table, SAP will let you print the structure, but it wont let you save the structure. This can be annoying. This report outputs the table structure to a list. At this point the user can use the System->List->Save->Local file command to save the list to a file.
Output Table Fields to a List


Posts: 1
Joined: Thu Apr 05, 2018 3:54 am

Re: Any table structure in a DDIC structure

Post by Ditty » Sat Apr 14, 2018 11:06 am

Do you think there's a chance for them to add a save option if someone requests it as a feature? I think that'd be neat to have because it really is annoying at times not to be able to do that.

Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Re: Any table structure in a DDIC structure

Post by Rich » Mon May 07, 2018 7:25 pm

That's what all the dynamic runtime stuff is for.

If you know the rules how to construct the table structure, then you can do stuff like:

Code: Select all

     If w_Structure_Name is not initial.
        Create Data o_Structure Type (w_Structure_Name).
        Create Data o_Structure Type (w_Structure_Name_Item).
     Assign o_Structure->* to <f_Struc>.
     Read Table t_OutTab Index pu_SelField-TabIndex Assigning <f_Struc>.

If the structures are to be used by a single program or class then do it in the program, otherwise create a new class to construct the tables for you and use that


Abap KC:

Post Reply