Application Development and Automation 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: 
Read only

internal table as a datatype.....

Former Member
0 Likes
903

Hi Friends,

Can we declare an internal table in an other internal table as a field(part) of that?....

for eg:

data: begin of material_Data occurs 0,

vendor_na like lfa1-name1,

matno like mara-matnr,

...........................,

..........................,

begin of base_measures,

weight(15) like mara-brgew,

vol(12) like mara-volum,

end of base_measures,

sales_org like mvke-vkorg,

..........................,

end of material_Data.

in the above example, is the <b>base_measures</b> another internal table or not.............

plz clarify this........

thanks in advance.....

raj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
887

that does not work as an internal table

but u can use that as a structure.

loop at material_data.

write 😕 material_data-base_measures-weight.

endloop.

u can use like this

Message was edited by: chandrasekhar jagarlamudi

5 REPLIES 5
Read only

Former Member
0 Likes
888

that does not work as an internal table

but u can use that as a structure.

loop at material_data.

write 😕 material_data-base_measures-weight.

endloop.

u can use like this

Message was edited by: chandrasekhar jagarlamudi

Read only

0 Likes
887

Hi Chandrashekar.....

thanks for the response...

but actually in 1 report i have the code like that.....

so cld u tell me the base_measures is acting like an other internal table or something other......??/

thnks

rajk

Read only

0 Likes
887

It does not act like an internal table , but it acts like a structure in that internal table

similar to INCLUDE STRUCTURE

Read only

0 Likes
887

thnks a lot....

its clear...

raj

Read only

Former Member
0 Likes
887

Raj,

You can very much have an internal table as a field of another internal table. These are called as Nested internal tables / Deep Strcutures. In this case for every row of the main internal, there might be multiple rows in the inner internal table. The structure might look something like

Main Table(

Field1

Field2

Inner_table type LVC_T_STYL)

I just took an example of LVC_T_STYL as it is a table type. So, now for every row in the Main table, you can have multiple row in the Inner_table.

Regards,

Ravi

Note : Please reward the posts that help you.