Parsing an IDoc in XML format using SAP Java IDoc Class Library
Asked Answered
B

2

7

In a system not connected with SAP I am receiving an IDoc in XML format (if of any importance a Customer Master - DEBMAS07).

1. Is it possible to read this XML document using the Java IDoc Class Library (sapidoc3.jar) WITHOUT a connection to the SAP system?

2. Is it possible to generate an IDoc in XML format using Java IDoc Class Library (sapidoc3.jar) WITHOUT a connection to the SAP system?

I haven't found any clear examples on how to do this, how to work this this clases, and the examples I've found are using classes that require a connection to SAP.

Baldwin answered 17/11, 2013 at 18:11 Comment(5)
see SAP connection is required for that with out connection you can not read that.Representative
If you can post a complete answer, explaining everything, I can award you the bounty.Baldwin
with out SAP connection is not possibleRepresentative
Just for curiosity, if you are not connected to SAP, why do you need their class? Why not read the XML with something else?Martinson
To parse and create IDocsBaldwin
C
8

Without the respective IDoc meta data you cannot interpret the XML data as an SAP IDoc. Without having this IDoc meta data, the IDoc-XML document is just some hierarchically structured bunch of strings.

And the only way for the SAP Java IDoc Class Library to get the IDoc meta data is to query it from some SAP System - at least this is valid for the current version 3.0.12 of the JIDocLib. So the answer to both of your questions is unfortunately: NO.

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

Campuzano answered 26/12, 2016 at 22:48 Comment(0)
S
1

Perhaps you want to take a look at the SAP Business Connector: it can create IDocDocument objects from IDoc-XML without having a connection to an SAP system. You can then work with these IDoc objects in Java. The metadata information (field-offset and -length for each segment in the IDoc) is only needed at the point, where you actually want to send the IDoc into an SAP system. But as apparently you don't need to do this, you should be fine without metadata information.

SAP BC Homepage: https://support.sap.com/sbc

Subhuman answered 4/3, 2018 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.