Get Example source ABAP code based on a different SAP table
• TABLE OF DATA • INITIAL SIZE DATA • STANDARD TABLE DATA • SORTED TABLE DATA • HASHED TABLE DATA • TABLE OF CLASS-DATA • STANDARD TABLE CLASS-DATA • SORTED TABLE CLASS-DATA • HASHED TABLE CLASS-DATA • INITIAL SIZE CLASS-DATA • TABLE OF STATICS • STANDARD TABLE STATICS • SORTED TABLE STATICS • HASHED TABLE STATICS • INITIAL SIZE STATICS • TABLE OF CONSTANTS • STANDARD TABLE CONSTANTS • SORTED TABLE CONSTANTS • HASHED TABLE CONSTANTS • INITIAL SIZE CONSTANTS
DATA>, TABLE OF> Short Reference >
ABAP_SYNTAX DATA itab ${ ${TYPE $[STANDARD$]$|SORTED$|HASHED TABLE OF $[REF TO$] type$}> $| ${LIKE $[STANDARD$]$|SORTED$|HASHED TABLE OF dobj$} $} > $[tabkeys>$]> $[INITIAL SIZE n$]> $[VALUE IS INITIAL$]>> $[READ-ONLY$]>.>
What does it do? This statement defines an internal table. The definition of the line type, the table category (STANDARD TABLE>>, SORTED TABLE>>, or HASHED TABLE>>), and the initial memory requirement> INITIAL SIZE>> matches the definition of table categories in the section TYPES> - TABLE OF>> exactly. Using DATA>, these additions create a bound table type. The generic types ANY TABLE> and • TABLE > cannot be used with DATA>. tabkeys>> is used to define the table keys> of the internal table, which, unlike data types, cannot be generic.
Latest notes:
When an internal table is created as a data object, only the administrative entry of an internal table is generated. The actual table lines are only inserted at runtime.
When an internal table is defined, the start value after the addition VALUE>> must be IS INITIAL>. NON_V5_HINTS
There are several obsolete variants for declaring standard tables that are described under Obsolete Declarations >. In particular, the use of the additions WITH HEADER LINE>> and OCCURS>> is obsolete. ABAP_HINT_END
ABAP_EXAMPLE_VX5 Declaration of an internal hashed table. The line type corresponds to the structure of the database table SPFLI >>. Two key fields are defined for the primary table key. The other statements demonstrate the filling of the table with lines from the DDIC database table SPFLI>> and how a line is read. ABEXA 00172 ABAP_EXAMPLE_END