02-17-2018 7:51 AM
Salam,
i have created SAP query presenting three columns.storage 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.
Regards,
Uzma Farooq.
02-19-2018 2: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.
02-19-2018 6: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.