cancel
Showing results for 
Search instead for 
Did you mean: 

Pass 1st Query Variables to 2nd Query

Former Member
0 Kudos

Hello,

Requirement is calling one query from another query.

On one MultiProvider created two different BEx queries. Using WAD created 2 templates (for each queries). While executing 1st query (1st Web template), I am calling second Query (2nd Web Template). In 1st template (1st query), I have variables and filtered values, same values should be displayed in 2nd template - Variable - screen.

But while executing 2nd Query, Variable screen is empty, even though, I have used same zvariables.

How to pass 1st screen filtered/variables to 2nd template (Query).

Note: Advised not to use RRI.

Appreciate you help in resolving above issue.

Thanks,

Madhu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Madhu,

On the Second Query, create a replacement path variable on the object which you need to filter as per the First Query. In the Replacement Path Tab, there are two options, 1) Query and 2) Variable. Select the option Query and mention the first Query name.

The report will be filtered as per the result of the First Query.

Good Luck.

Regards,

Vikra

Former Member
0 Kudos

Hi Vikram,

Thank you for your response. in 1st Query, after results displayed, user may user Filters (Since it is WAD), How to pass filter values to 2nd query. Anyway, I will try your option and get back to you.

Thanks,

Madhu

Former Member
0 Kudos

Vikram,

I have tried your solution (Replacement Path - Query), it did not work. 1st query has filter values (since it is WAD output), those filter values are not transfered to 2nd Query (It is also WAD).

Is there any specific way to follow to pass Filter values to Next Query..?

Thanks,

Madhu.

Edited by: Madhu on May 9, 2011 3:41 PM

Former Member
0 Kudos

Hi,

Any thoughts on my issue..

I have changed my design, Now on initial Query (Web Template 1 - on DP1), filtering on Version(Say 10), Now I have used Different data Provider (DP2) filtering on Version on same Query (Say 20), I can capture this value into Java Script variable..

Now when I call 2nd Query, it has two variables. One is plant, 2nd variable is Version ( I can give multiple values for this variable). I want to pass DP1- Version value, & DP2 u2013 Version (like 10;20). How can I achieve this..?

Your suggestion/solution is highly appreciated.

Thanks,

Madhu

Former Member
0 Kudos

Hi ,

Clarify this doubt for me . Are you saying that when i execute the 2nd query , the output of first query should act as an input for the second query ?

Kind Regards,

Ashutosh Singh

Former Member
0 Kudos

Hi Ashutosh,

Thank you for going thru' my question. 1st I will execute 1st query (Web Template) with variables (like Plant, Version, Matl group, etc.,), result displayed again user use may filters (say User selected required Purchase group) and then he will call 2nd query (Clicks Button - since it is WAD). Now 2nd Query will start execute (2nd Web template called). Now same variables (as 1st query) displayed with blank Variable screen.

My question is how to pass 1st query variables and filter values to 2nd query.(Since it is WAD, we can use SET_SELECTION_SATE (for filter values), SET_VARIABLES_STATE, I am not sure correct syntax for this, tried but did not work).

Hope I have clarified your question.

Thanks,

Madhu.

former_member183777
Active Contributor
0 Kudos

Just some ideas for you to try..

1) There are soem replace web template kind of commands that might be helpful.

2) Using XPATH commands, you may be able to access to values of variables for the first web template. using these values you would need to generate a URL command for second template which has the variable values filled in. SAP help how to do this in detail.

3) I don't know complex your web templates are, but if you had both queries in the same template, then the same variables would be used for both queries. You could have all the items of template 1 in container 1 and template 2 in container 2 in the same web template. Now you could use a button to hide or display each container.

Former Member
0 Kudos

Hi Vineet Gupta,

Thank you for your response. I am not sure usage for XPATH Commands.

Both Queries are different, were built on same infoProvider. Based on 1st query results, user may call 2nd Query.

Thanks,

Madhu