Skip to Content
author's profile photo Former Member
Former Member

To get total qty delivered using ALV in a report

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 31, 2008 at 05:53 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.