SAP PI/PO Adapter

  1. Home
  2. Dokumente
  3. SAP PI/PO Adapter
  4. 49. How to create inbound synchronous query interface in SAP PI/PO with SAP BAPI using SKYVVA V3 connector module?

49. How to create inbound synchronous query interface in SAP PI/PO with SAP BAPI using SKYVVA V3 connector module?

This document describes how to create an inbound query interface in SAP PI/PO with SAP BAPI with new SKYVVA  V3 connector module.

What is Query?

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.

What is Query All?

Executes the specified SOQL query. Unlike the Query resource, Query All will return records that have been deleted. Query All will also return information about archived Task and Event records.

SKYVVA interface creation

Create an inbound interface, for example, “searchService_IN“ as shown below.

Select the Operation type as query“ or “query All“

 

 

 

 

 

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

 

 

 

 

 

Now save the interfaces and download the WSDL. This is needed to do mapping in SAP PO.

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 SearchService_IN

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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 SearchService_Out

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Since in this example, we are sending data from SAP to Salesforce. So, no need to create data types for request and response. We just need to import the RFC from SAP system.

 

 

Activate the imported RFC.

As we are using RFC as source structure so no need to create outbound service interface.

Create inbound service interface 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 not needed for SKYVVA V3 which is included with connector module to convert the Skyvva message JSON format into a business structure.

 

 

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 RFC communication channel

Create sender communication channel as shown below.

Since we are using RFC as a source. So, here we are using RFC 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. 

For V3 Skyvva module:

We need 3 modules in the soap receiver channel

1. Skyvva/V3/QueryBuilder -> 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. Skyvva/V3/ExecuteQuery -> here we only fetching the result which has been executed

 

 

 

 

 

 

 

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.

Configuration of module parameters are described in detail below

  • Skyvva V3 Module Parameters

 Module parameters are outlined below

 

 

 

 

 

 

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,BillingPostalCode,BillingState,BillingStreet,Description,Fax,Id,Name,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.

We are executing the FM from SAP.

 

Got the response from skyvva to SAP

 

 

 

Fandest du diesen Artikel hilfreich? Ja Nein

Wie können wir helfen?