前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >matinal:SAP ABAP7.40新语法 数据声明

matinal:SAP ABAP7.40新语法 数据声明

作者头像
matinal
发布2023-10-26 14:27:43
2260
发布2023-10-26 14:27:43
举报
文章被收录于专栏:SAP Technical
代码语言:javascript
复制
"Data Statement
"before
DATA text TYPE string.
text = `ABC`.
"740
DATA(text) = `ABC`.

"Loop at into work area
"before
DATA wa like LINE OF itab.
LOOP AT itab INTO wa.
…
ENDLOOP.
"740
LOOP AT itab INTO DATA(wa).  
  …
ENDLOOP.

"Call method
"before
DATA a1 TYPE …
DATA a2 TYPE …
oref->meth( IMPORTING p1 = a1
            IMPORTING p2 = a2
          ).
"740
oref->meth(
        IMPORTING p1 = DATA(a1)
        IMPORTING p2 = DATA(a2) ).

"Loop at assigning
"before
FIELD-SYMBOLS: <line> type …
LOOP AT itab ASSIGNING <line>.
  …
ENDLOOP.
"740
LOOP AT itab
   ASSIGNING FIELD-SYMBOL(<line>).
   …
ENDLOOP.

"Read assigning
"before
FIELD-SYMBOLS: <line> type …
READ TABLE itab
           ASSIGNING <line>.
"740
READ TABLE itab
   ASSIGNING FIELD-SYMBOL(<line>).
   
"Select into table
"before
DATA itab TYPE TABLE OF dbtab.
SELECT * FROM dbtab
  INTO TABLE itab
 WHERE fld1 = lv_fld1.
"740
SELECT * FROM dbtab
  INTO TABLE @DATA(itab) 
 WHERE fld1 = @lv_fld1.
 
"Select single into
"before
SELECT SINGLE f1 f2 
  FROM dbtab
  INTO (lv_f1, lv_f2)
 WHERE …
WRITE: / lv_f1, lv_f2.
"740
SELECT SINGLE f1 AS my_f1,
              F2 AS abc  
  FROM dbtab
  INTO @DATA(ls_structure)
 WHERE …
WRITE: / ls_structure-my_f1,ls_structure-abc.
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-10-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档