Technical Articles
Pass Input Control / FilterLine Value to Data Action Parameter in Analytical Application
The SAC story allows input control values to be passed to Data Action Parameters, but this is impossible with the Analytical Application. But there is a perfect way to accomplish this.
There is no function available to pass Input Control or FilterLine values, but there is one perfectly good reason to do this.
- Create Data Actions from sidebar (not from insert tab) on Analytical Application, Add your data action name.
- Create new Button, and add this mention code below in onClick()
- Replace your Dimension and Data Action Parameter Id, use this code.
Application.showBusyIndicator("Preparing for execution...");
var filter = Table_1.getDataSource().getDimensionFilters("your_table_dimension");
for (var i = 0; i < filter.length; i++) {
if (filter[i].type === FilterValueType.Single) {
var singleFilterValueCC = cast(Type.SingleFilterValue, filter[i]);
DataAction_1.setParameterValue("data_action_parameter_id", [singleFilterValueCC.value]);
} else if (filter[i].type === FilterValueType.Multiple) {
var multiFilterValueCC = cast(Type.MultipleFilterValue, filter[i]);
DataAction_1.setParameterValue("data_action_parameter_id", multiFilterValueCC.values);
}
}
DataAction_1.execute();
Application.refreshData();
Application.hideBusyIndicator();
Application.showMessage(ApplicationMessageType.Success,"Executed Successfully");
Passing to Input Control
Read this blog to pass your input control values to data action, Read Article
Conclusion
Data Action is very useful tool in Sap Analytical Cloud for large calculation, Some of feature In Analytical Cloud its little difficult in Back-end side. So using this way we can use Data Action to pass filters value to Data Action Parameter.
Rohit Chouhan
Thank you for this great article.
I am trying to use the following code for the filter, I use input control instead of table
But using this I see the following error
Can you suggest me the correct way to use this? Thank You
Use Table, not InputControl
Example:-