Consuming IDOCs from SAP using BizTalk Server – Part 2

In the last post I covered the basic overview of IDOCs, its flow path and IDOC schema generation in BizTalk. In this post I will go through the port configuration for receiving and sending IDOCs in BizTalk. We can can use either of WCF-SAP Adapter or WCF Custom Adapter with SAP bindings. It does not matter whether you use the WCF-Custom Adapter or WCF-SAP Adapter, you are not losing any functionality. Using the WCF-SAP adapter does simplifies the administration tasks that are involved in maintaining the BizTalk environment.

 

INBOUND – Receiving IDOCs from SAP

First thing you need to add a reference to the Microsoft.Adapters.SAP.BiztalkPropertySchema.dll. This is required when you have a BizTalk application deployed which includes any IDOC schemas.

AdapterReference

If you fail to add this reference, you might get the following runtime error in the event viewer when trying to process an SAP IDOC:

“System.Exception: Loading property information list by namespace failed or property not found in the list. Verify that the schema is deployed properly.”

 

Now that we have the reference in place, we are going to configure the WCF-SAP Adapter, with BizTalkServerApplication Receive handler and  XMLReceive Receive Pipeline.

ConfigureButton

  • Click the Configure button so that you can provide the SAP connection information.
  • Once in the WCF-SAP Transport Properties dialog,  click the Configure button to provide the SAP connection information.
  • Now you need to provide the Application Server Host, System Number, and Client.

Transport

  • If you scroll down, there are few additional properties that are not included in Send Port configurations:
    1. Gateway Host—Depending upon the configuration of your SAP system, this may be the same value as the Application Server Host.
    2. Gateway Service—This value generally begins with “sapgw” followed by the System Number.
    3. Program Id—This may also be referred as Partner Profile and acts as an authorization container for SAP IDOC interfaces.  This detial will be provided to you by  BASIS admin. Within this  BIZTALK, the Program ID configuration in SAP, entries will exist for IDOC that will be received by BizTalk. Also BizTalk user will have access to send or receive these types of IDOCs.

Transport

  • In the Other tab you need to provide the credential for the authentication. other

With this now our Receive Port is configured to receive the IDOCs from SAP.

 

OUTBOUND – Sending IDOCs to SAP

  • Create a one way Send Port and click on the Configure button to edit the SAP-specific properties.

ConfigureButton

  • Click the Configure button again to edit the SAP URI. Much like our IDOC configuration for receiving the IDOC, we want to populate the following values:
    • Application Server Host
    • System Number
    • Client

Transport

Click the OK button to close this dialog

  •  SOAP Action Header’s Action  – provide the operation name and Action value

<BtsActionMapping xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;

<Operation Name=”Orders05″ Action=”http://Microsoft.LobServices.Sap/2007/03/Idoc/3/ORDERS05/ZORDERS05/740/Send&#8221; />

</BtsActionMapping>

 

category

  • In the Binding tab:
      1. EnableBizTalkCompatibilityMode—This value should always be set to True when calling SAP operations from BizTalk.
      2. EnableSafeTyping—Since not all .NET and SAP types are created equally, we occasionally need to set the value true for this property to handle some constraints around dates. For example, refer this. By default this value is false.

sapBinding

  • On the Credentials tab, we need to provide our SAP credentials. In this scenario, we are using Username/Password credentials.

sapCredential

In order to start the application, we must bind our orchestration to the Physical Receive and Send ports that you have created.

In next post I will discuss about custom IDOCs and RFCs / BAPIs.

Resource:

Microsoft BizTalk 2010: Line of Business Systems Integration

http://www.integrationusergroup.com/hybrid-integration-with-sap/

Related links:

https://gautambiztalkblog.com/2016/01/11/consuming-idocs-from-sap-using-biztalk-serverpart-1/

Advertisements

One thought on “Consuming IDOCs from SAP using BizTalk Server – Part 2

  1. I need to send few order IDs and receive purchase orders from SAP R3 4.6 for only those order IDs.
    More over I just need few basic info as response from SAP may be just 3-4 fields of data for each order ID. How should I achieve that? Thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s