Accessing SAP Business One using the Service Layer is a two-step process. The first step (Login) responds with two cookies. These cookies are then used in any subsequent web service calls in the current processing cycle.
Accessing SAP Business One via the Service Layer is available for HANA on v9.3 only. It is available for both HANA and SQL Server beginning with SAP Business One v10 PL02.
The difference in Bizweaver v2.5 is that a Service Layer global connection can be used to manage much of the detail work. Configuring a Service Layer global connection is described here.
Once the workflow has completed a successful login, the remaining steps will use the Interact With Data option.
More information on the various objects and methods is available on your HANA server by using this URL in a browser on your network.
https://<YourServerName>:50000
application/json
for all Service Layer transactions.
The above image is shown for information only. It illustrates the cookies variables that used as credentials to interact with SAP Business One. The cookies will created in the initial Login step.
Information on sending data through the Service Layer is found here.
This workflow builds two sections of a JSON structure for an SAP Business One sales order. The sections are the header and the rows. Each section consists of a SQL statement to gather the needed information and the DataBuilder to format the information. Once the pieces are constructed, the output is sent to the SAP Service Layer API in the WebService step. Other APIs will work in a similar manner.
This should always contain the first items of the data structure.
Continue this process for all desired fields in the top-level object.
The data structure being built is displayed in the left-side panel as elements are added. The data structure cannot be altered in this area. The display is for information only.
This will be the next section in the expected data structure. The process is the same as described in the “Main DataBuilder” step.
For objects such as a set of rows, the display will only display a single entry. However, all data received as input will be included when the workflow executes.
In most cases the lower-level sections will need to be marked as an array. The “Add as an array” checkbox should be selected. However, always check your API documentation to verify this. At the same time, the “Top-level Element” checkbox should remain cleared.
When creating lower-level section that may have more than one entry (i.e. an array), be sure to put the DataBuilder tool within a Loop. As each record is read from the input it is added to the bottom of the array being constructed. Not using a loop will result in an incorrect data structure.
All objects other than the main one will require an Object Name. This must exactly match (including case) what is expected by the API.
Once the DataBuilder steps for the lower-level objects have been created, they can be referenced in the main DataBuilder step. This is what causes the entire data structure to be created when the workflow is executed.
Here is the resulting JSON that is sent in the API call.
{
"CardCode": "C20000",
"DocDueDate": "20190313",
"DocumentLines": [
{
"ItemCode": "A00001",
"Quantity": 9,
"LineTotal": 33.75
},
{
"ItemCode": "A00001",
"Quantity": 7,
"LineTotal": 105
}
],
"AddressExtension": [
{
"CItyB": "New York"
}
]
}
The output of the main DataBuilder step is used in the API call. This is done by using the “CumulativeData” variable from the Main DataBuilder step. An example is shown in the image below.
Information on sending data through the Service Layer is found here.