---
description: 'Last Updated: 25.10.2019'
---

# Create skill for SAP

With Hala, you can add a natural language interface to your SAP system, and in this tutorial, we will create a skill to unblock the user in SAP.

{% embed url="https://youtu.be/YFRuQeycnrQ" %}

**Step 1.** At first, we need to create a Web Service on the SAP side for unblocking the user.

We will use standard SAP functional modules (BAPI) to create the Web Service.

Go to SAP and run the transaction `SE37`.&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTFQ9JmiGq9tfj5_y4%2FScreen%20Shot%202019-10-18%20at%2012.44.21%20PM.png?alt=media\&token=16896aff-8a94-4e1c-a578-7e44b5b9bfdd)

Search for needed functional module and press `Display`.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTFd6JBUEJeF35HlrW%2FScreen%20Shot%202019-10-18%20at%2012.45.41%20PM.png?alt=media\&token=bddfdde3-ffbb-4d42-89e4-d597876ab706)

Go to Utilities - More Utilities - Create Web Service - From the functional Module.&#x20;

Provide the service definition and description.&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTG0tfUbfW-K-cPi1q%2FScreen%20Shot%202019-10-18%20at%2012.46.56%20PM.png?alt=media\&token=09ad0b86-b786-45c3-8dec-fad53d4e203a)

Press `Cont.`&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTGz0Kp-MKkPh6bJbb%2Fdoc-120.png?alt=media\&token=24837b89-36c3-491b-934d-3a2865914d80)

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTG0tfUbfW-K-cPi1q%2FScreen%20Shot%202019-10-18%20at%2012.46.56%20PM.png?alt=media\&token=09ad0b86-b786-45c3-8dec-fad53d4e203a)

Press `Cont.` and select `Authentication with User and Password, No transport Guarantee`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTH3SG8wJ-YAe81YOx%2Fdoc-121.png?alt=media\&token=87166a20-ac6e-44ec-9cdc-ecaabecb74ea)

Press `Cont.` and select `Local Object`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTHSu_A1RnaizEwBQJ%2Fdoc-122.png?alt=media\&token=6ee10ae0-3df4-4043-8df7-ff8fb9f9148a)

Press `Cont.` and `Complete`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTHaeFYtnqsVcRUJ_O%2Fdoc-123.png?alt=media\&token=9774afeb-79a0-44fa-9b77-2f022fe2a8c5)

Now you need activate your web service by pressing the icon `Activate`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTHlTLnr_6B6hx6O4K%2Fdoc-124.png?alt=media\&token=fefca09d-8a0f-45ba-bff0-291a7d2b2c44)

After the activation you will see next message:

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTI0pccHtsXGDoztt8%2Fdoc-125.png?alt=media\&token=be55a790-d84a-4bc9-af1f-74fca4b41668)

**Step 2.** Now you need to make the created Web Service reachable for external applications

Go to the SAP transaction `SOAMANAGER`

Then open the `Web Service Configuration`&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTKBNlCE1bJi_TtQWT%2Fdoc-126.png?alt=media\&token=3c0767e7-4477-413c-9dad-8bf9ad9fbe5c)

Search for created service, you can use the `Object Name` parameter to find the service. Specify in the search field the value `zhala*` and press `Search.`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTKLu-IXfUrfIALNL3%2Fdoc-127.png?alt=media\&token=354d5172-6940-4315-9998-60294f8c5b3d)

In search results click on your service and then press `Create Service` in the next window.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTKo1vsQelvukT4a9-%2Fdoc-128.png?alt=media\&token=09ed3c6a-5b08-4363-9eb1-5aebcb69cb75)

Provide the `Service Name`, `Description Text` and `New Binding Name`. Press Next.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTLAeaODh34b9y7jUV%2Fdoc-129.png?alt=media\&token=460153c7-36df-40fa-9902-16d7e03b1592)

In the next window, enable the option User ID/Password in the Transport Channel Authentication section. Press Next.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTLPNNJtbT9lYg2pp5%2Fdoc-130.png?alt=media\&token=009e01af-8486-4d79-b976-e669e66d84ac)

In the next screen press button `Finish`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTBOveGIYTQYlEnOEj%2F-LrTLjlNh1kXgU4181Vd%2Fdoc-131.png?alt=media\&token=0c5d1003-ac1b-4d27-9363-5b1251ea69f7)

On the Configuration tab for your service, you will see the list of the Services/Bindings. You need to click on icon `Open Binding WSDL Generation`.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTLnEuPmemHc6Z2lI9%2F-LrTM6KyLUHvyEr2UIz8%2Fdoc-132.png?alt=media\&token=19dbb920-29ff-4374-a9f2-87acd00c87eb)

You have generated the WSDL link for your service. Use this link in Hala to create the Action.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTLnEuPmemHc6Z2lI9%2F-LrTMxfyEilE0Zf68kXY%2Fdoc-134.png?alt=media\&token=21947f86-5bc5-45fc-a0d3-90db384f0890)

**Step 3.** Go to the `Integration` section on the [Hala Platform](https://platform.hala.ai/), and add the new integration for SAP. Provide the name for the integration, base URL (host name and port), your SAP username and password (you can create a technical non-dialog user for this purpose). Save your integration.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTQjPaMPRF8THXeC4A%2Fdoc-140.png?alt=media\&token=839ec59e-c7ce-46ec-ae72-eb4b3506ee74)

**Step 4.** Go to the `Actions` section on the [Hala Platform](https://platform.hala.ai/),  and create a new `action`.  Provide the name for the action and select the integration.&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTR0vtY5PsZi1QEzs2%2Fdoc144.png?alt=media\&token=f375b26e-1995-4570-bbc0-9d84d3a2c00e)

**Step 5.** Make the configuration of your API service.&#x20;

* WSDL url - Copy the WSDL path from the Web Service configuration, that you did on previous steps.
* SOAP Action - WSDL can include several actions. You need to choose one action that you want to use.
* Parameters - Here you need to specify import parameters for your service (BAPI function in SAP). In the parameter value, please specify `{{context.username}}`. Later, during the dialog building, we will create a context variable `context.username` that will store the user ID that should be unlocked.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTR8uCjsk0Wvc_Sq3Z%2Fdoc-141.png?alt=media\&token=a2cd8f17-9cd0-4f2b-9466-6ed207b10edc)

{% hint style="info" %}
You can find import parameters by executing the needed BAPI in SAP.
{% endhint %}

Open SAP and run transaction `SE37`. Specify the BAPI name. Click `Test/Execute` icon or `F8`.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTS5wpWbi84G5i7PXz%2Fdoc-142.png?alt=media\&token=cdc383ef-c313-418b-860b-6144f2ae7521)

Click `Test/Execute` icon or `F8`.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTSLkKQbhlhbT6zUO8%2Fdoc-143.png?alt=media\&token=3b6e9172-f088-4465-a8c7-3ed83c1c3a56)

On this screen you will see the section with Import Parameters, in our example, we have only one parameter `USERNAME` . You can copy this parameter and past in the Action configuration.&#x20;

**Step 6.** You have set up integration and action. Now, you need to create an intent to recognize the user input about unlocking the user. Go to the `Intents` section on the [Platform](https://platform.hala.ai/) and press `New Utterance`

**Step 7.** To change the default name of the intent, click on icon pencil next to the default value, or you can click on the default value, and then you will be able to modify it. <img src="https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrOJiy_3_d7-vnIotZh%2F-LrOJszLxa65RtZ1W2Ew%2Fdoc-111.png?alt=media&#x26;token=5460e588-e231-4f60-8a85-0e45477a3a57" alt="" data-size="original">&#x20;

**Step 8.** Specify the name of the intent and press Enter <img src="https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTUO8bDS0H5nk1Kesy%2FScreen%20Shot%202019-10-18%20at%201.50.25%20PM.png?alt=media&#x26;token=56fd33df-0b91-44cf-bf8e-0324e8f2e9ce" alt="" data-size="original">&#x20;

**Step 9.** Now you need to provide examples of how the end-users can write about unlocking the users. You need to provide at least five examples.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTURJ3DoyAkmVGCt3p%2FScreen%20Shot%202019-10-18%20at%201.49.22%20PM.png?alt=media\&token=5449dd1f-293e-4a1a-aa10-beb85c529c4a)

**Step 10.** `Save` your changes and `train model`

**Step 12.** Go to the `Skill Kit` section on the [Hala Platform](https://platform.hala.ai/) and create a skill by pressing the button `Create skill`

**Step 13.** Provide the name of the skill, description, and tags (last two is optional). Press next for creating the dialog flow.&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTUtjPys3l9fdw6075%2FScreen%20Shot%202019-10-18%20at%201.52.33%20PM.png?alt=media\&token=885c7a8b-fb8b-49e7-9a58-fafb4a1545f4)

**Step 14.** You will be promoted to the interface for creation dialog flow. Create the first root node by pressing the button `Add new`

**Step 15.** Open the created dialog node and fill it.&#x20;

* Field Name - you can enter any value, for example "The end-user asks for unlocking the user in SAP"
* Conditions - here you need to specify created intent `intent.sap_unlock_user`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTVEU2NgUBKpnKHzlL%2FScreen%20Shot%202019-10-18%20at%201.54.06%20PM.png?alt=media\&token=9e9ab277-481d-48dc-87cc-3d406e7c2dc4)

* Actions - skip this section
* Context - skip this section
* Output - provide the response to the user

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTVblPSMVXblOKYlGz%2FScreen%20Shot%202019-10-18%20at%201.55.42%20PM.png?alt=media\&token=1f66caa2-7ca6-4f26-bf18-529dd878fbb0)

**Step 16.** Now you need to create a child node to recognize the input from the user about the user ID.&#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTVkd-BKN5yO_nyCMn%2FScreen%20Shot%202019-10-18%20at%201.56.20%20PM.png?alt=media\&token=6c64cc0c-2229-4b7b-815f-48ea9ffb69b8)

**Step 17.** Open the child node and fill it.&#x20;

* Field Name - you can enter any value, for example "Get user ID"
* Conditions - here you need to specify the condition `input.text`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTVyfz48dHMPH5W3ap%2FScreen%20Shot%202019-10-18%20at%201.57.20%20PM.png?alt=media\&token=30ade67c-6ae9-4b31-8d46-1ee0fc3572c9)

* Actions - When we got the information about the user ID, we can send the API request to the SAP. We need to add the Action that we have created previously.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTW8noQQuTYd7eUF0Q%2FScreen%20Shot%202019-10-18%20at%201.58.04%20PM.png?alt=media\&token=84f6778d-5a18-494d-8920-1fdeba04fba3)

When you add the action, you would need to specify the context variable where the response from the SAP will be stored, for example, `context.SAP`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTWfqw0K02Hu23wK0a%2FScreen%20Shot%202019-10-18%20at%202.00.24%20PM.png?alt=media\&token=c4c09b46-a90f-4c69-96fb-89e64404b75f)

* Context - Here we need to save the user ID that we need unlock. Let's assume we have a straightforward case, and when we will send to the end-user question, "What is the User ID," we will get the reply from him - "rudchuk." In this case, we can store all the end-user input `{{input.text}}` into the context variable `username`.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTYcDliSw5NaAycLWU%2FScreen%20Shot%202019-10-18%20at%202.08.47%20PM.png?alt=media\&token=13006b72-79d5-4a20-95b7-ace36c5b4cf7)

* Output - In output you can write something like this "Please wait, I am checking the information."

**Step 18.** Create a new child node to process the API response from the SAP. &#x20;

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTZpaoeaK2SuXsBcEj%2FScreen%20Shot%202019-10-18%20at%202.14.08%20PM.png?alt=media\&token=fbfa133b-636f-4472-b177-3b1abbb55ada)

Open the created node and fill it:

* Field Name - you can enter any value, for example "Provide the results"
* Conditions - Specify the context variable that was created for the Action Response on previous steps: `context.SAP`

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrSgSQd3-4lbqE3BPSl%2F-LrSwO6nxiSjUAdcaW4f%2Fdoc-149.png?alt=media\&token=d4ae6041-972a-44ec-a02e-a09fd2e65133)

* Actions - skip this section
* Context - skip this section
* Output - In the Output, we would need to provide information about unlocking the user. To access the data from the API response, you would need to use the next prefix `context.SAP.` and then specify the path to the required data. You can use [SOAP UI](https://www.soapui.org/) to test your Web Service, where you will see the structure of the SAP Web Service response. Also, you can use the [Hala Test Mode](../../chat#overview-of-the-chat-test-mode) to check the structure of the API response.&#x20;

You can use the next text:&#x20;

```
Response from SAP: {{context.SAP.RETURN.item.0.MESSAGE}}
```

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTaSFLTOo6s8wHpn0T%2FScreen%20Shot%202019-10-18%20at%202.21.15%20PM.png?alt=media\&token=c976bb52-5129-4646-b555-f95b2b224d95)

**Step 19.** Save the changes by pressing button "Save Changes". Now you have created the simple skill with one dialog node.&#x20;

{% hint style="warning" %}
Remember to save your changes.
{% endhint %}

**Step 20.** Test the results. Go to the Hala Web Chat by using the next link [https://chat.hala.ai/](https://chat.hala.ai/) and type the first message in the chat. You can type one of the trained phrases, or you can use new phrases that weren't specified in intent training.

![](https://3295177523-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lit4AWYuRQwOi31ApzH%2F-LrTNT-cWv44ZkX7WvEs%2F-LrTbBVwcRt92L65iqIw%2FScreen%20Shot%202019-10-18%20at%202.24.21%20PM.png?alt=media\&token=57cd13bd-1325-4c60-ab3f-72166d5fdd24)

{% hint style="success" %}
Congratulations! You have created the skill and tested it.
{% endhint %}
