XML parsing of IDocs using the Java Java IDoc class library

On a non-SAP system, I get the IDoc in XML format (if it matters Master Master - DEBMAS07).

1. Is it possible to read this XML document using the Java IDoc class library (sapidoc3.jar) WITHOUT connecting to an SAP system?

2. Is it possible to generate IDocs in XML format using the Java IDoc class library (sapidoc3.jar) WITHOUT connecting to the SAP system?

I did not find clear examples of how to do this, how to do it, and the examples I found use classes that require connecting to SAP.

+6
source share
2 answers

Without the appropriate IDoc metadata, you cannot interpret the XML data as an SAP IDoc. Without this IDoc metadata, an IDoc-XML document is just a hierarchical row structure.

And the only way for the Java Java IDoc class library to get the IDoc metadata is to request it from some SAP system - at least this is true for the current version 3.0.12 of JIDocLib. Thus, the answer to both of your questions, unfortunately: NO .

Of course, you can parse IDoc-XML with a standard XML parser, like any other arbitrary XML document.

+5
source

You might want to take a look at the SAP Business Connector: it can create IDocDocument objects from IDoc-XML without connecting to the SAP system. You can then work with these IDocs in Java. Metadata information (field offset and length for each segment in the IDoc) is required only at the point where you really want to send the IDoc to the SAP system. But apparently you do not need to do this, you should be fine without metadata information.

SAP BC: service.sap.com/sbc-download (This site will go to the SAP support portal soon.)

0
source

Source: https://habr.com/ru/post/958270/


All Articles