cancel
Showing results for 
Search instead for 
Did you mean: 

How to switch BEx query conditions in Design Studio?

0 Kudos

Hi Experts,

I used a BEx query as data source in Design Studio. In this BEx query 2 conditions are defined (e.g. "Top 10" and "Less Than 5000"). Is the following requirement possible in Design Studio?

- The application first runs with the first condition (e.g. "Top 10") used for data source.

-  Then the user can switch the data source to the second condition (e.g. "Less Than 5000")

Besides I have checked the link below. In this blog it is possible to define the dynamic conditions, but the conditions should be the same type (e.g. Top N, etc.). In my requirement I defined 2 different types of conditions. Therefore this blog doesn't fit for my problem.

http://www.hackingsap.com/blog/sap-design-studio-and-conditions

Many thanks in advance and best regards,

Zhijian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Zhijian

It is poosible ! In Design Studio We have an API setmeasureFilterActive .

Here are the steps

I have a Query with 2 conditions

1. Top 5

2. less than  500000

First Condition is made Active and Second Condition is made In Active By not checking the checkbox.

Now in Design Studio I have a Crosstab mapped to this Data Source . Since Top 5 condition is active I get 5 customers initially

Now in Less than 50k Button  give the following script

Now when Less than 50k button is clicked the output would be

I hope these steps would solve your problem too!

Thanks

karthik

0 Kudos

Hi Karthik,

your solution works perfect!! It is exactly the one, what I'm looking for. Many thanks!

Best regards,

Zhijian

Answers (2)

Answers (2)

MustafaBensan
Active Contributor
0 Kudos

Hi Zhijian,

I am not aware of any way to activate BEx Query conditions from Design Studio.  A workaround would be to duplicate the BEx Query with each condition active separately and then apply the DataSource.assignDataSource(dataSourceConnection, dataSourceType, dataSourceName) method to switch the underlying query, thereby effectively switching the condition.

Regards,

Mustafa.

0 Kudos

Hi Mustafa,

what you suggested is really a workaround. Right now many queries are already used in one application. If there is possibility to swith the condition within one query, we prefer to use only one query. But if it is impossible, then we have to go to your way .

Best regards,

Zhijian

MustafaBensan
Active Contributor
0 Kudos

Hi Zhijian,

Yes, my suggestion is indeed a workaround in the absence of a more elegant approach .  Please post back if you manage to find a way to achieve condition activation with only one query.  I'm sure others would be interested in this too.

Regards,

Mustafa.

former_member194504
Active Contributor
0 Kudos

Hi zhijian,


I think it would be possible. Did you tried creating two condition with variable option and tried to trigger from design studio? for example loading the first condition on selection of dropdown so that first condition trigger then by clicking on button loading the second condition. Something like this, to fix in your requirement.

Thanks,
Nithyanandam

MustafaBensan
Active Contributor
0 Kudos

Hi Nithyanandam,

It's possible to influence condition values via a BEx Variable, as per the blog Zhijian has mentioned but I didn't think there was a way to activate different conditions via a BEx Variable.

Regards,

Mustafa.

0 Kudos

Hi Nithyanandam,

actually I also thought in this way. But as Mustafa mentioned, I haven't found any function to activate different conditions.

Regards,

Zhijian

former_member194504
Active Contributor
0 Kudos

Hi mustafa,

Thanks for the clarification.Now got it, more clearly!


Thanks,
nithyanandam