SAP Loop Statement with Group by

Now you can use group by statement in loop

Syntax :-

loop at lt_vbrp into data(ls_vbrp)
group by ls_vbrp-vbeln
into data(lt_vbrp_g).
loop at group lt_vbrp_g into data(ls_vbrp_g).
add ls_vbrp-netpr to ls_output-netpr.
endloop.
append ls_output to lt_output.
endloop.

Leave a Reply

Your email address will not be published. Required fields are marked *