2024 Apr 11 8:05 AM - edited 2024 Apr 12 8:40 AM
Hello, I have this flow.
I am receiving the following XML from an RFC Function Module.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rfc:Z_CUSTOMER_BALANCE.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<ET_CUSTOMERS_BALANCE>
<item>
<CUSTOMER>0001000011</CUSTOMER>
<CUSTOMER_NAME>ELIAS KEKAKOS</CUSTOMER_NAME>
<CURRENCY>EUR</CURRENCY>
<BALANCE>39640.8200</BALANCE>
<MESSAGE/>
</item>
</ET_CUSTOMERS_BALANCE>
<E_BALANCE>39640.8200</E_BALANCE>
<E_CURRENCY>EUR</E_CURRENCY>
<E_CUSTNAME>ELIAS KEKAKOS</E_CUSTNAME>
<E_CUSTOMER>0001000011</E_CUSTOMER>
<E_RETURN_MESSAGE/>
</rfc:Z_CUSTOMER_BALANCE.Response>
and the JSON is the below
{
"Z_CUSTOMER_BALANCE.Response": {
"ET_CUSTOMERS_BALANCE": {
"item": {
"CUSTOMER": "0001000011",
"CUSTOMER_NAME": "ELIAS KEKAKOS",
"CURRENCY": "EUR",
"BALANCE": "39640.8200",
"MESSAGE": ""
}
},
"E_BALANCE": "39640.8200",
"E_CURRENCY": "EUR",
"E_CUSTNAME": "ELIAS KEKAKOS",
"E_CUSTOMER": "0001000011",
"E_RETURN_MESSAGE": ""
}
}
I want the Z_CUSTOMER_BALANCE.Response/ET_CUSTOMERS_BALANCE/item to permanently table even if it has 1 record or more. I enabled the Streaming option with the above XML element, but not only the JSON with 1 record in ITEM did not change, but when I have more than 1 it still is not table [ ] as you can see below.
{
"Z_CUSTOMER_BALANCE.Response": {
"ET_CUSTOMERS_BALANCE": {
"item": {
"CUSTOMER": "0001000022",
"CUSTOMER_NAME": "ELIAS KEKAKOS",
"CURRENCY": "EUR",
"BALANCE": "238.6900",
"MESSAGE": ""
},
"item": {
"CUSTOMER": "0001000035",
"CUSTOMER_NAME": "ELIAS KEKAKOS2",
"CURRENCY": "EUR",
"BALANCE": "20639.1000",
"MESSAGE": ""
}
},
"E_BALANCE": "0.0000",
"E_CURRENCY": "",
"E_CUSTNAME": "",
"E_CUSTOMER": "",
"E_RETURN_MESSAGE": ""
}
}
What I am expecting is the below
{
"Z_CUSTOMER_BALANCE.Response": {
"ET_CUSTOMERS_BALANCE": {
"item": [
{
"CUSTOMER": "0001000035",
"CUSTOMER_NAME": "ELIAS KEKAKOS",
"CURRENCY": "EUR",
"BALANCE": "20639.1000",
"MESSAGE": ""
},
{
"CUSTOMER": "0001000041",
"CUSTOMER_NAME": "ELIAS KEKAKOS2",
"CURRENCY": "EUR",
"BALANCE": "1610.1900",
"MESSAGE": ""
}
]
},
"E_BALANCE": "0.0000",
"E_CURRENCY": "",
"E_CUSTNAME": "",
"E_CUSTOMER": "",
"E_RETURN_MESSAGE": ""
}
}
or with 1 record under the ITEM
{
"Z_CUSTOMER_BALANCE.Response": {
"ET_CUSTOMERS_BALANCE": {
"item": [
{
"CUSTOMER": "0001000035",
"CUSTOMER_NAME": "ELIAS KEKAKOS",
"CURRENCY": "EUR",
"BALANCE": "20639.1000",
"MESSAGE": ""
}
]
},
"E_BALANCE": "20639.1000",
"E_CURRENCY": "EUR",
"E_CUSTNAME": "ELIAS KEKAKOS",
"E_CUSTOMER": "0001000035",
"E_RETURN_MESSAGE": ""
}
}
As it does if I select ALL(under Streaming) but it is for every element.
Can someone tell me what is wrong?
Thanks
Elias
Request clarification before answering.
You need to add xmlns:rfc=urn:sap-com:document:sap:rfc:functions to your Namespace Mapping in the Runtime Configuration, and declare the XML element rfc:Z_CUSTOMER_BALANCE.Response/ET_CUSTOMERS_BALANCE/item in your streaming configuration (notice the addition of the namespace prefix). The converter cannot find your specified XML element because in effect it does not exist in your XML payload.
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
8 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.