Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

SAP Integration in Mule ESB

DZone's Guide to

SAP Integration in Mule ESB

Learn how to set up data integration between SAP NetWeaver and your organization's systems with the Mule ESB SAP connector.

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

Currently, SAP is at the core of most enterprises and needs to connect various systems. Mule ESB provides a connector that enables integration of data with SAP NetWeaver and external systems.

Requirements:

  • Mule ESB 3.8

  • Anypoint Studio 6.0

  • SAP Connector 2.2.6

The SAP Connector needs to download from the Anypoint Exchange, once its downloaded, install and restart the Anypoint Studio to effect the changes.

You will find the SAP connector in the design palette


Image title

Here MULE allows to connect SAP Systems through Anypoint SAP connector which is certified connector (well tested one so we can use happily with out bothering exception handling and connection issues .. ) leverages the SAP Jco (java connector lib ) which enables mule applications to do the different operations 

Excecute the BAPI functions using RFC protocal and those are SynchronousRFC, TransactionalRFC and QueuedRFC

SAP allows to define the exchange pattern (one-way / Two-way : request - response )

Below picture shows where you configure the exchagne pattern and SAP connector configuration which allows to define Type of operation plus RFC type which I have mentioned above.


Image title

Click on Plus symbol to add the connector configuration and provide the SAP system details for integration.

Image title

After providing the details, check the connection using 'Test Connection' to make sure details are accurate.

Perform the library checks which are showing red color in the above image, follow the below points..

JavaConnector library depends on your hardware platform and operating system. Therefore, you need to download the proper version for the local drive running Anypoint Studio.


Three files are required for both libraries:


  • Two multi-platform Java libraries:
    • sapjco3.jar
    • sapidoc3.jar
  • One of the JCo platform-specific native libraries:
    • sapjco3.dll (Windows)
    • libsapjco3.jnilib (Mac OS X)
    • libsapjco3.so (Linux)

Click on Advanced Tab to configure the extended properties for SAP connector.


SAP Connector configuration in XML syntax -

<sap:connector name="Sap Connector" jcoClient="${SAPClient}" jcoUser="${SAPUser}"
jcoPasswd="${Passwd}" jcoLang="${SAPLang}" jcoAsHost="${SAPHost}"
jcoSysnr="${SAPRFCSysnr}" 
jcoPoolCapacity="${POOLCAP}" jcoPeakLimit="${SAPLIM}"/>


Below is Connector and advanced configuration using BAPI and IDOc configuration deatils 

<sap:connector name="Sap Connector" jcoClient="${SAPClient}" jcoUser="${SAPUser}"
jcoPasswd="${Passwd}" jcoLang="${SAPLang}" jcoAsHost="${SAPHost}"
jcoSysnr="${SAPRFCSysnr}" 
jcoPoolCapacity="${POOLCAP}" jcoPeakLimit="${SAPLIM}"/>


<flow name="idocServer">
<sap:inbound-endpoint exchange-pattern="request-response" connector-ref="SapConnector" type="idoc" functionName="MATMAS05" rfcType="trfc" xmlVersion="2" outputXml="true" jcoGwHost="${sap.jcoGwHost}" jcoGwService="${sap.jcoGwService}" jcoProgramId="${sap.jcoProgramId}" jcoConnectionCount="${sap.jcoConnectionCount}" responseTimeout="10000" doc:name="SAP"/>
<logger level="INFO" doc:name="Logger" message="#[payload]"/>
</flow>


<flow name="bapiServer">
<sap:inbound-endpoint connector-ref="SapConnector" type="function" functionName="STFC_CONNECTION" rfcType="trfc" xmlVersion="2" outputXml="true" jcoGwHost="${sap.jcoGwHost}" jcoGwService="${sap.jcoGwService}" jcoProgramId="${sap.jcoProgramId}" jcoConnectionCount="${sap.jcoConnectionCount}" responseTimeout="10000" doc:name="SAP" exchange-pattern="request-response"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
</flow>


This is the way it allows you to connecto SAP System and enables SAP operations to do easy without writting much code.

Happy Integration !!!



Download A Buyer's Guide to Application and Data Integration, your one-stop-shop for research, checklists, and explanations for an application and data integration solution.

Topics:
integration ,sap ,mulesoft ,mule esb ,tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}