cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate customer_exit variable in a query

Former Member
0 Kudos

HI,

I'm having 2 queries in a Web template.

Query Q1 has user input variable (v1) while Query Q2 has customer exit variable (v2).

In the customer_exit, my logic is to populate v2 using v1.

The above arrangement will work provided the query execution order is Q1 followed by Q2.

However when i run the report, Q2 executes first and then Q1.

How do i ensure the query execution order is Q1, Q2 and not Q2, Q1.

Regards,

Nagendra.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nagendra,

I checked the workbook setting, but can't find the control of query sequence.

But i think the solution might as simple as the order of you queries being saved. Try to save Q2 first then Q1, it could the time stamp determines the order of refresh.

cheers.

Former Member
0 Kudos

Hi,

I was out so could'nt reply back immediately.

As the query is being used in the WAD so i think the workbook settings would not be effective. However, i tried saving the queries as Q1 then Q2 and Q2 then Q1 but none of the options worked.

Is there a lag time between sacing the query and system actually registering the time. coz i execute the report withing minutes of saving the query.

Regards,

Nagendra.

Former Member
0 Kudos

HI,

assign firsdt query to dataprovider 1 & second query to dataprovider 2 in the WAD. Then in the table 1 assign dataprovider 1 and table 2 assign dataprovider 2.

Check if this works

Regds,

Shashank

Former Member
0 Kudos

Shashank,

I did exactly the same.

Q1 with Table1 with Datasource1

Q2 with Table2 with Datasource2

Still it is the Q2 getting executed first and not Q1.

Then i added Q3 with Table3 & Datasource3 (again with customer_exit variable). With this, the first query is now Q3 and not Q2.

So the problem is still as it is.

Regards,

Nagendra.

Former Member
0 Kudos

Hello, Anybody out there.

How do i prioritize the query execution in a webtemplate having multiple queries.

Regards,

Nagendra.

Former Member
0 Kudos

Hi Nagendera,

Why dont you change the order than ???

In web template add q2 first then q1 ?? have u tried out that way ?

Former Member
0 Kudos

Could you please confirm what is the order of execution of various steps in customer exit.

My understanding is :

step-1 for all queries then

step-2 for all queries then

step-3 for all queries.

Regards,

Nagendra.

Former Member
0 Kudos

Nagendera,

What i understood from your problem is that you have to execute a web template which have 2 web templates with 2 different analysis web item's based on 2 different data providers.

based on the variable of Q1 you have to populate another customer exit variable of query Q2.

The customer exit variable will not come in selection-screen untill unless that is marked for "ready for input".

where have u written the code in step_2 ?? code written in step_2 will executed after input.

Have you executed your web template and checked the output ? I guess that you should not face this kind of problem.

Thanks

Dipika

Former Member
0 Kudos

Hi Dipika,

Let me put the scenario once again.

I have a single web template with two table_items having two different queries (Q1, Q2) attached respectively to each table item.

Query Q1 is having user input variable and query Q2 is having customer_exit variable.

In customer_exit function, at step_2, I'm reading the value of Q1 variable (which will be populated from selection screen) and populating the Q2 variable.

My understanding is that step_2 will be executed first (for Q1, Q2), and then step_3 will be executed (for Q1, Q2).

However i noticed that step_2 & step_3 are being executed for Q1 and then step_2 (and step_3) for Q2. and when step_2 of Q2 is being executed, the internal table : i_t_var_range does not have values of Q1 variables.

Please let me know if my understanding of step_2, step_3 flow is incorrect.

Regards,

Nagendra.

Former Member
0 Kudos

Hi Narendera,

step_2 is a PAI event that is process after Input,

when your query Q1 does not have any customer exit variable then it will not go in the step_2 code, your Q2 queyr is containing the code for customer exit varibale so it will run for that but of-course after the input.

In any case it cannot run before that. I suggest you to put the break-point in your code and then run the query may be that can help you out.

I_STEP = 1: Call takes place directly before variable entry

I_STEP = 2: Call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1.

·I_STEP = 3: In this call, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.

Thanks

Dipika

Former Member
0 Kudos

Thanks Dipika,

Finally, what i understand is : step_2 & step_3 will be executed for each query independently.

As a solution, in the step_3 for Q1, i'm capturing the values into global variables and reading these values in step_2 for Q2 variable.

Regards,

Nagendra.

Answers (0)