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

HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE

laxman_sankhla3
Participant
0 Likes
4,370

HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE

HOW TO CONVERT STRUCTURE INTO INTERNAL TABLE

8 REPLIES 8
Read only

Former Member
0 Likes
2,424

HI

Data: begin of itab,

matnr like mara-matnr,

end of itab.

Data: itab1 type table of itab.

OR

Data: itab1 like itab occurs 0 with header line.

Hope this helps.

Regds,

Seema.

Read only

Former Member
0 Likes
2,424

Hi laxman,

1. Suppose struct is your structure.

2. then

3. data : itab like struct occurs 0 with header line.

regards,

amit m.

Read only

0 Likes
2,424
data: begin of itab occurs 0,
 include structure <str_name>.
data: end of itab.
Read only

0 Likes
2,424

in the OO worl of ABAP itabs with header line are not accepted.

data: itab type standard table of <structure> .

Regards

Raja

Read only

0 Likes
2,424

a/c to SAP recommendations it is always better to avoid internal tables with header lines ....so better declare like

DATA : inter_tab TYPE STANDARD TABLE OF struct INITIAL SIZE 0.

Read only

Former Member
0 Likes
2,424

hi,

you can do in many ways...

1. data: it_mara type table of mara.

2. data: it_mara like mara occurs 0 with header line.

..

Regards

vijay

Read only

Former Member
0 Likes
2,424

lets declare a structure --

data: begin of str,

name(10),

age(3),

city(10),

end of str.

lets now convert this to an internal table itab --

data itab like table of str.

I hope this helps

regards,

-pankaj singh

Read only

gopi_narendra
Active Contributor
0 Likes
2,424

declaring a structure

types : begin of ty_tab,

matnr type mara-matnr,

MATKL type mara-MATKL,

end of ty_tab.

internal table declaration

data : IT_tab type standard table of ty_tab initial size 0,

IS_tab type ty_tab. (work area declaration)

Regards

- Gopi