In this sample we will use the Query XQL action in Nintex Workflow to retrieve SAP user details. We will execute the SAP function module BAPI_USER_GET_DETAIL shown below and process several SAP result tables as XQL variables in the workflow.
The parameter USERNAME must be set to run the function module. We would like to process the result tables PARAMETER, PROFILES and RETURN in our workflow.
We will use the following XQL-statement.
At first let us run it in the XtractQL Explorer and check the result.
Now we will create a custom SharePoint list as shown below.
We will create a Nintex workflow and use the following actions.
Let us define the following workflow variables to save the SAP result.
In the Query XQL Action let us set the field Application Name to an existing ECS Application Name.
In the field XQL Query we insert our XQL Statement. We use the Insert Reference button to set the value of the USERNAME parameter.
To assign an XQL output Variable (e.g. @SAPProfiles) to a workflow variable (e.g. VarProfiles), set the variable field to @SAPProfiles and click on Add. In the list select the workflow variable VarProfiles.
Configure the Update Item action to update the list fields using the workflow variables.
Now let’s create a new item in our list and set the field SAP User name.
When the workflow runs, the list fields will be updated with the SAP data.
SAP Errors will be processed in this case too and will be saved to the field SAP result. Check the result below for an invalid SAP user.