A few weeks ago I had to create a flow that receives messages from SAP with a specific IDoc release number. The SAP system was a 620 release and the IDoc was 46C release.
So to start with, I generated the schema for the 46C release and deployed that on my BizTalk box.

When we sent an IDoc to BizTalk, we got following error :

The segment or group definition E2EDP01006 was not found in the IDoc metadata. The UniqueId of the IDoc type is: IDOCTYP/3/ORDERS05//620. For Receive operations, the SAP adapter does not support unreleased segments.

So this message stated that SAP was sending a 620 IDoc. After a discussion with an SAP developer, we found out that the DOCREL field in the EDI_DC40 header had the value 620 while we where expecting to receive 46C.

The way that the new SAP adapter works in BizTalk is that when he receives an IDoc from SAP, he will check all the segments that are sent to see if it is a valid IDoc. Since the segment E2EDP01006 is not present in IDoc release 620, this is a normal error. This validation occurs in the adapter, so even before the message reaches BizTalk. So even if you have the correct schema deployed (like in my case) you will still get the error.

While searching for a solution we found 3 ways to solve this.

1.  Always use the latest IDoc release

This is the most obvious one off course. Just ask an SAP developer to send the latest release of the IDoc to BizTalk and you will be able to receive it. (The latest release will be the same as the system release)

This is also the option we choose at the time. It was the fastest solution we could both support.
But we still spent a little bit time to investigate the other options.

2.    Receive “untyped” flat file IDocs.

This means that you need to generate the flat file schemas for the IDoc instead of the typed xml schema. You have to make sure that you set the GenerateFlatfileCompatibleIdocSchema field to true in the “Consume adapter service” window.(If you want to receive multiple IDocs via the same receive port, make sure you install the KB977528 hotfix)

This has the limitation that you need to use the flat file assembler in your receive pipeline. If you want to receive alot of different types of IDocs with the same receive pipeline, you will have to put a flat file disassembler in there for every IDoc type.

 

3.    Change the SAP output module

SAP has 2 ways of exchaning IDocs with other systems.

  1. Application Link Enabling (ALE)

ALE was created to exhange IDocs between SAP R/3 systems and/or R/3 and external systems.

  1. Electronic Data Interchange (EDI)

This interface is used to communicate with non R/3 systems.

Since BizTalk can act as an R/3 system, the standard way we received IDocs was via ALE. But when you use ALE, the DOCREL field will always contain the system release number.So if you use ALE as the output module, you can only receive the latest IDoc release know inside the system.The EDI interface works in a different way, that makes sure that the DOCREL field is filled in correctly. Since we already chose to go for the first solution, we did not test this at runtime.
But The SAP developer told us that this should do the trick as well.

Tim D’haeyer, CODit