SAP Knowledge Base Article - Public

3520461 - SAC - setUserInput() issue when trying to delete the value

Symptom

When using setUserInput() to capture values from an input field in a popup and store them in a table, writing a new value into the cell functions correctly.

However, if a member in any dimension is changed, the previous value should be deleted, but this behavior is not occurring as expected.

Environment

SAP ANALYTICS CLOUD

Reproducing the Issue

  1. Create a story that contains a table and button
  2. Add the following script to the button:

//delete source value:
//Table_1.getPlanning().setUserInput(Selection,""); //error: Empty data entry is not allowed
//Table_1.getPlanning().setUserInput(Selection,"*0"); // gives also 0
Table_1.getPlanning().setUserInput(Selection,valueTargetBeforeUpdate);

Notice that the old value cannot be deleted.

Cause

This is the expected behavior of the setUserInput() API

Resolution

The setUserInput API cannot be used to clear cell data, as it only accepts strings representing numbers or scalars in the form *[multiplying factor]. It does not accept empty strings, and attempting to do so will display an error message indicating that the value is invalid.

The only workaround is to use a data action to delete the cell data.

See Also

Keywords

SAP Cloud for Planning, sc4p, c4p, cforp, cloudforplanning, Cloud for Analytics, Cloud4Analytics, CloudforAnalytics, Cloud 4 Planning, API, setUserInput () API, data action, data cell
 
, KBA , LOD-ANA-AD-FRA , Analytics Designer Framework , Problem

Product

SAP Analytics Cloud 1.0