Skip to Content
0
Former Member
Apr 09, 2008 at 08:10 AM

Getting the subtotal of the sorted recipient

11 Views

Hi,

I'd like to sort by recipient (WEMPF) and then display the subtotal of all the recipient. Doing the following does not give the correct sorting nor the subtotal.

subtotal = 0.

SORT t_mseg BY wempf.

LOOP AT t_mseg_w INTO ws_mseg

WHERE mblnr = ws_mkpf-mblnr

AND mjahr = ws_mkpf-mjahr.

\

subtotal = subtotal + ws_mseg-cmenge.

AT END OF wempf.

WRITE : 'Subtotal = ' , subtotal.

ENDAT.