InsightCubes

Overview of the getPlanning() API and related functions with SAP Analytics Designer

How to use the getPlanning() API and its methods and functions with SAP Analytics Designer

The getPlanning() API returns the Planning object of the table, if the table is linked to a model (data source) that does not support planning, then undefined is returned.

This blog is an overview of all the functions used with the getPlanning() API with some use cases. There are 9 functions used with the getPlanning(), and they are as follows:

1. getDataLocking()– The data-locking object of the table is returned. Used to check if a model is data-locking enabled. It is a necessary check for certain operations that can’t be performed on a table such as setState() and getState(), if the model isn’t data locking enabled. If the table is linked to a model (data source) that doesn’t support data locking, undefined is returned. There are no mandatory no optional parameters.

2. getPrivateVersion()– The private version associated with the data source is returned. This data isn’t visible to other users and other solutions of SAP Analytics Cloud. If the used version ID has no private version, undefined is returned. versionID is a mandatory parameter.

3. getPrivateVersions()– All private versions associated with the data source are returned. This data isn’t visible to other users and other solutions of SAP Analytics Cloud. Since it is returning all the private versions of the data source, there are no mandatory no optional parameters.

Example:

getPrivateVersions()

4. getPublicVersion()– The public version associated with the data source is returned. This data is visible to all users and all solutions of SAP Analytics Cloud. If the used version ID has no private version, undefined is returned. versionID is a mandatory parameter.

Example:

getPublicVersions()

5. getPublicVersions()– All public versions associated with the data source are returned. This data is visible to all users and all solutions of SAP Analytics Cloud. Since it is returning all the public version of the data source, there are no mandatory no optional parameters.

6. isEnabled()– Returns whether planning is enabled for the table. Valuable script allows checking whether the data model is planning-enabled.

Example:

7.setEnabled()– Enables or disables planning for the table depending on whether you need planning or not.

Example:

setEnabled()

8. setUserInput()– The user can set values to cells of a planning-enabled table using an analytics designer script. After setting one or more specific cell values the user can refresh the Table by submitting the values. If the passed value is prefixed with an asterisk (*), then the value is applied as a factor to the present cell value. selectedData (selection: A selection consists of property-value pairs specifying one row, column, or data cell) and value are mandatory parameters.

Example:

setUserInput()

9. submitData()– Data is submitted to the server. After setting one or more specific cell values the user can refresh the Table by submitting the values. True is returned if the operation was successful, and false if it wasn’t. There are no mandatory no optional parameters.

Example:

submitData

There you have it – now you know how to use the getPlanning() API and its methods and functions with SAP Analytics Designer.

Exit mobile version