‎2007 Feb 22 6:24 AM
hey gurus
Tables: vbak.
to refer this what is the efficient way of declarung a itab?
‎2007 Feb 22 6:26 AM
‎2007 Feb 22 6:26 AM
‎2007 Feb 22 6:27 AM
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
‎2007 Feb 22 6:27 AM
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.
‎2007 Feb 22 6:28 AM
Declare like .
Data : itab type standard table of VBAK,
WA type vbak.
Please reward if useful.
‎2007 Feb 22 6:29 AM
hi,
data : itab type standard table of vbak with header line.
rgds
Deepak
‎2007 Feb 22 6:31 AM
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
‎2007 Feb 22 6:32 AM
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.
‎2007 Feb 22 6:52 AM
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.
‎2007 Feb 22 12:44 PM
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.