‎2016 Mar 18 11:48 AM
Is there any way to configure or enhance "XML File" IDOC port output logic?
Goal is to generate XML tags for all IDOC fields, even those with empty value. But by default empty fields are skipped in result XML.
Example:
IDOC raw data:
SEGMENT1-ABC is initial empty
SEGMENT1-WERKS = "XY01"
XML now:
<segment1 SEGMENT="1">
<werks>XY01</werks>
</segment1>
XML needed:
<segment1 SEGMENT="1">
<abc></abc>
<werks>XY01</werks>
</segment1>
‎2016 Mar 18 12:50 PM
I think I have just found "XML File" port output standard function:
IDOCS_OUTPUT_IN_XML_FORMAT
and inside it there is fixed check that field cannot have empty value
For non-unicode XML processing in include LEDI7F04 - SEND_DATA_RECORDS, row 1547:
LOOP AT int_dfies.
ASSIGN i_edidd-sdata+offset(int_dfies-leng) TO <feld> TYPE int_dfies-inttype.
string = <feld>.
...
CHECK NOT string IS INITIAL.
* <fieldname>string</fieldname>
and for unicode XML its same, just in LEDI7F05 - DATA_RECORDS_XML, row 778.
No customization available for this.
‎2016 Mar 18 4:03 PM
Are you sure that a segment is even added in this case? We had some bad experience with the price segments - in case of 0 price the segment was not even added and XML was missing price altogether (and the recipient needed 0 there). But we added some code in a user exit to force the segment addition with 0 value and it worked fine. It might be more difficult with alpha values (0 makes a non-empty string), but maybe using some value like "N/A" instead of blank would be an option?
You might want to open an incident with SAP though. We were told to take a hike, but maybe if more customers complain ("null" <> initial after all) someone will get a clue?
‎2016 Mar 21 7:30 AM
Thank you for your reply.
In this case we have only problem with empty values <value></value> which are skipped in XML, but recipient wants to get empty tags.
I checked few IDOCs and "initial" / zero number values are transfered to IDOC and XML:
<QUANTITY>0</QUANTITY>, <PRICE>0.000000</PRICE>.
Is there a chance you can find what user exit was that?
‎2016 Mar 21 3:27 PM
There is no "general IDoc" user exit, they are specific to the type, so ours won't help you most likely. Usually they can be easily found using Google: "<message type> user exit".
‎2016 Mar 22 7:38 AM
It does not solve exactly this problem. But we helped recipient with XML data mapping by providing XSD schema. It can be generated in WE60 -> XML schema.