Skip to Content

Subtotal in Query SQ01


i have created SAP query presenting three location, consumption & Rejection.

i want to show storage location wise consumption's subtotal as well as rejections 's subtotal. i tried for sort and total checks in basic list. these options show subtotal with expanded view. i need the by default subtotal in line item with respect to storage location where i'll be able to calculate a third column presenting rejection %age of consumption.

is there any way to call storage location wise subtotaled amount in line item rather than layout subtotal.

any suggestions will be highly appriciated.


Uzma Farooq.


1.jpg (20.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 19, 2018 at 06:12 PM

    In Queries, we have only limited options. From what I see, essentially you'd have to set the subtotals in the layout yourself and then just don't allow for the layout to be changed. I'm not aware of any code elements in the infoset that would allow to force the subtotals.

    For more flexibility you'd need to go with a new ABAP report, as Raymond suggested.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 19, 2018 at 02:46 PM

    With a tool like OO class CL_GUI_ALV_GRID, you can manage yourself calculation of subtotals handling event AFTER_REFRESH. using method GET_SUBTOTALS to adapt subtotals and REFRESH_TABLE_DISPLAY to display the updated values.

    Using this kind of tool in a SQ01 Query is counter-intuitive because the purpose of such query is to prevent coding as much as possible. If you actually want to use SQ01/SQ02, you could try to add some code in the dataset. To get a reference to the ALV class behind full screen ALV display and handle the events, use FM GET_GLOBALS_FROM_SLVC_FULLSCR...

    Hint: Better build a new report using OO.

    Add comment
    10|10000 characters needed characters exceeded