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

ITAB declaration

Former Member
0 Likes
949

hey gurus

Tables: vbak.

to refer this what is the efficient way of declarung a itab?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
914

Hi,

Tables: vbak

DATA: itab TYPE TABLE OF vbak.

Rgds,

Prakash

9 REPLIES 9
Read only

Former Member
0 Likes
915

Hi,

Tables: vbak

DATA: itab TYPE TABLE OF vbak.

Rgds,

Prakash

Read only

Former Member
0 Likes
914

Hi,

First declare work area as follows:

DATA: BEGIN OF WA_MBLNR,

MBLNR LIKE MSEG-MBLNR,

MJAHR LIKE MSEG-MJAHR,

END OF WA_MBLNR.

then declare internal table as follows:

DATA: IT_MBLNR LIKE TABLE OF WA_MBLNR .

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
914
data : itab type table of vbak occurs 0 with header line.


Or

data : begin of itab occurs 0.
            include structure vbak.
data:  end of itab.
Read only

Former Member
0 Likes
914

Declare like .

Data : itab type standard table of VBAK,

WA type vbak.

Please reward if useful.

Read only

Former Member
0 Likes
914

hi,

data : itab type standard table of vbak with header line.

rgds

Deepak

Read only

Former Member
0 Likes
914

Hi

As per standards we have to declare a type including all the fields

like

types : begin of ty_mara,

matnr type mara-matnr,

end of ty_mara.

data : it_mara type standard table of ty_mara.

data : wa_mara type ty_mara.

or

data : it_mara type standard table of mara.

data : wa_mara type mara.

regards

Shiva

Read only

Former Member
0 Likes
914

Hi,

if you wont all the fields of vbak

then declare like this,

data:itab type table of vbak,

else if you wont some fields in the table then declare structure,with the required fieldslike,as follows.

types:begin of ty_tab,

field1 type vbak-field1,

field2 type vbak-field2,

end of ty_tab.

after that declare a table type for this

ty_t_tab type standard table of ty_tab.

now declare internal table as follows,

data :it_tab type ty_t_tab.

Thanks,

Sarala.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
914

Hi,

data : itab type standard table of vbak,

wa type vbak.

select * from vbak into table itab.

loop at itab into wa.

write : / wa.

endloop.

Read only

Former Member
0 Likes
914

As per the standards its usually defined in this way.

TABLES SFLIGHT.

TYPE : BEGIN OF T_ITAB

CARRID LIKE SFLIGHT_CARRID

CONNID LIKE SFLIGHT_CONNID

END OF ITAB.

DATA : ITAB TYPE T_ITAB OCCURS 10 WITH HEADER LINE.