Empty values from Idoc not generate end tag in xml doc

Hi all,

I send idocs from SAP to SAP BC. I use encode service to transform idoc values to xml format, then i write a xml file.

The problem is as follows: when a value in idoc structure is empty, the corresponding end tag does not appear in idoc-xml generated by SAP BC. This not happen with fields from default segment control. Sample:

<?xml>

<zmcnidoc_o1>
<idoc>
<edi_dc40>
<tabnam>EDI_DC40</tabnam>
<mandt>100</mandt>
<docnum>0000000000221031</docnum>
<docrel>46C</docrel>
<status>30</status>
<doctyp/> –> empty from IDOC SAP –> only a end tag
<direct>1</direct>



<zmcn_poline>
<poli_dati_date>20040110</poli_dati_date>
<poli_dati_time>000000</poli_dati_time>
<poli_dati_tizo>0</poli_dati_tizo>
</zmcn_poline>
<zmcn_poline>
<poli_dati_date>20040112</poli_dati_date>
<poli_dati_tizo>0</poli_dati_tizo>
</zmcn_poline>

In 2° position, POLI_DATI_TIME field is empty from SAP, so, is eliminated from idoc-xml…not <poli_dati_time/> end tag, like field <doctyp/> in segment control.

I hope you can help me.

Thanks in advance

Ralph

Ralph,

Also try using these services for IDOC parsing and making xml file.

transformFlatToHierarchy(fill conformsTo with IDOC structure documentname)returns output boundNode and map this to
recordToDocument(and set generateRequiredTags to true)this setting will let keep the tags.

HTH,
RMG