SAP PI/PO Adapter

  1. Home
  2. SAP PI/PO Adapter
  3. 13. How to create inbound synchronous query interface in SAP PI/PO using SKYVVA?

13. How to create inbound synchronous query interface in SAP PI/PO using SKYVVA?

This document describes how to create an inbound synchronous query interface with SAP-PO java single stack. When talking about the inbound interface in this document the direction SAP to Salesforce is meant e.g. Salesforce Interface will be called from SAP-PO. The development of an inbound interface involves steps to be done in Salesforce and in PO. This document does not describe the work at SAP-Backend e.g. developing business logic in SAP-Backend with ABAP.

If want to search the data/records present in your Salesforce then this module will help you. It will help you to create a dynamic nature of search. You can configure the search feature and use it as per your needs. Skyvva app will help you to configure your search. You need to follow the below steps to configure your search:

  1. Create an integration or use an existing integration.
  2. Create an interface using the above integration.
  3. The interface should have operationType as “query“ or “queryAll“. The SOQL query to select sObject data needs to be set with required SOQL query.

To fetch small size data we use query and for Big size data we are going to use Bulk query.

  • SKYVVA software landscape and building blocks

SKYVVA Integration Suite enables the integration between Salesforce and SAP-Backend over SAP-PO with less effort and without programming neither in SAP nor in Salesforce. It bases on the generation and customized approach to reduce effort and to accelerate the development of interfaces between those systems.
In order to be able to provide such a toolset and framework some component (green) has been developed by SKYVVA and has to be deployed on Salesforce and SAP-PO of the customer. On the SAP-Backend e.g. SAP ECC 6.0 there is no software installation needed.


















Creating an inbound interface is only possible when the Skyvva solution framework is set up correctly. When talking about the direction we have to clearly define the perspective from which platform we are looking for. Since we are coupling two platforms Salesforce and SAP together we have to clearly define from which view we are referencing when talking about direction outbound or inbound.
















  • Outbound and Inbound Interface

The term outbound is used when data is sent out from Salesforce to SAP. Therefore we will call interfaces for sending data out of Salesforce to SAP “Outbound Interface”. For the other direction, we will call the interfaces “Inbound Interface” when data is sent from SAP to Salesforce. So, the reference point is set to Salesforce.


  •  Prerequisite for creating an inbound interface


  • The Skyvva solution framework has to be installed into your Salesforce instance.
  • An integration instance has been created
  • SAP-PO has been installed and set up correctly
  • Your workstation needs an internet browser IE or Firefox of the new release.


  •  Creating Inbound Synchronous Interface

Create a synchronous inbound interface when you want to query data from Salesforce over SAP-PO and need a result back to SAP e.g. query all account in Salesforce which has the status active. By this way, you can pull data from Salesforce by providing query parameter as a search criteria.

Note: You can only query data from Salesforce and get the result back. You cannot create or modify data in Salesforce in a synchronous way. If you want to create or modify data in Salesforce send data in an asynchronous way and do an operation like upsert, insert or delete. The only operation supported now in the synchronous call to Salesforce is the operation “query”. With this technique, you can prevent the open firewall from Salesforce to your SAP-Backend system. Thus enabling you to save work effort and cost. What you need is just to open the firewall from your internal network to the outside e.g. open from inside to outside. This way is most the case since there was no danger to open the firewall from inside to outside. The opposite way e.g. open the firewall from outside to inside is dangerous and therefore need restriction, security policy and thus effort and cost.


  • Overview of the steps to create an Inbound interface

The figure below depicts which steps to be followed to create an inbound interface with SAP PI/PO.













Steps to create a synchronous inbound interface

Step 1. Creating an inbound synchronous interface(Salesforce)

Login to the Salesforce org and then select Skyvva Integration Cloud.

Go to Integration Tab and create New Integration under that go to the interfaces tab and then create New interface as shown below.

In this example, I have created the interface under “Skyvva_SAP_Salesforce” integration
























Similarly, create the Outbound scenario for Query response as “QueryAccount_Response” as shown below














Now we have to fill the following fields:

  • Name
  • Source Name
  • Status
  • Sequence
  • Operation Type
  • Connect with Middleware
  • External Mapping
  • Interface Mode

Then click on button “Save” to save your interface.

Now we have to specify some required fields and other optional fields for defining the inbound interface. Following all fields related to creating an inbound interface for connecting to Salesforce are described. Note that there are also fields in the screen which is not needed for the SAP-PI coupling but needed for other couplings e.g. the SAP direct coupling.


4.1 Name

  • It represents the Interface Name that we are going to create and also we have to provide a meaningful description in the Description label.
  • Since we are creating an Inbound interface. So, here we recommend you to follow the naming convention as for example QueryAccount_IN for the inbound interface as shown below and QueryAccount_Out for the outbound interface.







4.2 Status

Initially, it will be in the “Development” status. When we want to run the interface then we have to set it as “Deployed” as shown below.







4.3 Sequence

Enter a number in this field. This field is for numbering the interface to be shown in the logical order on screen















4.4 Operation Type

This field contains the SQL statement for an interface. For inbound interface, we need to specify an operation since this is an updated interface.
In this case, you can specify the value “Upsert”.






This field contains the SOQL statement for an interface. We have to specify the operation type
“query”. Another operation is not supported to query.

The section “Query” is needed to select data for the inbound interface. Here is the place where you
specify your SOQL-Select Statement. You also can do a joint to get data from another object. The syntax
is based on the SOQL-Syntax. Refer to the online help of Salesforce to read about the syntax of the SOQL-








If you specify the query parameter it should be done in this Syntax{!field_name} e.g.(!SAP_Division__c)

You can join the parameter by entering the Boolean operation AND or OR. You can also join different

4.5 Field Type

Here we are specifying the direction of the interface e.g. Inbound or Outbound. Since we have created an inbound interface. So, We have to specify the value as “InBound”.







4.6 Interface processing mode

Here we have to specify the processing mode as Synchronous.








4.7 Connect with Middleware

We have to check this flag because we use SAP-PO as a middleware component. This is just to
indicate Skyvva runtime service that it is not connected directly to an SAP-Backend.






4.8 External Mapping

Since we are using SAP PO as a middleware component and as a developing a tool for mapping. This is just to indicate Skyvva runtime service that mapping will be done in SAP-PO and that you don’t need to do mapping in Skyvva framework.








If our business case needs that you want to map both in SAP-PO and in Skyvva framework then you have to
check the “Mapping in SFDC” also. But normally in most of the cases, we don’t need to do mapping in Skyvva
framework again.

Step 2 – Generate WSDL for the Inbound interface

Now we have to generate the WSDL for this inbound interface. This is needed to do mapping in SAP PO and to generate the WSDL. Go to Integration under that select details tab and then click on “Manage Middleware WSDLs” as shown below.














Click on the link “Manage Middleware WSDLs”

Now download the WSDL for both inbound and outbound response interface as shown below.




















Now select the interface you want to export as WSDL.
After selection of an interface now click on the button “Create WSDL”. Scroll down to see the generated





Now click on the Link “View“ and then WSDL will be downloaded.







Rename the downloaded file as SEARCH_RESULT_QueryAccount_IN.wsdl and SEARCH_RESULT_QueryAccount_Response.wsdl. Now we can import this  WSDL into ESR in SAP PO for mapping.

Step 3 – Import WSDL into ESR

First, we have to create a namespace in ESR like “urn:skyvva: Querysalesforce“.

Now create an external definition for Query Account request under the namespace like below. Here the WSDL is for Account. So, we can give the name as ED_SF_SearchQuery_Request.





















Now import the WSDL and Save and activate it.

Now create an external definition for Query Account response under the namespace like below. Here the WSDL is for Account. So, we can give the name as ED_SF_SearchQuery_Response.





















Since in this example, we are sending data from SOAPUI to Salesforce. So, we need to create data types for request and response as shown below.

DataType for Request – 














Save and activate the request data type.

DataType for Response


















Save and activate the response data type.

Now create Message type for both Request and Response as shown below.

Request Message type –















Save and activate the request message type.

Response Message type – 




















Now Save and activate the response message type.

Create Outbound and inbound service interfaces as shown below.








































Provide the necessary details as shown and then save and activate it.

  • Message mapping

Create request and response message mapping as shown below.

Request Mapping – 

Select the Source structure and target structure and complete the mapping.


















Response Mapping – 





















Now save and activate both the mappings

  • Operation Mapping 

Create Operation mapping as shown below.

This is for request mapping




















In Response-Mapping, a java mapping is needed to convert the Skyvva message format into a business structure. The java mapping will be provided from Skyvva and you just have to use it.



















Now select the inbound and outbound service interfaces and the respective request and response mappings.

Then save and activate the operation mapping.

  • Creation of Integrated Configuration Objects

After creating the objects in ESR. We have to configure these objects in the integration directory.

First, we have to create Configuration Scenario.

An Integration scenario has the following objects.

  • Business System for Sender and Receiver
  • Sender and Receiver Communication channel
  • Integrated Configuration












These are the objects we should create. We have to define our business system e.g. for the SAP-Backend. For Salesforce you can use our proposal “Salesforce” as the business system. We have to import these business systems from SLD.

  • Configuring the Sender SOAP communication channel

Create sender communication channel as shown below.

Since we are using SOAPUI as a source. So, here we are using SOAP adapter in the sender channel.





















Provide the necessary details. After that save and activate the channel.

  • Configuring the SOAP receiver channel

Configuration for Tab “General”



















Specify the parameters as shown in the above screenshot.

Below is the configuration for the “Advanced” Tab.













The value “TserverLocation” has to be entered for the parameter Variable Header (XHeaderName1).

Below are the settings for Tab “Module”. Here, the SKYVVA module containing the logic for session handling and transformation logic must be specified. This is using the module version 3



Configuration of module parameters are described in detail below

  • Skyvva Module Parameters

Starting from version 2.27 Skyvva provides a single module, “Salesforce/GetSessionID_V3”, to be used with SOAP receiver channels. Module parameters are outlined below




















For the new Module we no need to use the Java mapping in response mapping to convert the JSON response into XML.

We can directly include the parameter in the module to convert the JSON Response. Here are the channel configurations for new module.

We need 3 modules in the soap receiver channel e.g.

1. SFDC_Query_REQUEST -> prepare the execution of the REST and BULK query and pass the message payload to the 3. module
2. XISOAPAdapterBean -> calling our new soap API ‘RouteRequest’ to just pass back the request from the 1. module
3. SFDC_Query_RESULT -> here we only fetching the result which has been executed






The different way to put the SELECT statement

Here we are able to build the select statement dynamically by the pi mapping. Thus we need a field in the request payload which for example is called ‘SKYVVA__SOQL_SELECT’ and where we can build the SELECT-statement by using concat formula in the mapping. In this case, you are taking the value from this field and it will dominate the SELECT-statement on the module parameter.
In the request WSDL we need to add SKYVVA system field e.g. ‘SKYVVA__SOQL_SELECT’ and build dynamically the SELECT in the mapping.
We have at 3 different places to put the SELECT statement e.g.:

  1. In the interface
  2. In the module parameter
  3. In the PO request mapping in the field ‘SKYVVA__SOQL_SELECT’ .

Here is the SQL Statement used in Module Parameters.

SELECT BillingCity,BillingCountry,BillingPostalCode,BillingState,BillingStreet,Description,Fax,Id,Name,Phone,skyvvasolutions__SAP_Distribution_Channel__c,skyvvasolutions__SAP_Division__c,skyvvasolutions__SAP_Sales_Org__c FROM Account where skyvvasolutions__SAP_Distribution_Channel__c = ‘{!skyvvasolutions__SAP_Distribution_Channel__c}’ and skyvvasolutions__SAP_Sales_Org__c = ‘{!skyvvasolutions__SAP_Sales_Org__c}’ and skyvvasolutions__SAP_Division__c = ‘{!skyvvasolutions__SAP_Division__c}’


  • Integrated Configuration

Create integrated configuration objects as shown below.

Enter the required data e.g. the Communication Component, Interface and Namespace and then click on create button to create an ICO.
















Now go through the tabs from left to right to configure the relevant objects. In this first tab “Inbound Processing” here we have to specify the sender communication channel.

















Here in the “Receiver” tab, we have to specify the receiver business system.
















In Receiver interfaces tab specify the operation mapping.






















In the “outbound processing” tab, we have to specify the receiver channel.
















Testing the inbound synchronous Interface.

I am sending the data from SOAPUI. We are getting the JSON Response from Salesforce.





Here we can test the interface directly using the SKYVVA SOAP API. The result will be in JSON format.











Fandest du diesen Artikel hilfreich? Ja Nein

Wie können wir helfen?