cancel
Showing results for 
Search instead for 
Did you mean: 

SAC Data Action : send date value parameter

0 Kudos
2,201

Hi Experts

Could anyone help me with the below code please.

simple code but not working. I need to pass dynamic values to my data action for that I am first trying it out with constants then I will replace with script variables in Javascript.

DA_1.setParameterValue("CC_P", "GB1"); => company code dimension

DA_1.setParameterValue("MY_P", "202304"); => DATE dimension format "YYYYMM"

DA_1.execute();

The code above does not produce any errors, but it also does not perform the desired action of storing a value in the planning model. I would greatly appreciate any help or insights you can provide.

Thank you in advance.

Best regards,

M

View Entire Topic
N1kh1l
Active Contributor

malya_7

You need to use fully qualified member names when assigning the parameter for e.g. [SAP_CEP_PRODUCT].[H1].[MZ-FG-C900] See an example below.

Parameter setup: Hierarchy defined in parameter should be used in JavaScript assignment

Data Action: Keep most if the member scoped in MEMBERSET

MEMBERSET [d/MEASURE] = "QUANTITY"
MEMBERSET [d/SAP_CEP_PRODUCT]=BASEMEMBER([d/SAP_CEP_PRODUCT] , %P_Product%)
MEMBERSET [d/SAP_CEP_SALESORG]=BASEMEMBER([d/SAP_CEP_SALESORG] , %P_SalesOrg%)

MEMBERSET [d/SAP_CEP_CUSTOMER]="#"
MEMBERSET [d/SAP_CEP_ENTITY]="#"

DATA([d/CALMONTH]=%P_Date%)=1
Application.showBusyIndicator("Preparing for execution..."); 
// format is [DIMNAME].[HIERID].[MEMBER], the hierarchy id should be same as defined in param
DataAction_1.setParameterValue("P_Product","[SAP_CEP_PRODUCT].[H1].&["+"MZ-FG-C900"+"]");
DataAction_1.setParameterValue("P_SalesOrg","[SAP_CEP_SALESORG].[H1].&["+"SO0001"+"]");
DataAction_1.setParameterValue("P_Date","[CALMONTH].[YQM].&[" + "202301" +"]");
DataAction_1.execute();

Application.refreshData();
Application.hideBusyIndicator();
Application.showMessage(ApplicationMessageType.Success,"Executed Successfully");

Before DA run

After DA run

DA Monitor logs

Hope this helps !!

Please accept/upvote if this helps you

Nikhil

0 Kudos

Hi Nikhil,

Thanks for your reply again.

My date dimension is passing correctly now, but not the company code.

For my Company code dimension hierarchy is not enabled. so I am passing directly the value

DataAction_1.setParameterValue("CC_P","[Comp_code].&[" + "IE01" + "]");

DataAction_1.setParameterValue("P_Date","[Date].[YQM].&[" + "202302" + "]");

DataAction_1.execute();

N1kh1l
Active Contributor
0 Kudos

malya_7

Just try passing the member name without any qualifier if there is no hierarchy. All my dimensions had hierarchies so i did not face this issue

DataAction_1.setParameterValue("CC_P", "IE02")

Nikhil