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
- dropdown_prod1
- dropdown_prod2
- 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
- prod1_drop_dyn_array
- prod2_drop_dyn_array
- 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
- dropdownprod1_Selectedkey
- dropdownprod2_Selectedkey
- 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.
- prod1_drop_dyn_array
- prod2_drop_dyn_array
- prod3_drop_dyn_array
Thanks & Regards,
Saurabh S.