cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Query Req

Former Member
0 Likes
469

We have 2 queries. In the first query I have variables on A, B and C. In the 2nd query I have variables on E and F. Now I need to embedd both these queries in to Workbook.

Requirement is when I give a value to variable on A, this variable value should be my Input variable value (using user exit) for my variable on E & F which is 2nd query. Replacement path can not be a solution, coz i need to perform some coding based on variable value A and then use the result as values for E & F.

Can this be possible! I mean using a variable value as input variable value for a diff variable on a diff query!

View Entire Topic
Former Member
0 Likes

Hi Madhu,

While creating second query, you can use variable A as your input variable and in customer exit (I_STEP = 2) you can read value for A to get variable E & F. At the same time you can use variabe A along with B & C in first query. When using the variables in workbook you can select option display repeated variable once. When workbook will be executed user will get A, B & C variable as input.

Regards,

Kams

Former Member
0 Likes

Variables A is on 1st query and E & F are on 2nd query. How do we pass the query name in the user exit for E & F! Coz Variable is used in many other queries. How does the user exit know that its should get the variable A value only from the 1st query!

Former Member
0 Likes

Hi Madhu,

Can you use variable A in query 2 as well, do you have the characterstic available in query 2 or can you add characteristic in query 2 on which you created variable A?

Regards,

Kams

Former Member
0 Likes

No, I cant add the Variable A infoobject in my 2nd query infoprvider. Thats the issue./

Former Member
0 Likes

any solutions plz!

Former Member
0 Likes

Hi,

I think you should be able to get this using Jump queries. Try using RSBBS. Not sure if it suits your requirement. But you can pass the values as input selection to next query.

Hope this helps.

Regards,

Akhan

Former Member
0 Likes

Jump Query functionalities can be used only after we run the Source query rite! My reuirement is to see the data of 2 queries at 1 shot/execution.

Former Member
0 Likes

Hi,

Yes you are rt. You can make the selection variable common to queries in workbook but i dont think you will be able to fetch one variables input in one query and pass it to user exit variable of another query.

Former Member
0 Likes

Hi,

We can code in CMOD by checking teh report name only as below:

CASE I_S_RKB1D-COMPID.

WHEN 'QUERY1' OR 'QUERY2' OR 'Query 3'.

CASE I_VNAM.

WHEN ' A or B or E or F'.

IF I_STEP = 2. "This is to process the variables

Please use the idea to implement your functionality , the ideas are already been discussed.

Hope that helps you.

Thanks

Mukesh

Former Member
0 Likes

Mukesh,

How can I use I_S_RKB1D-COMPI in my case? Coz' my Exit variable E is in Query2 and my input variable A is in Query1! Plz let me know

whether the following is correct.

CASE I_S_RKB1D-COMPID.

WHEN 'QUERY1'.

CASE I_VNAM.

WHEN 'E'.

.......

....

Above cant be rite,. coz I need to call the user exit when Query is executed, not Query 1. If i take WHEN 'QUERY2', it cant be rite coz

I need to get the variable A value from Query1.

Please suggest.

Former Member
0 Likes

Hi Madhu,

I meean to say we can try like this:

CASE I_S_RKB1D-COMPID.

WHEN 'QUERY2'.

CASE I_VNAM.

WHEN 'E'. " Your Query 2 variable

data: yy(4).

IF i_step = 2.

LOOP AT i_t_var_range INTO loc_var_range

WHERE iobjnm = 'A' " Your Query 1 variable.

CLEAR l_s_range.

l_s_range-low = loc_var_range-low.

l_s_range-high = loc_var_range-high.

l_s_range-sign = 'I'.

l_s_range-opt = 'EQ'.

APPEND l_s_range TO e_t_range.

endloop.

ENDIF.

Please try if that works

Former Member
0 Likes

But how can we get the Query1-Variable A value here using your code as you have taken Query2 execution as reference in case stsmt not Query1!

Former Member
0 Likes

Hi Madhu,

WHat i saw up is u r query 2 executes after query 1 .

The Query 1 variable values cab read once it was run in th user exit.

It doesn't depend on the query 2 execution , so u r good when u execute the Query 2 and your query 1 variable have values in that.

thnaks

Mukesh

Former Member
0 Likes

Varaible A might have been used in different queries other than Query1. So in your code, where are you contrlloling that variable E whould get the variable A value from Query1! I see only Query2.

Your code means, when the Query execution is 2, and when V_NAM = E, then E = A.?? How does this code know that A should get value from Query 1!

Former Member
0 Likes

Hi Madhu,

You can CASE with in CASE for checking QUery 1 when u heck the variable E.

CAse WHEN Q1

CAse when Variable 1

if

Case Q2

ENDCASE

ENDIF

ENDCASE 2

ENDCASE1

Thanks

Mukesh