Skip to Content
Technical Articles
Author's profile photo Saurabh Suresh Sonawane

Create Cascading dropdown in SAC Designer, (without hierarchy)

Hi Friend,

As we know there is no direct option to create a cascading drop down in SAP SAC Designer,

So i am writing the blog to explain the each step how to create a Cascading drop down in SAC Designer

 

Below are the step need to follow to implement the cascaded drop down in the SAC designer

 

Step 1           Add 3 drop down to the canvas

In this example we have 3 drop down for cascaded prompt

Product 1, product 2 and product 3

Given drop down name as below

      1. dropdown_prod1
      2. dropdown_prod2
      3. dropdown_prod3

 

 

 

Step 2          Need to add a chart to canvas to get the Drop down list of value at run time

In that chart also need to add the all 3 dimension in the chart as shown below

 

 

Step 3          After adding the data to the chart we need to create 3 global variable ( note                                          create an array to store all the LOV value in it at run time)

Need create 3 global variable array

3 global variable array name as below

      1. prod1_drop_dyn_array
      2. prod2_drop_dyn_array
      3. prod3_drop_dyn_array

 

 

The above array will be used to store drop down LOV which will be used in the filter further

create more 3 global variable

      1. dropdownprod1_Selectedkey
      2. dropdownprod2_Selectedkey
      3. dropdownprod3_Selectedkey

 

 

 

The above 3 global variable will be used to store the selected drop down at run time.

 

 

Step 4          on initialization we have to write a below code

 

up till now had assign the List of value (LOV) to the drop down and now see the ALL as default selected value in all 3 drop down.

Now below step is used to create a cascaded drop down in the application.

 

 

Step 5           Need to create global script object (function) for cascaded

 Below is the code will update a LOV of cascaded prompt base on the selection of drop down

 

 

Step 6              on each drop down we have to write a below code

This code will update the global variable

Below code in for prod1 on select script

 

As you can see i am calling a global script object (function) in the on select of prod1

 

Same code i had repeat for prod2 and prod3 drop down.

 

Below code is for Product 3 drop down.

 

Below code is for product 3  drop down

 

 

Note to apply filter to chart or table i had used a below 3 global variable array.

  1. prod1_drop_dyn_array
  2. prod2_drop_dyn_array
  3. prod3_drop_dyn_array

 

Thanks & Regards,

Saurabh S.

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Vidhya V
      Vidhya V

      Hi Saurabh,

      Thank for sharing.... Nice blog.

      I tried with your concept. But I'm facing issue in dropdown selected key is not maintaining in the Dropdown.

      I tried to modified the code but never works for me.

      So can you help on this.

      Regards,

      Vidhya

      Author's profile photo Saurabh Suresh Sonawane
      Saurabh Suresh Sonawane
      Blog Post Author

      Can you please share a code

      Author's profile photo Devadas Perika
      Devadas Perika

      Thank you Saurab very nice blog.

      Author's profile photo Saurabh Suresh Sonawane
      Saurabh Suresh Sonawane
      Blog Post Author

      Thanks 🙂

      Author's profile photo Sunil Paladugu
      Sunil Paladugu

      Hi Saurabh -

       

      Nice blog! Could you please let me know what exactly "prod1" in the above code. Is it the name of the script variable?

      Author's profile photo Saurabh Suresh Sonawane
      Saurabh Suresh Sonawane
      Blog Post Author

      Thank Sunil,

       

      The prod1 is my product 1 dimension I am using for filtering.

      in the above example, we have 3 product hierarchy (product 1 , product 2 and product 3)

      for easy understanding of component, I am using an prod1 , prod2 and prod3 perfix to identify the component and variable easily in the code and in the application.

       

      Thanks,

      Saurabh S.

      Author's profile photo Surya Dharma
      Surya Dharma

      Hello Suresh,

      Will you also create a post how to achieve cascading filter with hierarchy structure (also what if the hie-structure has a default filter).

      Thank you,

      Surya

      Author's profile photo Saurabh Suresh Sonawane
      Saurabh Suresh Sonawane
      Blog Post Author

      Sure, I will create a blog thanks for the topic suggestion. 🙂

       

      Thanks,

      Saurabh S.

      Author's profile photo Surya Dharma
      Surya Dharma

      Thank you for your time, effort and looking forward to your solution.

       

      Regard,
      Surya

      Author's profile photo Sampayan Gerald
      Sampayan Gerald

      I did the step-by-step procedure, but I encounter some error like after choosing item on dropdown1 and filter it on table and dropdown 2 the dropdown 2 didn't refresh and the data that supposed to be list down on dropdown2 can't be seen after choosing another item on dropdown1. How can I solve this? Sir Saurabh Suresh Sonawane