Configuring an Entitlement Process

Objective

After completing this lesson, you will be able to configure an entitlement process.

Configuring an Entitlement Process without a Script

Let’s go into SAP Entitlement Management to create an entitlement process without the need for a script.

Watch the following video to configure an entitlement process without a script.

We’ve configured an entitlement process that does not require a script. Let’s move onto a scenario where an entitlement process mode uses a script.

Configuring an Entitlement Process with a Script

Watch the next video to create an entitlement process where the process mode uses a script.

Entitlement Process Script Code Editor

SAP interface showing the Configure Entitlement Master Data page with an editor window for the Copy Entitlement Process. The left sidebar displays various entitlement-related options. A script is visible in the editor.

The script code contains a function named <process> with Input Parameter context. This context contains a value of parameters and a query task result. Details on the Input Parameter are below.

The script code returns a structure that matches the Returned Model structure. You can write JavaScript code to construct a value of the Returned Model. For creating or updating entitlements, see the details for Returned Model below. Refer to the Restrictions section for technical restrictions applied to the script to secure the safety of the generation process.

Input Parameter: The following details are the structure of the input parameter context:

"parameter":{},

         

"entitlement": {},

         

"rootEntitlement":{},

         

"parentEntitlement":{},

         

"directChildren":[]

         

The node "parameter" represents the corresponding value of parameters carried in with the Entitlement Process API.

  1. The node "entitlement" represents a value of a single entitlement from a query result.
  2. If "entitlement" belongs to an entitlement association tree and you choose to include the associated Entitlement "Root", node "rootEntitlement" represents the root entitlement of this association tree.
  3. If "entitlement" is a child entitlement of another entitlement and you choose to include associated entitlement "Parent", node "parentEntitlement" represents the parent entitlement of "entitlement".
  4. If "entitlement" is a parent entitlement of other entitlements and you choose to include Associated Entitlement "Direct Children", node "directChildren" represents children entitlements directly linked to "entitlement".
  5. To retrieve the data, use the following:

             

    function process(context) {

    var parameter = context.parameter;

    }

  6. For each node in context, select Show Reference to refer to its structure.

Return Model

The script task has a specific "Returned Model" to indicate operations and corresponding values set by this script.

The returned model follows this structure:

"toCreate": [],

         

"toUpdate": []

         

Entitlements to Update represent an array of entitlements to be updated. For the structure of toUpdate, refer to Inbound_Interface_Entitlement_Update_v2 API.

Entitlements to Create represent an array of entitlements to be created. For the structure of toCreate, refer to Inbound_Interface_Entitlement_Creation API.

Restrictions

A note about restrictions: For security reasons, scripts have restrictions. These restrictions include the following:

The script supports the JavaScript ES5 standard.

  1. The setTimeout/setInterval/clearTimeout/clearInterval functions are not available for Script Task.
  2. The XHR/fetch APIs are not available for Script Task.
  3. The available global JavaScript objects list:
    • Object
    • Array
    • Date
    • Number
    • Error
    • String
    • Boolean
    • Math
    • JSON
  4. If the script code executes time is more than three seconds, the system rejects it as a bad snippet. The entire transaction is terminated with an error message.
  5. If script mode is used, one package can update/create with a threshold of 5000 entitlements.

Refer to the EMS Help portal for more information on scripts within EMS. The Help portal allows you to select a sample script to assist in maintaining scripts within EMS.

After configuring your script, select the Create button to save your work. This takes us to the Upgrade Entitlement Version Script page. At this stage in the entitlement process configuration, you can edit, delete, or copy an entitlement. Let’s copy an entitlement.

Copying an Entitlement Process

Copying an Entitlement Process

You can copy the configuration from an existing Entitlement Process and make changes.

UI example of the Upgrade Entitlement Version Script page displaying the process that can be copied along with the Copy button on the tool bar.

On the Entitlement Process List screen, select an existing entitlement process and select the Copy button in the footer.

When you copy an entitlement process, check the data in the General Information section.

The data from the source entitlement process is copied into the new entitlement process. Make the necessary changes and save the new entitlement process.

Delete an Entitlement Process

If an entitlement process is not in use, you can delete an existing entitlement process.

UI example showing the SAP Entitlement Management System with a list of entitlement processes, their statuses, process modes, and last changed dates. Left sidebar displays various configuration options.

Select an entitlement on the Entitlement Process List screen. Select the Delete button on the footer.

Note

If a process log exists in the system, the entitlement process cannot be deleted.

We’ve had a chance to create an entitlement process. In the next lesson, we take the process further by monitoring and entitlement process execution.

Log in to track your progress & complete quizzes