ABAP SYNTAX FOR DATA PART THREE

CONTINUED FROM EARLIER POST THAT IS

SYNTAX FOR SAP ABAP DATA PART TWO

Addition 4

... LIKE f1 OCCURS n

Effect

Defines an internal table without header line. Such a table consists of any number of table lines with the structure as specified by the data object f1 . Processing is the same as for addition 3.

Example

 DATA:  BEGIN OF PERSON,
         NAME(20),
         AGE TYPE I,
       END OF PERSON.
DATA:  PERSONS LIKE PERSON OCCURS 20.
 
PERSON-NAME = 'Michael'.
PERSON-AGE  = 25.
APPEND PERSON TO PERSONS.
PERSON-NAME = 'Gabriela'
PERSON-AGE  = 22.
APPEND PERSON TO PERSONS.
 The internal table  PERSONS  now consists of two table entries.

Addition 5

... TYPE LINE OF itabtype

Effect

The specified type itabtyp must be an internal table type. This operation creates a data object with the same line type as the table type specified.

Example

 TYPES TAB_TYP TYPE I OCCURS 10.
DATA TAB_WA TYPE LINE OF TAB_TYP.

The data object TAB_WA now has the same attributes as a line of the table type TAB_TYP and thus the type I . 

Addition 6

... LIKE LINE OF itab

Effect

The data object tab must be an internal table with or without a header line. This operation creates a data object with the same line type as the table specified.

Example

 DATA TAB TYP TYPE I OCCURS 10.
DATA TAB_WA TYPE LINE OF TAB.

The data object TAB_WA now has the same attributes as a line of the table TAB and thus the type I .

No comments :

Post a Comment