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: 

describe internal table

Former Member
0 Kudos
97

hi,

I would like to describe (generate) a internal table like a existing table:


data: var_xxx like table mara.

but without the fields (e.g. ernam, laeda).

Which possibilitys do I have?

Thanks

Michael

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos
52

Hi,

You have to use types declaration.

Types : begin of ty,

matnr type mara-matnr,

...declare all other fields you want here,

end of ty.

data itab type standard table of ty.

6 REPLIES 6

Former Member
0 Kudos
52

Please go thru the help topics in declaring internal tables.

may be the code you need will be :

data : xyz like mara occurs 0 [with header line ].

"[with header line ]" is optional

regards,

Sandeep Josyula

*Dont forget to reward helpful answers

jayanthi_jayaraman
Active Contributor
0 Kudos
53

Hi,

You have to use types declaration.

Types : begin of ty,

matnr type mara-matnr,

...declare all other fields you want here,

end of ty.

data itab type standard table of ty.

Former Member
0 Kudos
52

you can create a strc in se11 and then refer to that particular str in your program

data: t_ex like standard table of r_str initial size 0.

r_str is repostory str.

this str can be created from data element radiobutton in se11

santhosh

Former Member
0 Kudos
52

Hi Miachael,

this declares all of mara:

Data: begin of itab occurs 0.

include structure mara.

Data: end of itab.

this a part of mara.

Data: begin of itab occurs 0,

matnr like mara-matnr,

mtart like mara-mtart,

... ,

end of itab.

Regards, Dieter

Former Member
0 Kudos
52

Hi,

You can use the following simple syntax for your purpose.

data: it_mara type standard table of mara with header line initial size 0.

Bansi

SAP Technical Consultant.