7.40 之前 | 7.40 | |
数据 |
DATA text TYPE string. text = 'ABC'. |
DATA(text) = 'ABC'. |
循环进入工作区 |
DATA wa like LINE OF itab. LOOP AT itab INTO wa. ... ENDLOOP. |
LOOP AT itab INTO DATA(wa). ... ENDLOOP. |
调用方法 |
DATA a1 TYPE ... DATA a2 TYPE ... oref->meth( IMPORTING p1 = a1 IMPORTING p2 = a2 ). |
oref->meth( IMPORTING p1 = DATA(a1) IMPORTING p2 = DATA(a2) ). |
分配时循环 |
FIELD-SYMBOLS: <line> type … LOOP AT itab ASSIGNING <line>. ... ENDLOOP. |
LOOP AT itab ASSIGNING FIELD-SYMBOL(<line>). ... ENDLOOP. |
读取分配 |
FIELD-SYMBOLS: <line> type … READ TABLE itab ASSIGNING <line>. |
READ TABLE itab ASSIGNING FIELD-SYMBOL(<line>). |
选择进入表 |
DATA itab TYPE TABLE OF dbtab. SELECT * FROM dbtab INTO TABLE itab WHERE fld1 = lv_fld1. |
SELECT * FROM dbtab INTO TABLE @DATA(itab) WHERE fld1 = @lv_fld1. |
选择单进 |
SELECT SINGLE f1 f2 FROM dbtab INTO (lv_f1, lv_f2) |
SELECT SINGLE f1 AS my_f1, f2 AS abc FROM dbtab INTO DATA(ls_struct) WHERE ... WRITE: / ls_struct-my_f1, ls_struct-abc. |