Skip to Content
0

Subtotal in Query SQ01

Feb 17 at 07:51 AM

76

avatar image

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.

1.jpg

1.jpg (20.9 kB)
SQL
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jelena Perfiljeva
Feb 19 at 06:12 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
Feb 19 at 02:46 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded