Skip to content

ABAP Keyword Documentation →  ABAP - Short Reference 

DATA - Short Reference

Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


DATA var[(len)] [TYPE { {abap_type [LENGTH len] 
                                   [DECIMALS dec]}
                      | {[LINE OF] type [BOXED]}
                      | {REF TO type}
                      | { {{[STANDARD] TABLE}
                          |{SORTED TABLE}
                          |{HASHED TABLE}}
                          OF [REF TO] type
                          [WITH [UNIQUE|NON-UNIQUE]
                             { {KEY [primary_key [ALIAS key_name]
                                  COMPONENTS] comp1 comp2 ...}
                             | {DEFAULT KEY} }]
                          {[WITH {UNIQUE HASHED}|{{UNIQUE|NON-UNIQUE} SORTED}
                             KEY key_name1 COMPONENTS comp1 comp2 ...]
                           [WITH {UNIQUE HASHED}|{{UNIQUE|NON-UNIQUE} SORTED}
                             KEY key_name2 COMPONENTS comp1 comp2 ...]
                           ...}
                          [INITIAL SIZE n]
                          [WITH HEADER LINE]}
                        | {RANGE OF type [INITIAL SIZE n]
                                         [WITH HEADER LINE]}
                        | {dbtab { READER|LOCATOR|{LOB HANDLE} }
                               | { WRITER|LOCATOR } FOR
                                 { COLUMNS blob1 blob2 ...  clob1 clob2 ... }
                               | { ALL [OTHER] [BLOB|CLOB] COLUMNS }
                                  [...]}} ]
              | [LIKE { {[LINE OF] dobj}
                      | {REF TO dobj}
                      | { {{[STANDARD] TABLE}
                          |{SORTED TABLE}
                          |{HASHED TABLE}}
                          OF [REF TO] dobj
                          [WITH [UNIQUE|NON-UNIQUE]
                             { {KEY [primary_key [ALIAS key_name]
                                  COMPONENTS] comp1 comp2 ...}
                             | {DEFAULT KEY} }]
                          {[WITH {UNIQUE HASHED}|{{UNIQUE|NON-UNIQUE} SORTED}
                             KEY key_name1 COMPONENTS comp1 comp2 ...]
                           [WITH {UNIQUE HASHED}|{{UNIQUE|NON-UNIQUE} SORTED}
                             KEY key_name2 COMPONENTS comp1 comp2 ...]
                           ...}
                          [INITIAL SIZE n]
                          [WITH HEADER LINE]}
                        | {RANGE OF dobj [INITIAL SIZE n]
                                         [WITH HEADER LINE]} }]
                [VALUE { val | {IS INITIAL} }]
                [READ-ONLY].

Effect

Declares a variable or an instance attribute var.

Additions