‎2007 Sep 11 3:26 AM
Hi all,
I need clarification regarding below code....
TYPES: BEGIN OF TY_TAB,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
END OF TY_TAB.
TYPES: TAB TYPE TY_TAB OCCURS 1.
From the above code What exactly TAB means whether it is an internal table with header line or else only work area or else is it a structure?
Thanks & Regards.
Laxman.P
B'lore
‎2007 Sep 11 3:29 AM
TYPES: BEGIN OF TY_TAB,
VBELN TYPE VBAK-VBELN,
ERDAT TYPE VBAK-ERDAT,
END OF TY_TAB.
TYPES: TAB TYPE TY_TAB OCCURS 1.
all the above statements are TYPES. The first one is the TYPES definitation for a structure. The second is a table type definitition.
Only WHEN YOU USE DATA statement the memory is allocated.
so you need to have
DATA: IT_TAB TYPE TAB.
ONLY When you have a data statement the definitaiton is complete.
Cheers
VJ
‎2007 Sep 11 3:31 AM
Hi VJ,
Table type definition means that TAB comes under structure or internal table?
Regards.
Laxman.P
‎2007 Sep 11 3:34 AM
Its a table. Coz they have used OCCURS 0 in the types.
Cheers
VJ
‎2007 Sep 11 3:30 AM
It is just another TYPE.. An itab/wa/structure has to be declared with the keyword DATA referencing a TYPE.
Arya
‎2007 Sep 11 3:35 AM
Hi laxman
The type that you declare is type of internal table. you can create internal table by reference this type.
Example
Data it_tab type ty_tab.
it_tab is internal table , not a structure.
Regards
Wiboon
‎2011 Jan 25 7:34 PM