Skip to Content
-1
Dec 21, 2018 at 05:05 PM

Perform some calculations with nested loops using FOR iteration in new syntax of ABAP 7.4

332 Views

Could someone help with, How to keep adding values of nested table and main perform some calculation on main table with FOR iteration in new syntax of ABAP 7.4

Eg :

LOOP at lt_item INTO DATA(lw_item).

CLEAR LV_QUAN.

LOOP AT lt_schedule INTO DATA(lw_schedule)
WHERE doc_number = lw_item-doc_number
AND itm_number = lw_item-itm_number.
lv_quan = lv_quan + lw_schedule-confir_qty.
ENDLOOP.
IF sy-subrc EQ 0.
lw_output_i-qty_cancelled = lw_item-req_qty - lv_quan.
ENDIF.

ENDLOOP.