java 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).

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.

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.

Lanzelot

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.

来源:https://stackoverflow.com/questions/20034323/parsing-an-idoc-in-xml-format-using-sap-java-idoc-class-library

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值