BizTalk SAP Integration – Part 1 (Overview)

The  BizTalk project I’ve been working on has been pretty interesting (if you like BizTalk ..!).  It involved the following;

SQL Server 2005
BizTalk 2006 R2
SQL and SAP LOB Adapter(WCF)
SQL Server Stored Procedures/Functions
SAP IDOC Processing (SAP v4.6 and 6.4)

So here’s the scenario…

Web App <–data–> SQL Server 2005 <–XML–> BizTalk 2006 R2 <–IDOC–> SAP RFC Queue


There is a web application that creates a quotation.  Each quote line contains either a product BOM or a service BOM.  The Quotation and BOM content is stored in SQL Server Tables. The quotation is changed into an order.  At this point the Order must be passed to the Distribution ERP (SAP) to check if the product required is in stock. Most of the time this is not the case and a request for the product must pass on to a Factory ERP (also SAP)

A diagram speaks a thousand word is my motto (mostly because I hate writing words and Visio is much more fun)

ORDERS05 Inbound Processing

SAP Setup
I’m not a big SAP fan (probably because I haven’t used it much) and have veered well clear of it. These are my tricky bits;

SAP Connection using the WCF SAP Adapter
I found myself dealing with a lot of negativity from the SAP guys. Whenever something didn’t work or we failed to connect it was always a BizTalk Problem.  You get used to it, and it made it more fun to prove them wrong (sometimes…!)

So I made sure I could log onto SAP and check things myself. You will need to ensure the following is setup in SAP.

  • A valid Partner Profile for Biztalk (defines what IDOCs Biztalk can send and receive)
  • An RFC Destination for BizTalk to send IDOCs to from SAP (linked to Partner Profile)
  • A registered Program ID on the RFC Gateway (Biztalk uses this for receiving IDOCs)
  • A SAP service account login for the SAP Adapter to send and receive IDOCs

You can test the comms between SAP and BizTalk by using the Test RFC connection function in SAP(will get the transaction ID later). Remember that this will only work if you have the above setup and have also setup a valid receive location in BIztalk with the correct URI. (See following blogs for specifics on this)

The IDOCs I worked with were…

  • MATMAS04/05
  • DEBMAS05/06
  • CHRMAS04

These need to be added to the partner profile and can be for both inbound and outbound from SAP if needed. There is additional setup required in SAP to automatically send IDOCs to a particular partner. For example, and Order Response may not automatically be sent back to the BizTalk partner proflile when the Order sent by BizTalk is confirmed. The ORDRSP must be specifically pointed to the correct partner profile. Speak to the SAP guys about this bit as they will know exactly how their version is configured.

Part 2 will cover the initial setup of the BizTalk Project and SAP schema download.


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s