Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

To get total qty delivered using ALV in a report

Former Member
0 Kudos

Hi All,

I am getting Quantity Delivered iout-lfimg in a ALV Report, in the last line I have to display total qty delivered. Can some one please help me to get this total qty delivered using ALV.

Thanks,

Veni.

FORM get_data.

SELECT Avbeln Akunag Avsbed Awadat_ist

Bwerks Bmatnr Blfimg Bvrkme

C~vbeln

INTO TABLE IDELI

FROM LIKP AS A

INNER JOIN LIPS AS B

ON avbeln = bvbeln

INNER JOIN VBFA AS C

ON Bvbeln = Cvbelv

AND BPOSNR = CPOSNV

WHERE A~VBELN IN S_VBELN

AND A~ERDAT IN S_ERDAT

AND A~ERNAM IN S_ERNAM

AND A~VSTEL IN S_VSTEL

AND A~VKORG IN S_VKORG

AND A~KUNAG IN S_KUNAG

AND A~VSBED IN S_VSBED

AND A~WADAT_IST IN S_WADAT

AND B~MATNR IN S_MATNR

AND B~WERKS IN S_WERKS

AND C~VBTYP_N = 'Q'.

ENDFORM. " get_data

FORM process_data.

loop at ideli.

if sy-subrc = 0.

concatenate ideli-vbeln ideli-ddeli into lv_wdelno.

MOVE ideli-vbeln TO iout-vbeln.

MOVE lv_wdelno TO iout-wdelno.

MOVE ideli-kunag TO iout-kunag.

MOVE ideli-vsbed TO iout-vsbed.

MOVE ideli-wadat_ist TO iout-wadat_ist.

MOVE ideli-werks TO iout-werks.

MOVE ideli-matnr TO iout-matnr.

MOVE ideli-lfimg TO iout-lfimg.

MOVE ideli-vrkme TO iout-vrkme.

endif.

append iout.

clear iout.

clear lv_wdelno.

endloop.

ENDFORM. " process_data

1 ACCEPTED SOLUTION

martin_schlegel
Explorer
0 Kudos

Hello Veni,

when you are in an ALV, you can click on the header of a column (the place where the field name is shown) and then on the Summ-button (the greek letter Sigma). Then the ALV creates totals automatically.

Regards.

Martin

4 REPLIES 4

martin_schlegel
Explorer
0 Kudos

Hello Veni,

when you are in an ALV, you can click on the header of a column (the place where the field name is shown) and then on the Summ-button (the greek letter Sigma). Then the ALV creates totals automatically.

Regards.

Martin

0 Kudos

Yes Martin,

But user wants the same thing to be displayed with out clicking the summ button. Please help.

Thanks,

Veni.

0 Kudos

Hi,

While building the fieldcatalog, for the total qty column use the below code :


gs_fieldcat-do_sum = 'X'.

Thanks,

Sriram Ponna.

0 Kudos

Thank you Sriram.

Regards,

Veni.