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.
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.
- 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.
- If you scroll down, there are few additional properties that are not included in Send Port configurations:
- Gateway Host—Depending upon the configuration of your SAP system, this may be the same value as the Application Server Host.
- Gateway Service—This value generally begins with "sapgw" followed by the System Number.
- 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.
- In the Other tab you need to provide the credential for the authentication.
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.
- 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
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" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Operation Name="Orders05" Action="http://Microsoft.LobServices.Sap/2007/03/Idoc/3/ORDERS05/ZORDERS05/740/Send" />
</BtsActionMapping>
- In the Binding tab:
- EnableBizTalkCompatibilityMode—This value should always be set to True when calling SAP operations from BizTalk.
- 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.
- On the Credentials tab, we need to provide our SAP credentials. In this scenario, we are using Username/Password credentials.
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:
http://www.integrationusergroup.com/hybrid-integration-with-sap/
Related links:
https://gautambiztalkblog.com/2016/01/11/consuming-idocs-from-sap-using-biztalk-serverpart-1/