Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
vodela
Active Participant
0 Kudos
In the blog I will describe how you can design and test multiple Sales Orders requests that can be sent to SAP ES5 Server and then merge all the responses to be sent back to the caller.

If you are new to Cloud Platform Integrations Please look at 

https://developers.sap.com/tutorials/cp-starter-isuite-onboard-subscribe.html

https://developers.sap.com/tutorials/cp-starter-integration-cpi-onboard-subscribe.html

If you dont have access to ES5 look at

https://blogs.sap.com/2017/12/05/new-sap-gateway-demo-system-available/

 

  1. Create new Integration Flow by clicking on the url



 

 

2) Create a new Integration Package as shown below


 

3) Create a New Integration Flow by Select the Package Create in Step 2 and Choose Artifacts and then choose add and fill in the details of the new Package


 

4) Click OK  and then Select the Create workflow by double clicking on the workflow and choose Edit so that you can design the Integration to call SAP and fetch PO data.


 

The integration we would like to create is as follows

A)  HTTPS call is made to the integration url - Json body contains multiple SO numbers

B) After receiving this payload the integration will split into single SO and pass this to SAP ES5

C) The results are merged and sent back to caller as response.

5) Each of the icons on the left  provide different functions which we will need to complete the integration.

Connect the Sender and Start Message and choose HTTPS and in the connections tab enter /SapES5PO



 

 

Uncheck CSRF Protected.

6) Drag a JSON to XML converter and place it after the Start Message and connect Start Message and Converter.  After that place splitter  and join with the converter as shown below.


In Splitter set Xpath so that the split occurs for every SO number in the input

See Step 8 for additional info on the input Json


 

7) After this Drag Request Reply from External call and connect the integration and arrange the receiver as shown below.


 

8) we now add Content  Modifier and create a header parameter SOid of type Xpath and value //SalesOrders/SOId.  The reason is that my input Json is as follows



{

   "SalesOrders" : [

          {

         "SOId": "0500000000"

          },

            {

         "SOId": "0500000002"

          }

   ]

}



This will be converted to XML and Xpath //SalesOrders/SOId.  will give me a header variable SOid which can be accessed by ${header.SOId} in my later query. The Type of the variable is

java.lang.String as shown below






9) Now Drop an Request Reply from External calls and then place it after content header and connect his with the receiver and choose Odata Version 2


 

This will take each PO from the header and call SAP.  We now have to gather the response from SAP so that we can send one combined response for all POs to the user.  For this we will drop a Gather into the workflow so that we have an integration flow as show below


 

 

Save this.  You will get errors as we have not done configuration for the odata Service which will be done in the next step

10)  Click on the odata link between Request reply and Receiver and add the following in the connection and process tabs


Address of the ES5 Service is h

https://sapes5.sapdevcenter.com/sap/opu/odata/iwbep/GWSAMPLE_BASIC/

Click on the PRocessing tab and enter the following

Resource Path SalesOrderSet

Query Options

$select=SalesOrderID,Note,CustomerID,CustomerName,CurrencyCode,GrossAmount,NetAmount,TaxAmount,CreatedAt&$filter=SalesOrderID eq '${header.SOId}'

For the Query option you can choose the designer


 

Save the integration and ensure that there are no errors.

11) Go to Operations view and Select Security Material and User Credentials and enter information as shown below


 

12) go to your integration view in the designer that you created and click on the deploy button and you check in the operations views that the integration has been started.  We need to fetch the url.


 

14) Start Postman and enter the url for Post as show below - Choose Post as the operation

Postman Authorization Tab


 

Header tab add content type Application/Json

in the body add the following Json



{

   "SalesOrders" : [

          {

         "SOId": "0500000000"

          },

            {

         "SOId": "0500000002"

          }

   ]

}




and Click Send get the response





 
Labels in this area