是否可以使用 ABAP 中的一条指令将 2 个结构与嵌套表字段合并?我尝试使用 MOVE-CORRESPONDING,但没有成功。
下面我写了一个我需要做的简化版本,我的真实结构有更多的表和一些单独的字段,但现在我只要求简化下面的代码
TYPES: BEGIN OF ty_nested_tables,
table1 TYPE STANDARD TABLE OF ty_table1,
table2 TYPE STANDARD TABLE OF ty_table2,
END OF ty_nested_tables.
DATA: nested1 TYPE ty_nested_tables,
nested2 TYPE ty_nested_tables,
nested3 TYPE ty_nested_tables.
我知道这可以为完整的 nested3 变量分组在一个 VALUE 中,但我想简化的部分是需要指定 table1 和 table2 当它们的名称和类型与目标相同时
nested3-table1 = VALUE #( ( LINES OF nested1-table1 )
( LINES OF nested2-table1 ) ).
nested3-table2 = VALUE #( ( LINES OF nested1-table2 )
( LINES OF nested2-table2 ) ).