SAP ABAP 定义一个嵌套内表

2023-10-13 14:28:49 浏览数 (1)

1. SE11中定义一个表类型 

这里找了一个SAP标准的表类型EKKO_TTY    (注意:一定是需要表类型

2. 定义内表时使用table type

代码语言:javascript复制
REPORT ztest_deep_it.
TYPES: BEGIN OF ty_po,
         bukrs  TYPE bukrs,          "Company Code
         podata TYPE ekko_tty,       "PO Data
       END OF ty_po.
DATA:git_po TYPE STANDARD TABLE OF ty_po WITH HEADER LINE.
DATA:gwa_podata TYPE ekko.
git_po-bukrs = '0001'.
 
SELECT *
  INTO TABLE git_po-podata
  FROM ekko
 UP TO 10 ROWS.
 
APPEND git_po.
 
LOOP AT git_po.
  WRITE:git_po-bukrs.
  LOOP AT git_po-podata INTO gwa_podata.
    WRITE:/ gwa_podata-ebeln.
  ENDLOOP.
ENDLOOP.

0 人点赞