cancel
Showing results for 
Search instead for 
Did you mean: 

Query - Selection Option on Subtotal

Former Member
0 Kudos

A customer has created a query and interface using transactions SQ01 and SQ02 that generates a report from tables EKKO - Purchase Document Header and EKPO - Purchase Document Item.

Referencing the Net Order Amount (EKPO-NETWR) they wanted subtotals to appear by Purchasing Document Number. I was able to give them that by changing the Sort and Total check boxes in their original query. So now they currently have a report that lists the Purchase Order Document (EKPO-EBELN), each Item Number for the Purchase Order (EKPO-EBELP), the Net Order Value for each item (EKPO-NETWR), as well as query-generated subtotals for each Purchase Order and a grand total of all Purchase Orders.

Now the customer would like to be able to select on the query-generated subtotals. For example, select all Purchase Order Documents whose query-generated subtotal is greater than $5,000, or select all Purcahse Order Documents whose query-generated subtotal is equal to $1,000.

Any suggestions on how to accomplish that would be greatly appreciated. Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can create a condition on Document Number to only display the document numbers where Net Order Value is greater than X.

This may help prevent confusion that could arise if you used two versions of the same fundamental key figure.

Edited by: Khaled McGonnell on Jul 13, 2010 4:55 PM

Former Member
0 Kudos

Khaled,

Thank you for reply. However, as I understand your reply, your suggested solution won't get me what I'm looking for.

There is a Net Order Value attached to every Item of a Document Number. Doing a selection where Net Order Value is greater than X will only do the selection on the individual Items. I want the selection to be based on the sum all of the Net Order Values attached to the same Document Number. Or stated another way, I want to be selecting on the SUBTOTAL of all of the Net Order Values for the same Document Number.

Former Member
0 Kudos

Hi,

we don't have option to filter based on the subtotals in query designer.

we have to do a round about solution.

Create a new key figure with cumulation based on the Po document and create a filter .

Thanks

PK.

Former Member
0 Kudos

PK,

Thanks for your reply. I'm an ABAP programmer, but am unfamiliar with the query designer, so would appreciate a little more assistance.

The customer has already defined a field, POTOTAL, but hasn't added it as a select-option, which I assume he will will need to do. I'm assuming that's what you mean by "key figure".

From there I'm kind of lost as far as creating the filter. If I was writing a report in ABAP code I'd have no problem doing it. Since the code that generates the report from the query designer is done dynamically, I'm scratching my head trying to figure out how I will stick the "filter" code in there.

Former Member
0 Kudos

Dick ,

you posted in wrong section . Repost the same thread in ABAP Development.

In this section it's all about Query Designer . It is a BI tool .

That is the reason why you are not understanding what we say .

Thanks,

PK.