Variable anlegen
* int
DATA(lv_int) = 1.
DATA(lv_int_empty) = VALUE i( ).
* float
DATA(lv_float_empty) = VALUE f( ).
DATA(lv_float) = CONV f( '0.1' ).
* char
DATA(lv_char) = 'ABCD'.
* string
DATA(lv_empty_string) = ||.
DATA(lv_string) = |Text|.
* bool
DATA(lv_bool) = abap_true.
* DDIC-Typ (z.B. MATNR)
DATA(lv_matnr) = CONV matnr( '1234567890' ).
DATA(lv_matnr_empty) = VALUE matnr( ).
Struktur anlegen
* definiert vom Anwender
TYPES: BEGIN OF ty_sflight,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
END OF ty_sflight.
DATA(lv_struct) = VALUE ty_sflight( carrid = 'LH'
connid = '0123' ).
* Strukturtyp aus DDIC (leer)
DATA(lv_headdata_empty) = VALUE bapimathead( ).
* Strukturtyp aus DDIC (gefüllt)
DATA(lv_headdata) = VALUE bapimathead( material = '1234567890'
basic_view = abap_true
purchase_view = abap_true
account_view = abap_true ).
interne Tabelle anlegen
* definiert vom Anwender
TYPES: BEGIN OF ty_sflight,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
END OF ty_sflight.
TYPES: ty_it_sflight TYPE STANDARD TABLE OF ty_sflight WITH DEFAULT KEY.
DATA(it_tab) = VALUE ty_it_sflight( ( carrid = 'LH' connid = '0123' )
( carrid = 'AA' connid = '3210' ) ).
* Stringtable aus DDIC (leer)
DATA(it_stringtab_empty) = VALUE stringtab( ).
* Stringtable aus DDIC (gefüllt)
DATA(it_stringtab) = VALUE stringtab( ( |Udo| )
( |Heinz| )
( |Klaus| ) ).
Objektreferenz anlegen
* Objektreferenz auf Klasse ALV-Grid
DATA(o_alv) = NEW cl_gui_alv_grid( i_parent = cl_gui_container=>default_screen
i_appl_events = abap_true ).
* Referenz auf int
DATA(lv_int) = 1.
DATA(o_int) = REF #( lv_int ).
* Referenz auf stringtab
DATA(it_stringtab) = VALUE stringtab( ).
DATA(o_tab) = REF #( it_stringtab ).