Skip to Content

How to switch BEx query conditions in Design Studio?

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 30, 2015 at 07:32 PM

    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


    Conf1.png (6.6 kB)
    output1.png (10.5 kB)
    script.png (20.2 kB)
    output2.png (19.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jun 30, 2015 at 01:34 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 30, 2015 at 01:37 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.