#yyds干货盘点#ABAP新语法(一)


1 变量及对象声明


1.1变量声明
Before:

DATA text TYPE string.
text = `...`.

After:

DATA(text) = `...`.

1.2使用工作区

Before:

DATA wa like LINE OF itab.
LOOP AT itab INTO wa.
...
ENDLOOP.

After:

LOOP AT itab INTO DATA(wa).
...
ENDLOOP.

1.3返回参数

Before:

DATA xml TYPE xstring.
CALL TRANSFORMATION ... RESULT XML xml.

After:

CALL TRANSFORMATION ... RESULT XML DATA(xml).