如何序列化 SAP 业务对象?
首先我必须澄清,我不是指的是最近被 SAP 收购的 Business Objects 公司。相反,我指的是 SAP 业务对象存储库 (BOR) 中定义的业务对象,例如 SalesOrder (BUS2032)。
那么,在 SAP 系统中序列化此类业务对象以便第三方系统可以反序列化该业务对象(包括构成特定业务对象实例的所有属性)的首选方法是什么?
First I have to clarify that I'm not referring to the company Business Objects recently acquired by SAP. Instead I'm referring to business objects as defined in the SAP Business Object Repository (BOR), e.g. SalesOrder (BUS2032).
So what would be the preferred approach to serialize such a business object in the SAP system so that a third party system could deserialize the business object including all attributes that make up a specific business object instance?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
根据这篇文章,您需要使用
IF_SERIALIZABLE_OBJECT
接口。我猜您的业务对象尚未实现该接口,因此您可能必须将其扩展为自定义业务对象并在那里实现 IF_SERIALIZABLE_OBJECT 接口。According to this article you need to use the
IF_SERIALIZABLE_OBJECT
interface. I'm guessing your business object doesn't already implement that interface so you may have to extend it to a custom business object and implement theIF_SERIALIZABLE_OBJECT
interface there.我会说 IDocs,但我发现您不想使用 SAP 生成的表示。
这意味着您必须使用 ABAP 编写自己的实现。简而言之:
zcl_sales_order
、zcl_sales_order_position
等),您可以使用这些类根据您的需求进行设计call conversion
语句将实例序列化为XML表示(尽管这仍然包含一些SAP特定的格式),或者编写您自己的序列化方法(这可能是您需要的) )I'd say IDocs, but I see you don't want to use the SAP generated representations.
Which means you'll have to write your own implementation using ABAP. In a nutshell:
zcl_sales_order
,zcl_sales_order_position
, etc.), which you design according to your needscall transformation
statement (though this will still contain some SAP-specific formatting), or write your own serialization method (this is probably what you need)SAP Business Connector 使用 XML 文档来交换 SAP 对象(在 SAP 和非 SAP 系统之间)。也许您可以在本文中找到一些帮助。
The SAP Business Connector uses XML documents to exchange SAP objects (between SAP and non-SAP systems). Maybe you can find some help in this article.
我不知道序列化 BOR 对象的简单方法。然而,在许多情况下,SAP 提供了 BAPI,它们是远程启用功能模块,可以通过各种 SAP 连接器或 SOAP 等进行调用。
以 BUS2032 为例:
调用函数' BAPI
您会发现各种 BAPI - 在本例中,它们都属于功能组 2032,可以通过事务 SE80 访问。
请注意,SAP 的命名标准并不总是如此,但模块越成熟,功能就越好。他们可能已经为该模块提供了某种形式的 RFC 或 Web 服务。
当然你也可以编写自己的RFC或Web服务,但是接下来你需要了解业务模型以及需要哪些属性。
I don't know of a simple way to serialize BOR objects. However in many cases SAP have provided BAPI's that are Remote Enabled Function modules that can be called via the various SAP connectors or SOAP etc.
Taking BUS2032 as an example:
call function 'BAPI
You will find various BAPI's - in this case they all belong to function group 2032 that can be accessed via transaction SE80
Note that SAP is not always this accomodating in their naming standards, but the more mature the module the better the chance that they've already made some form of RFC or Webservice available for the module.
Of course you can also write your own RFC or webservice, but then you need to understand the business model and which attributes are needed.