cancel
Showing results for 
Search instead for 
Did you mean: 

Printing subtotal and grandtotal in scripts.

Former Member
0 Kudos

Hi Friends,

I have to print subtotals and grandtotal thro' SAPScripts.

My requirement is as follows.

ITAB

VENUM MATNR CHARG VEMNG VEMEH

1057 20021 123456 550 EA

1057 20021 123456 350 EA

1057 20020 213456 150 EA

1057 20020 213456 600 EA

1057 20019 123456 400 EA

DESIRED OUTPUT

VENUM MATNR CHARG VEMNG VEMEH

1057 20021 123456 550 EA

1057 20021 123456 350 EA

20021 900 EA

1057 20020 213456 150 EA

1057 20020 213456 600 EA

20020 750 EA

1057 20019 123456 400 EA

Please guide me to solve this issue. Your early help is highly appreciated.

Thanks ,

Pritesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
former_member426550
Participant
0 Kudos

hi..

use 2 variables..1 for subtotal and 1 for grandtotal...

loop at it_tab.

at end of variable.

subtotal = subtotal + it_tab-amount.

grandtotal = grandtotal + subtotal.

endat.

endloop.