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.