There are already some good blogs explaining how to Create, Update and Delete dimension members in SAP Analytics Cloud Planning models, however, it is not clear that multiple dimension member entries can be created in a single call of the api updateMembers() or the api CreateMembers().
On this blog I will focus on the api updateMembers() because this api works like an upsert:
*In my opinion there is an advantage to this api over the CreateMembers because it will not give a server error in this case.
In some business scenarios there is the need for business users to create master data entries in mass in the budgeting process Ex:
For these scenarios it is recommended to reduce the calls of the api updateMembers() by generating an array with multiple dimension members, instead of calling the function multiple times with a single member.
Note: To generate associated transitional data a data action needs to be called, to avoid multiple data action calls, an array of multiple dimension members can be passed to the data action. Also, different transactional data values might be passed to dimension members by creating an attribute in the dimension with the value to be passed, this value can then be read in the data action and only a single data action call will be necessary.
Before:
After:
Code:
var create_multiple = ArrayUtils.create(Type.PlanningModelMember);
create_multiple = [{
"id": "500349",
"description": "VP Information Technology",
"properties": {
"Cost_Center": "CC1",
"Employee":"Employee1",
"Status":"Active"
} },
{
"id": "3000003",
"description": "Project Coordinator",
"properties": {
"Cost_Center": "CC2",
"Employee":"Employee2",
"Status":"Active"
} },{
"id": "3000004",
"description": "Production Oversight Manager",
"properties": {
"Cost_Center": "CC3",
"Employee":"Employee3",
"Status":"Active"
} },
{
"id": "#",
"description": "update demo",
"properties": {
"Cost_Center": "Unassigned",
"Employee":"Unassigned",
"Status":"NA"
} }
];
var update = Model_Demo.updateMembers("Position_Update",create_multiple);
if(update) {
Application.showMessage(ApplicationMessageType.Success,"Positions Created Successfully");
Table_1.getDataSource().refreshData();
}
This blog tries to bring more clarity to master data creation in Sap Analytics Cloud. The logic / script can be adjusted to accommodate more complex business rules.
Looking forward to read your comments / feedbacks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 47 | |
| 38 | |
| 37 | |
| 30 | |
| 30 | |
| 28 | |
| 27 | |
| 26 | |
| 24 | |
| 23 |