Showing posts with label SAP .NET connector. Show all posts
Showing posts with label SAP .NET connector. Show all posts

Tuesday, January 20, 2009

How does the SAP adapter retrieve the list of IDocs?

At a customer, we had the problem that the SAP adapter (building on SAP .net Connector v1.0.2) didn't retrieve the IDoc that we wanted to call:


To analyse how the SAP adapter retrieves this list of IDocs, we traced the RFC communication between SAP and BizTalk (transaction ST05*) and found out that the SAP .net Connector uses the BAPIs RFC_SYSTEM_INFO and IDOCTYPES_FOR_MESTYPE_READ to get a list of IDocs which are released:


Using transaction SE37, we (thanks, Rüdiger!) could analyse the BAPI IDOCTYPES_FOR_MESTYPE_READ and see that it uses the table EDIMSG to get the IDocs. And their we saw that the BAPI doesn't call for "message types" instead of "basic types". And, guess what, the message type had a different name then the basic type (which makes perfectly sense) and, thus, couldn't be found.

* Tipp: When logging to SAP to trace, you have to use the same user that you use inside the Send Port / Receive Location.

Monday, January 19, 2009

How to solve Problems when accessing an IDoc with the SAP Adapter

If you can't see an IDoc when you try to create a schema in Visual Studio using the SAP adapter (building on SAP .net connector 1.0.2), the problem is usually that the IDocs hasn't been published ("freigegeben"). You can check this here:

we60 - Check whether your IDoc is known in a specific SAP Release (we often had the problem that segments of an IDoc weren't known in a release)

we30 - You can check here whether all segements are published. Click on the segment, then "segment editor". There's a checkbox whether this segment is published.

we20 - If you can access the IDoc but can't send data to it, the IDoc might miss a partner agreement ("Partnervereinbarung").

Thursday, February 21, 2008

EDI: Table passed to EDI_SEGMENTS_ADD_BLOCK is empty.

The error "EDI: Table passed to EDI_SEGMENTS_ADD_BLOCK is empty"* was thrown by the SAP .NET connector after sending an IDoc to SAP. The reason was that we've set data fields inside the EDI_DC40 element that SAP had to fill on its own, such as
  • DOCNUM
  • CREDAT
  • CRETIM
  • RCVPOR
  • SNDPOR
  • DOCNUM from the DATAHEADERREC element
Now, we are leaving these empty, and the IDoc can be received by SAP.

Thus, if you get the same error, check which fields you should set, and which SAP should set on its own.

----------
* in German SAP systems: "EDI: Die an EDI_SEGMENTS_ADD_BLOCK übergebene Tabelle ist leer"