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: 

different structure types in itab

Former Member
0 Kudos
143

hello experts,

how can i fill the itab with different structure types.

if i give the componenttype/domain to 'any' in my structure declaration, then its not saving and showing the error.

how to solve this problem

thanks

Tim

5 REPLIES 5

Former Member
0 Kudos
102

Hi

can u try like

DATA : BEGIN OF it_itab OCCURS 0.

INCLUDE STRUCTURE <any structure>. " structure.

DATA : END OF it_itab.

what is the error u got.

Regards

Ramesh

0 Kudos
102

hi,

thanks for your responce,

its not one structre to include, i mean in itab the first entry will be one structre type and second will be different strcture type.

Is there any generic type of structure to include for itab.

thanks

Time

0 Kudos
102

Hi,

I think there is no general structure which accepts data of any types. I have the doubt why you need one internal table for storing data of different structure. You can declare multiple internal tables and store corresponding structure to that itab.

If you are looking for some internal table type whose structure can be dynamic then you can go for Field symbols table which is of form

field-symbols <itab> type standard table.

this can hold data of any structure.

but not rows of different structure ( which i think have no reason to be so )

Cheers

Kothand

Former Member
0 Kudos
102

Hi,

data: begin of w_tab,

matnr type matnr, "Data element

belnr type bkpf-belnr, "Referring a field

fld type marc, "Refering the structure of MARC table

end of w_tab,

itab like standard table of w_tab.

Is this what you are asking?

0 Kudos
102

Hi

I hope you can make use of FIELD-SYMBOLS inside a internal table

Regards

pavan