cancel
Showing results for 
Search instead for 
Did you mean: 

Replacement Path Variable of Query with Condition

Former Member
0 Kudos

Query 1 has two conditions which limit the result rows that are displayed.

Query 2 has a replacement path variable which uses the results of Query 1 to filter an InfoObject.

The situation I am seeing is that the replacement path variable appears to be allowing values that should have been suppressed by the conditions on Query 1.  I.E., values that would show up in Query 1 when the conditions are not active, but suppressed when the conditions are active, are showing up in Query 2, even when the conditions are active in Query 1.

It appears that the replacement path variable in Query 2 is essentially running Query 1 with the conditions deactivated.

Is there any way to get the replacement path variable in Query 2 to run Query 1 with the conditions active?

Thanks in advance for any help,

Bob Perry

Accepted Solutions (1)

Accepted Solutions (1)

anshu_lilhori
Active Contributor
0 Kudos

Hi,

Copied from one document:

If you apply conditions to a query, you are not changing any numbers. Instead, you are just hiding the

numbers that are not relevant for you.

For this reason, conditions have no effect on the displayed values of the results rows.

The results row of a query with an active condition corresponds to the results row of a query without this condition

I hope you understand it.

Regards,

AL:

Former Member
0 Kudos

Anshu,

  That is helpful.  I may not have been totally clear in the wording of my initial question above.  I don't really care so much about the aggregated numerical result rows for query 1.

  What I really care about are the data rows displayed in the result set.  When I run query 1, the conditions limit what data rows are displayed.  I am hoping to find a way to use that condition-limited set of data rows from query 1 in query 2 using a replacement path variable.

  It appears that query 2 is receiving the total, non-condition-limited, set of data rows from query 1 (the equivalent of if I deactivated the conditions on query 1).

  It sounds like you are saying that the replacement path variable runs query 1 without regard to the conditions on query 1, and that when using a replacement path variable in query 2 there is no way to activate the conditions on query 1 and limit the set of data rows that are passed from query 1 to query 2. 

Is that correct?  

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Robert, Bob,

Created one new thread for this.

Regards,

Sonjoy Das

cornelia_lezoch
Active Contributor
0 Kudos

Hi Robert,

the only purpose of a prequery is to be run with conditions - and they are always run with conditions active if they are set as active in the query.

So if it is not working for you it will be a system error, or you use a frontend which can not handle prequeries.

which frontend are you using?

What happens, when you run your result query in RSRT?

regards

Cornelia

Former Member
0 Kudos

Hello Robert,

I am facing the same problem and have not found any solution as of now ?

Could you able to solve the problem?

Regards,

Sonjoy das

Loed
Active Contributor
0 Kudos

Hi,

You may create a new thread for your scenario..

Regards,

Loed

0 Kudos

Hello Sonjoy,

  It appears that that conditions are not like conditions in a SQL "where" clause... that is, conditions do not really limit the rows of the result set.  Rather, they only control which rows from the result set are displayed to the user, and the user can toggle conditions off and on without the query being re-run on the server... the actual result set doesn't change when conditions are toggled on... only the displaying/hiding of certain rows in the result set.

  As such, when a replacement path variable runs the query, it gets the full result set, regardless of whether conditions are active or not.

  The only "solutions"/"work arounds" I see are:

  1) run the first query with conditions active, copy the unique identifier column values to a text file or operating system clipboard, and then run the second query and filter the unique identifier column to those values,

or

  2) find some other method of using filters, rather than conditions, to limit the result set of query 1, so that it can then supply the results you want via the replacement path variable to query 2.

  If anyone else has more to add to this (i.e. a better way to accomplish this objective), I welcome your input!

Thanks,

Bob

anshu_lilhori
Active Contributor
0 Kudos

Hi,

Lately the same issue has been discussed.Refer the thread.

http://scn.sap.com/message/13721921#13721921

Regards,

AL

Former Member
0 Kudos

Anshu,

  I'd like to resume the discussion of this question. 

  Your reply directly above pointed to a discussion of how to pass char restriction to query behind replacement path variable.

  What I am interested in is different. 

  When I run query 1, two conditions limit what data rows are displayed in the output.  I am hoping to find a way to use that condition-limited set of data rows from query 1 in query 2 (using a replacement path variable in query 2 that runs query 1 and returns the data).

  It appears that query 2 is receiving the total, non-condition-limited, set of data rows from query 1 (the equivalent of if I deactivated the conditions on query 1).

  It sounds like you are saying that the replacement path variable runs query 1 without regard to the conditions on query 1, and that when using a replacement path variable in query 2 there is no way to execute query 1 with both conditions active and limit the set of data rows that are passed from query 1 to query 2

  Is that correct?