Inbound Interface – Direction SAP to Salesforce with multi-tab adapter functionality
Table of Contents
- Skyvva software landscape and building blocks
- Used Convention
- Purpose & Prerequisite and requirement for creating an outbound interface
- Creating Inbound Interface
- Scenario: Inbound interface using structure
- 5.1: Develop BAPI/RFC
- 5.2: Create Interface and define fields in the skyvva config
- 5.3: Export BAPI structure from SAP
- 5.4: Create interface, import BAPI structure and do mapping
- 5.5: Develop a report program by referring (Report : /SKYVVA/SEND_ORDER_INVOICED)
1. Skyvva software landscape and building blocks
Skyvva Integration Suite enables the integration between Salesforce and SAP-Backend with the native ABAP-Adapter sitting inside on SAP Backend e.g. an ECC 6.0 System with less effort and without programming neither in SAP nor in Salesforce. It is based on the generation and customizing approach to reduce effort and to accelerate the development of interfaces between these systems.
Architecture building blocks: The creation of an inbound interface is only possible when the Skyvva solution framework is set up correctly. This work has to be done beforehand by an administrator e.g. an ABAP transport has to be imported into the customer SAP-Backend system.
2. Used Convention
When talking about the direction we have to clearly define the perspective from which platform we are looking for. Since we couple 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 call interfaces for sending data out of Salesforce to SAP “Outbound Interface“. For the other direction, we call interfaces “Inbound Interface” when data comes to Salesforce from SAP. So the reference point is set to Salesforce.
3. Purpose & Prerequisite for creating an inbound interface
Purpose: Many a times we have to send the data from SAP to Salesforce either through some Background job which runs weekly or monthly or whenever there will be any change made by the user in SAP so that both the system’s record will be in sync. To achieve this SKYVVA propose to use multi-itab functionality of Skyvva, as part of multi-itab functionality we have provided 2 methods to send the data: /SKYVVA/CL_CONTROLLER_OUTBOUND~SEND_TABLE() & /SKYVVA/CL_CONTROLLER_OUTBOUND~SEND_TABLE_W_ALL_FIELDS()
This article uses /SKYVVA/CL_CONTROLLER_OUTBOUND~SEND_TABLE() approach to send the data, using this we can send the data of a structure or table which is available in ABAP Dictionary.
To send the data of local defined structures use /SKYVVA/CL_CONTROLLER_OUTBOUND~SEND_TABLE_W_ALL_FIELDS().
- The Skyvva solution framework has to be installed into your SAP & Salesforce instance. Refer to our website :
Install Skyvva in Salesforceto carry out this task.
- An integration instance has been created. Refer to our website:
What is an integration and how to create it?to carry out this task.
- Creating logical Port via the SOAMANAGER. Refer to our website:
Create Enterprise Serviceand
Create IService Portto carry out this task.
- Your workstation needs an internet browser IE or Firefox of the new release.
When this prerequisite is fulfilled you can start creating inbound interfaces with the Skyvva development framework to send data from SAP to Salesforce.
4. Creating Inbound Interface
You can start developing an inbound interface when you want to send data from SAP-Backend to Salesforce using Skyvva ABAP-Adapter. With the ABAP-Adapter you can send only data between SAP and Salesforce. If you want to send data from SAP to anywhere else you need to use other technology or middle-ware like SAP-PO.
4.1 Overview of steps to create an inbound interface
The first question you should have might be how should I start? What is the first step to do? Should I start first in SAP or first in Salesforce? This chapter gives you an overview of which step is involved in creating an inbound interface and why you need this step.
Before you start to develop the interface make sure that the prerequisite e.g. creating a logical port in the SOAMANAGER and installing the Salesforce CA Root certificate is fulfilled.
Steps in creating an inbound interface
The creation of an inbound interface consists of steps shown above. Each step is carried out either in Salesforce or in SAP. In each block, you see in the bracket the name of the component e.g. Salesforce or SAP where the step is done.
Note: The grey box contains complex customizing tasks to do in SAP and is therefore not described. Here, in this document. This block will be described in a separate document called “SAP ALE / IDoc Customizing”. Without having done the task in the grey box you cannot send IDoc or use BAPI to send data from an SAP system.
The table below summarizes the step/task at a higher level.
|1.||Customize ALE/IDoc or write BAPI to extract the business data|
|SAP||Here you customize ALE and IDoc to send IDoc out of SAP. You need to do a change pointer customizing using IDoc. If you use BAPI you have to develop this BAPI yourself first. This task can be done by an experienced ABAP developer or ALE/IDoc customize.|
|2.||Define IDoc/BAPI and fields in the Skyvva Config|
|SAP||After you have done the ALE/IDoc customizing or BAPI Creation you can use this IDoc/BAPI as an interface. Here you use the skyvva transaction /skyvva/config to create an interface based on IDoc or BAPI and to select fields you need to send to Salesforce.|
|3.||Export the IDoc/BAPI structure from SAP||SAP||In this step, you need to export the interface definition based on IDoc or BAPI from SAP. This is needed later in Salesforce as an interface that represents the data coming from SAP.|
|4.||Create Interface, Import IDoc/BAPI structure and do mapping|
|Salesforce||In this step, you first create an interface in Salesforce. Then you import the structure you have exported in step 3 above. Then you do the mapping with the Skyvva graphical mapping tool.|
|5.||Using workflow to route to the interface||Salesforce||In this step, you use workflow conditions to route incoming data from SAP to the right interface in Salesforce.|
|6.||Testing and Monitoring messages||SAP and Salesforce||After step 5 you have successfully developed an inbound interface and have to test it. Testing involves creating a test ABAP report to call the BAPI or IDoc change pointer customizing. You can then monitor in SAP and Salesforce with the skyvva message monitoring.|
5. Inbound interface using structure
The aim of this scenario is to create a BAPI Inbound interface from SAP to Salesforce. Here we are sending a structure(Customer Details) using the RFC from SAP to Salesforce through Skyvva ABAP adapter. As we are sending structure information so first create a structure with business requirement fields.
5.1 Develop BAPI/RFC
Based on the business requirement select/fill all the fields of structure/table in the Function Module.
Call transaction /n/skyvva/config.
Click on the New Entries button for creating New Interface.
In this screen enter a name for the field SAP interface id. This is the name of your interface. Give a meaning full name for your interface. Then choose the value “BAPI interface” for the type.
Now save you editing with the save button. You might get a popup screen to record your change for later transport. Here just give a transport number of your choice. If you don’t know the transport number you can create a new one or contact your SAP basis admin and ask him for a valid SAP transport number to use.
After this step, you have created an interface with the name /SKYVVA/CUSTOMER_OUT. Now you need to specify the parameter and fields you want to transfer to Salesforce.
To do so select the created Interface and double click on BAPI int. maintenance on the left side.
Now the screen will open where you need to provide a Function module.
Now you have to choose the Function Module which is you developed above. In this example Function Module is ZBAPI_SEND_CUSTOMER.
Normally custom RFC usually have required fields which we need to send to Salesforce. Therefore there is an option to send all fields of RFC. If you select that then all field will be included in the XML file generation.
Because of this characteristic of a BAPI/function module we don’t describe the way how to add different parameters and fields but just use the option like shown in the screen below. Check the flag “All Fields” as shown in this screen.
A second flag you have to check when using function module is the flag “send input”. This flag indicates the run time of Skyvva that the data should be sent via function module call and not IDoc.
Now save it. The function module has importing & exporting parameter for exchange of data. So, we need to define those fields in this interface too. To define fields, select the Function module & click on BAPI parameters
Here the field “parameter Name” you can choose from F4 Help. The sequence you can mention the number if you are sending more than one parameters in the function module.
If the parameter is a key field then set that field as “key field”.
The field “StructName extern” we can give sObject name from Salesforce here it is optional.
If the Parameter is an input parameter in the interface, set the flag “Input Parameter”.
If the parameter is an output parameter in interface set the flag “Output Parameter” as shown in the below screen.
The Parameter we selected is structure i.e it will have multiple fields. So, here we need to define these parameter. Now save and click on BAPI fields.
Now add the fields of the parameter by F4.
Save the interface. Now our SAP interface is ready.
Now Interface is ready to export.
5.3 – Export IDoc / BAPI structure from SAP
The prerequisite for executing this step is that you have defined the BAPI structure as described in step 2. You need to export the structure as an XML file to import into Salesforce in the next step. This structure will represent the SAP structure on the left side in the mapping later on in the skyvva graphical mapping tool in Salesforce.
Use the following transaction.
Call transaction /n/SKYVVA/INTF_EXPORT in SAP
Enter the following information on the screen:
Interface: The exact name of the created Interface or select the Interface using F4
Language: Depending on the language it may be possible to get the SAP field descriptions into the IStructure
Format: There are 4 different output formats:
D – Deployment Script
U – Format for XML upload
V – Format for XML upload (2)
C – CSV file (not yet supported)
The most commonly used formats of an IStructure to upload to Salesforce are either D or V. they differ in the XML structure and how they are uploaded into the SKYVVA Integration Suite in Salesforce. Structure V offers the possibility to get the SAP field description into the IStructure.
Select the interface name you have defined in step 2.
Specify the location where you want to save the XML file.
Execute to save the generated file in the desired path. The file generated is in XML format, which will be Salesforce to give the SAP fields, which are required to map.
The next step is to upload this structure into Salesforce. Follow step 4 to upload the file into Salesforce.
5.4 – Create interface, import BAPI structure and do mapping
The prerequisite for executing this step is that you have exported the BAPI structure as described in step 3. In this step, you will create an interface, import the sap structure and do the mapping with the skyvva graphical mapping tool.
Now login into your Salesforce instance and open your integration.
- Enter the Desired Name of Salesforce Interface.
- Here, provide the Salesforce object name, where need to save the data.
- Choose Deployed, which makes this interface used to interact with SAP.
- Inbound – As data need to send into Salesforce from SAP
Save, then you able to see the interface.
Now Open interface and go to Related Tab.
Now, select the Import Field definition to upload the XML file, which we created in step 3.
Choose the file to upload.
After the upload is successful you will see the result like the screen below, after refreshing the page. You will get the fields you have selected from SAP. Now you can do the mapping from the SAP fields on the left-hand side to the field of Salesforce object e.g. Account on the right-hand side. How to do a mapping refers to the mapping guide.
After you do all the required mapping based on the business requirement we are finished.
Now need to develop SAP report to run the interface with the multi-tab adapter.
5.5 – Develop a report program by referring Report : /SKYVVA/SEND_ORDER_INVOICED
1. Once this configuration is done, then go to the program “/SKYVVA/SEND_ORDER_INVOICED” using SE38.
2. There is already logic written to get the interface configuration during run time.
3. Use the logic in your program from /SKYVVA/SEND_ORDER_INVOICED