on 2023 Jul 15 7:09 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
malya_7
You should also provide a snapshot of your DA_1 formula code. The API to set parameter to Data Action looks fine.
"but it also does not perform the desired action of storing a value in the planning model." - That depends on what your Data Action code /step is . The java script API will only set the parameters for company code and time dimension and run the data action those seems to be ok.
You can check the Data Action monitor to see if the Data Action was triggered and what did it do exactly
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil
I replaced comp_code with another dimension it worked but not working for organization dimension. is there any reason?
my organization dimension comp_code does not have hierarchy, but enabled person responsible.
Thanks
M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil
Thanks for your quick reply.
my DA code: this will write a new record with the parameter combination assigns Rowcount=1 and also it will make sure always the company code has only one record.
VARIABLEMEMBER #period OF [d/Date]
VARIABLEMEMBER #compcode OF [d/Comp_code]
DELETE([d/Comp_code] = %CC_P%)
DATA([d/Measures] = "RowCount", [d/Comp_code] = %CC_P%, [d/Date] = %MY_P%) = 1
when I execute the above java code: the DataAction monitor gives this error:
It is not able to assign the parameters. if I execute Data action directly, it executes perfectly. but not through the Javascirpt.
Thanks
M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
30 | |
8 | |
8 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.