当前位置:网站首页>ABAP dynamic inner table grouping cycle

ABAP dynamic inner table grouping cycle

2022-07-07 03:59:00 Miserable youth

stay ABAP When dynamic inner table grouping loop is used in , If direct at end of or group by Will report a mistake .
At end of :

LOOP AT <dy_table> ASSIGNING <dyn_wa>.

  AT END OF belnr.
  ENDAT.
ENDLOOP.

 Insert picture description here

Group by:

LOOP AT <dy_table> ASSIGNING <dyn_wa> GROUP BY ( belnr = <dyn_wa>-belnr ) ASCENDING ASSIGNING FIELD-SYMBOL(<group>).
ENDLOOP.

 Insert picture description here

This is because <dyn_wa> It's a generic type , Only assignging Type only after .
resolvent :

LOOP AT <dy_table> ASSIGNING <dyn_wa>.
  ASSIGN COMPONENT 'BELNR' OF STRUCTURE <dyn_wa> TO <fs_belnr>.
  AT END OF <fs_belnr>.
  ENDAT.
ENDLOOP.

Close test effectively .

原网站

版权声明
本文为[Miserable youth]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207062117507489.html