SAP Knowledge Base Article - Public

3521804 - Can't update data locking with specific selected elements using the Data Locking API

Symptom

You want to update planning data lock state with one script.

To achieve this, you set one dimension of a table with flat value filters, then change this dimension to hierarchy.

You call planning dataLocking API to set the whole planning table(one selection) to locked state.  Below is an example :

data_source.setDimensionFilter("ENTITY",entities_selected);

data_source.setHierarchy("ENTITY","H1");

planning_table.submitData();

planning_table.getDataLocking().setState(selection_hier_total, DataLockingState.Locked);

However the above code doesn’t work.

Environment

SAP Analytics Cloud 1.0

 

Cause

Prior to the release of patch 2024.15, a bug prevented immediate synchronization with the queryManager when there was a change in hierarchy within the script. Synchronization only occurred after certain API calls (like getResultSet) or when all scripts had completed. However, we have resolved this issue in patch 2024.15, released in September 2024. Now, filters are synchronized with the queryManager as soon as any filter is modified.  

  

Resolution

After the patch 2024.15, to achieve what you expect, you can do as the following:

Add a hidden InputControl with the dimension and link it to a planning table in design mode and select all members in flat mode.

In a script that needs to update data locking information,   please set filters to the InputControl instead of the table, like the following.

"   

var orignialSelected = InputControl_1.getInputControlDataSource().getActiveSelectedMembers();
InputControl_1.getInputControlDataSource().setSelectedMembers(entities_selected);

"

After data locking updating, revert the selected memebers of InputControl as the following:

"

InputControl_1.getInputControlDataSource().setSelectedMembers(orignialSelected);
"

Keywords

KBA , LOD-ANA-UNS , SAC Unified Story (Story 2.0) main component. , LOD-ANA-PL-DLK , Data Locking , Problem

Product

SAP Analytics Cloud 1.0