In the previous blog in this series, you learned about the cascading filters feature in Analytics Designer. In this blog, we will discuss how to develop a customized application for adding, updating, and deleting dimension members.

SAP Analytics Cloud offers a predominant feature called members on the fly to add dimension members without going to the model level. To add more customization, planning model APIs are introduced from 2020.09 version. The analytic application developed using these APIs gives the business users more flexibility and allows them to delete/update dimension members in addition to adding members on the fly and dimension members get updated in the master data of the dimension in the model level automatically.

Let us assume you are going to introduce some new products to a few stores in your company. The new product need not be present in the master data of the source system for you to analyze the procured quantities, cost amount, etc. Using the following customized application, you can add,
update, or delete the product members and its properties on the fly, and this can be seen in action below.


Prerequisite – Planning model object

To access planning model APIs, you need to create a new planning model object in the ‘Planning Models’ section. Now select and map the model and use it further.


Planning Model object


Planning model APIs

The APIs used to maintain dimension members are,

  • createMembers()To create dimension members on the fly.
  • updateMembers()You can update the dimension members properties and their description using this.
  • deleteMembers()To delete dimension members.

Note: Only unbooked members can be deleted.

The step by step process in building this planning application is discussed below.


1.Setting up canvas and widgets

As a first step, you need to add the necessary widgets to the canvas. Here the application has one table, a filter line, and three buttons representing the functionalities to maintain dimension members. The table has the ‘product’ dimension and its ‘colors’ property and ‘quantity’ procured. Also, create a script variable ‘Dimensionmember’ of type ‘PlanningModelMember’ to which the values of the properties of the dimension members are assigned and used as input parameters for createMembers API.


Canvas with widgets


2.Adding pop-up and widgets

Add pop-ups and widgets required for maintaining master data. The pop-ups contain similar widgets like input fields, text areas, buttons, dropdowns, checkboxes, etc. for add, update, and delete members functionalities as shown below.


Add, update, delete members pop-ups


3. Adding dimension members

In the onClick event of ‘Adding members’ button, add the below script to open the pop-up and reset the input fields to blank.


Adding members button script

Now add the below scripts to Popup_addmember –onButtonClick event. In the script, the ‘Dimensionmember’ variable has been initialized with input values to create product dimension members and then the data source has been refreshed. Now check for added dimension members. To add more clarity, show customized messages for success/failure of adding dimension members. If cancel is clicked, the pop-up will close immediately.


Add members pop-up onButtonClick script


4.Update dimension members

In the onClick event of the ‘Update members’ button, write the below script to open the pop-up, resetting the input fields to blank, and populate the dropdown with product info.


Update members button script


In the onSelect event of Product ID dropdown, you need to fetch the respective member existing info and furnish that in input fields.


Product id dropdown script


Now add the below scripts to Popup_updatemember –onButtonClick event to update the ‘product’ dimension members and show custom messages.


Update members pop-up onButtonClick script


5.Deleting dimension members

In the onClick event of the Delete members’ button, write the below script to open the popup and populate the checkbox with product info. You can delete multiple dimension members at the same time simultaneously by selecting the members to be deleted from the checkbox and clicking the delete button in the popup.


Delete members button script


Add the below scripts to Popup_deletemember –onButtonClick event to delete the dimension members and show custom messages. 


Delete members pop-up onButtonClick script


Now your application is ready for maintaining the product dimension master data on the fly without any hassle. 

Click here to talk to our experts about SAP Analytics Cloud. To know more about the Analytic Applications of SAP Analytics Cloud, please check out our blog series here.

Subscribe to our Newsletter

5920 Windhaven Pkwy
Plano TX 75093.

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192