使用REST适配器剥离JSON中的标签名称

2020-08-21 16:46发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)你好 我们必须将来自SAP...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


你好

我们必须将来自SAP的多个地址记录发布到第三方REST服务。我们在PO 7.5上。

我们正在使用ABAP PROXY到PI到REST的接口。

我已经使用出现0-n的Address元素创建了数据类型。 已将其分配给消息类型MT_ADDRESS。

REST适配器上的XML至JSON转换已用于将输入XML转换为JSON。

使用此设置,下面的JSON被发送到REST服务。

{" 地址":[

{"代码":" POST1","名称":" Test POS Address 1"," erpId":" POST1"," line1":" Address 1 Line 1"," line2":" Address 1 Line" 2"," city":" City1"," state":" MA"," zip":19501," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

{"代码":" POST2","名称":" Test POS Address 2"," erpId":" POST2"," line1":" Address 2 Line 1"," line2":" Address 2 Line" 2"," city":" City2"," state":" MA"," zip":19502," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

]}

预期格式:

[

{"代码":" POST1","名称":" Test POS Address 1"," erpId":" POST1"," line1":" Address 1 Line 1"," line2":" Address 1 Line" 2"," city":" City1"," state":" MA"," zip":19501," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

{"代码":" POST2","名称":" Test POS Address 2"," erpId":" POST2"," line1":" Address 2 Line 1"," line2":" Address 2 Line" 2"," city":" City2"," state":" MA"," zip":19502," country":" US"," shipTo":true," billTo":true," invoiceTo":true }

]

我的消息类型是MT_ADDRESS,由于设置了"剥离外部元素",该消息类型已经被剥离。

但是我找不到剥离"地址"标签的方法吗?

请帮助?

3条回答
大简至美
2020-08-21 17:21

嗨Soumya,

是的,你是正确的,我不好。 我想您可以应用定制适配器模块。 这是现成的代码,您可以实现它们并替换Message标签。

适配器模块:ReplaceString

此致

Nitin

一周热门 更多>