3

We are currently planning on communicating with a partner that is running SAP. The problem is that our ERP offers no way of communicating with SAP and we will need to extract the necessary info out of the IDOC files ourselves.

Is there an easy way of doing this in .NET? Like a library (free/commercial) that does all the grunt work?

I'm just looking for something like 'IDocLibrary.Parse(file)' and it'll return me a collection of objects that translate directly to the orders etc in the IDOC file.

I did read about some sort of SAP .NET Connector. Is this capable of doing what I want it to do?

edit:

SAP .NET Connector is no option it seems. According to http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/

In particular, there is no functionality built-in to the SAP .Net Connector for parsing the various data fields from an IDOC. It is up to the receiving program to know what the format of the IDOC is, and how to extract the data from the IDOC.

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
SpoBo
  • 2,100
  • 2
  • 20
  • 28
  • Will this be a one-time conversion or a regular communication? How much influence do you have on the message format? There is a way of sending the IDocs in an XML format via http that may be easier to handle in .NET. – Thorsten Dec 04 '09 at 13:27
  • Hi, Can you please lead me to a reference on "sending the IDocs in an XML format" ? I have been finding one but not sure that im referring to the correct source... thanks bb – Illuminati Jun 29 '10 at 09:27
  • Well I got the documentation from our partner that described what lines contain what info and then manually made the mapping. Not easy but it worked. Can't give you the code sorry :) I based the mapping on a file that was generated by SAP for as far as I know. But there are companies like babelway.com who can do the translation for you. All you have to do is map the values to a format you understand. But we were too far along in the process to switch to this. Perhaps for a future version :) – SpoBo Jul 06 '10 at 07:11

5 Answers5

3

I would suggest trying the SAP web site, SAP .NET Connector:

The SAP .NET Connector is a development environment that enables communication between the Microsoft. NET platform and SAP systems. This connector supports RFCs and Web services, and allows you to write different applications such as Web form, Windows form, or console applications in the Microsoft Visual Studio.Net. With the SAP .NET Connector, you can use all common programming languages, such as Visual Basic. NET, C#, or Managed C++.

Features Using the SAP .NET Connector and SAP .NET Proxy Wizard, you can:

· Write .NET Windows and Web form applications that have access to SAP business objects (BAPIs).

· Develop client applications for the SAP Server. Here you can use either RFCs or HTTP/SOAP/XML (outside-in).

· Write RFC server applications that run in a .NET environment and can be installed starting from the SAP system (inside-out).

IDoc Receiver as a Windows Service

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541
  • 1
    Thx for this but I can't really see how it would work like I want it to work. This would seem useful if you are actually running SAP and would want to write an application for your own SAP server that needs to factor in the SAP business logic. What I need is a library that can parse the IDOC format and tell me in a humanly readable format what is going on so that I can map it myself to new orders in our system etc. Is this something that SAP .NET Connector can do? We are not interested in RFC, BAPIs, etc. Just the IDOC files generated for us. – SpoBo Dec 02 '09 at 09:25
2

There is a C++ library from SAP that handles IDocs, but it's quite old: Here's a PDF describing it. Not sure if you can still get the software and if that's going to help you today.

Most newer libraries seem to be developed for Java (one example can be found here) .. I guess that won't help you much if you're looking for a .Net solution.

However, as I suggested in my comment to your question, you may be able to get the XI (Exchange Integration) / PI (Process Integration)-infrastructure (which is Java based) to send out the IDocs in an XML format. That should be much easier to handle than "plain text" ...

thegrandchavez
  • 1,730
  • 2
  • 12
  • 20
Thorsten
  • 12,921
  • 17
  • 60
  • 79
  • Interesting. The Java Library looks like something I could realy use. Too bad we don't have a SAP account yet. I could use something like http://www.devx.com/interop/Article/19945 to call the Java from .NET I guess. No possibilityto test this now but it seems like a good way to go. – SpoBo Dec 08 '09 at 07:51
  • You can get a trial SAP system to try out a few things .. look for the IDES system (sometimes included in SAP programming books) or google `ABAP Trial`. I've got a little system running in a VM on my laptop .. helps to be able to play around a bit! – Thorsten Dec 08 '09 at 11:42
0

There is a way of dumping the IDoc type definition (similar to a DTD) from within the SAP system. Then use that as a meta-description of what is sent to you. AFAIK there are different ways to output the definition, HTML, C-Header, maybe even "real" DTD.

Haven't used this in quite a while, but look around where the IDocs types are defined (somewhere in the wedi menu, possibly we30).

The IDocs themselves are pretty much plain text with fixed field lengths, so you have to know where the "boundaries" between the fields/structures are. With the IDoc definitions, this shouldn't be too difficult.

Thorsten
  • 12,921
  • 17
  • 60
  • 79
  • We don't have the SAP running. It's a partner of ours. They provided us with such an HTML file detailing what fields are on what lines and a short discription of it. But basically I'll have to write my own classes to read the IDOC files. With the help of the HTML documentation. There is no library for that :( – SpoBo Dec 04 '09 at 13:18
  • Some of the EAI tools should be able to help you to transform IDocs into a format that is easier to work with. Not sure if that's a real help for you. – Thorsten Dec 04 '09 at 13:36
0

I work for the company, DataXstream, who offers a connector (you reference them in the initial message) to do exactly what you want. Typically our connector is used to integrate a 3rd party application into SAP. I'm not sure that you can assume that the iDOC will contain the information you always want, since most SAP implementations are very customized and unique. Anyway, we'd be happy to help you either leverage the connector as is, or the pieces you are looking for to peform the integration you seek. Just let me know.

Jim

0

For all those who are stumbling upon this old question here:

The most comfortable way to work with IDocs and IDoc-XML, which is offered by SAP at no additional charge, is to use the SAP Java IDoc Class Library add-on for the SAP Java Connector. It can be downloaded from the SAP Java Connector Homepage at https://support.sap.com/jco .

Unfortunately such an IDoc Class Library add-on is missing for the SAP Connector for Microsoft .NET environment - at least there is currently none offered by SAP as far as I know.

Alternatively one may also have a look and consider to use the SAP Business Connector which also offers appropriate APIs for dealing with IDocs and IDoc-XML. Of course, this is an integration platform product for exchanging business data between various systems, and no development library for being included in own Java application projects. But it is also offered free of charge to all SAP customers owning a NetWeaver license.

The prerequisite for all solutions offered by SAP is that you are an SAP customer or partner and own a license for an ABAP system.

Trixx
  • 1,796
  • 1
  • 15
  • 18