使用 SAP ABAP 在带有标题行的内部表中添加行


请注意不要对内部表使用标题。当你使用它时,in_table2 的标题为空。使用循环以如下方式打印它 −

LOOP AT in_table2.   "here in_table2 means table (an internal table)
  WRITE / in_table2. "here in_table2 means the header of the table (a structure)
ENDLOOP.

当你在内部表中使用标题时,不应以相同方式使用它们。你应该使用领域符号进行循环并附加这样的 −

FIELD-SYMBOLS: <fs_for_loop> LIKE LINE OF in_table2[].
LOOP AT in_table2[] ASSIGNING <fs_for_loop>.
  WRITE / <fs_for_loop>.
ENDLOOP.

更新日期: 2020 年 3 月 13 日

1 千个以上浏览量

开始您的职业生涯

完成课程获得认证

立即开始
广告
© . All rights reserved.