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

describe internal table

Former Member
0 Likes
833

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
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
788

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
Read only

Former Member
0 Likes
788

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

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
789

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.

Read only

Read only

Former Member
0 Likes
788

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

Read only

Former Member
0 Likes
788

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

Read only

Former Member
0 Likes
788

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.