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:


<doctyp/> → empty from IDOC SAP → only a end tag


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



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.