RazorSPoint

ERPConnect Services with Nintex Workflows

Sebastian SchützeSebastian Schütze
This entry is part 3 of 4 in the article series ERPConnect Services

In this part I am going to explain how you can use Nintex to connect to an SAP system with ERPConnect Services. The actions, which comes with a .wsp solution, get shipped with the ERPConnect Services software on installation and needs to be installed seperatly on SharePoint.

There are three different actions. One is for calling SAP function, another for getting data from a SAP table and a third to do XQL (Extract Query Language) queries against SAP. XQL is used to query against the ERPConnect Services webservice directly.

Example Workflow – Read SAP table

In this section I am going to explain the “Read SAP table”-action which will query against the standard SAP table VBAP. For this I used several workflow variables

all the data is returned as XML which is saved in the variable XML Table Output. After parsing the XML the returned values are saved in the other variables. For the action itself we need a already configured SAP connection in the install ERPConnect Service. This simply means we created a SharePoint Service Application configuration in the Central Administration which holds the credentials (with in the Service Application directly or somewhere in the Secure Store). You would then see the Service Application to choose from. Then we need to fill in the name of the name of the table and give the variable where to save the return data. In the screenshot below I also used a Where clause, which can be used to prefilter the data on the SAP side. This can save bandwidth depending on the size of data. Here I filter by a given Title from a title of a list item in a SharePoint list.

The workflow itself looks like this, which also consists of parsing the data and then saving it to a SharePoint list. In this case the workflow is a list workflow which gets always triggered when an item is created. It takes the title and tries to use the titles content to get data from SAP.

 

The return data from the SAP table VBAP in the action look as follow.

<?xml version="1.0" encoding="utf-8" standalone="yes" ?><TABLES><TABLE name="VBAP">
  <VBAP>
    <MATNR>M-12</MATNR>
    <PSTYV>TAN</PSTYV>
    <SPART>07</SPART>
    <VBELN>0000011667</VBELN>
    <BRGEW>14.000</BRGEW>
    <NETWR>899.00</NETWR>
  </VBAP>
</TABLE></TABLES>

We can then use the XML data and use the Query XML standard Nintex action and get the values we need with XPATH.

Then for debug reasons you can save the raw XML data also into a list.

And then just save the return data with XPATH into a choosen list.

 

Nintex Action – Call SAP Function

This action is similar to the previous one. Here instead, we call a SAP function. The diference here is, that we have defined input and export parameters which depends on the function you are using. I am not explaining the returns, because they have the same structure like returned from inside of SAP.

But the output is XML again, which can be parsed.

Nintex Action – Query XQL

This action can be used to freely query anything with the XPL query language. It works very similar to SQL query language. An detailed example is explained at the Theobald website.



Sebastian is an Azure Nerd with focus on DevOps and Azure DevOps (formerly VSTS) that converted from the big world of SharePoint and O365. He was working with O365 since 2013 and loved it ever since. As his focus shifted in 2017 to more DevOps related topics in the Microsoft Stack. He learned to love the possibilities of automation. Besides writing articles in his blog and German magazines, he is still contributing to the SharePoint Developer Community (and PnP SharePoint) to help to make the ALM part a smoother place to live in.

Comments 0
There are currently no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.