Blogs / SAP / SAP Analytics Cloud / Application Design / SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members

Oct 20, 2020

SHARE

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 the 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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members

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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
Product id dropdown script

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

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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 pop–up 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 pop–up.

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
Delete members button script

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

SAP Analytics Cloud – Application Design Series 27 –Adding, updating, deleting members
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.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!