简体   繁体   English

使用SAP Java IDoc类库解析XML格式的IDoc

[英]Parsing an IDoc in XML format using SAP Java IDoc Class Library

In a system not connected with SAP I am receiving an IDoc in XML format (if of any importance a Customer Master - DEBMAS07). 在没有与SAP连接的系统中,我收到了XML格式的IDoc(如果客户主人有任何重要性 - 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? 1.是否可以使用Java IDoc类库(sapidoc3.jar) 读取此XML文档而无需连接到SAP系统?

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? 2.是否可以使用Java IDoc类库(sapidoc3.jar) 生成XML格式的 IDoc而无需连接到SAP系统?

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. 我没有找到任何关于如何执行此操作的明确示例,如何使用此clases,以及我发现的示例正在使用需要连接到SAP的类。

Without the respective IDoc meta data you cannot interpret the XML data as an SAP IDoc. 如果没有相应的IDoc元数据,则无法将XML数据解释为SAP IDoc。 Without having this IDoc meta data, the IDoc-XML document is just some hierarchically structured bunch of strings. 没有这个IDoc元数据,IDoc-XML文档只是一些分层结构的字符串。

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. SAP Java IDoc类库获取IDoc元数据的唯一方法是从某个SAP系统查询它 - 至少这对JIDocLib的当前版本3.0.12有效。 So the answer to both of your questions is unfortunately: NO . 所以不幸的是,你的两个问题的答案都是: NO

Of course, you can parse the IDoc-XML with a standard XML parser like any other arbitrary XML document. 当然,您可以使用标准XML解析器解析IDoc-XML,就像任何其他任意XML文档一样。

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. 您可能希望查看SAP Business Connector:它可以从IDoc-XML创建IDocDocument对象,而无需连接到SAP系统。 You can then work with these IDoc objects in Java. 然后,您可以使用Java中的这些IDoc对象。 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. 只有在您真正想要将IDoc发送到SAP系统的位置时,才需要元数据信息(字段偏移和IDoc中每个段的长度)。 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 SAP BC主页: https//support.sap.com/sbc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM