‎2011 Oct 10 1:01 PM
I use cl_xml_document with
call method o_xml->create_with_data( dataobject = data_tab ).to generate an xml document.
data tab is being created on basis of a deep structure. Whenever a deep structure is empty the resulting node is being neglected and won't show op in the xml document.
I do want the node to show up, any idea?
Up!
Edited by: axeleration on Oct 11, 2011 9:39 AM
‎2011 Oct 11 10:33 AM
Hi,
Put a condition that whenever you encounter a empty deep structure. Fill the node with empty SPACE(s).
try this & let me know if this works for you.
Regards,
Rahul
‎2011 Oct 11 11:48 AM
I've found the solution: instead of create_with_data using set_sata with parameter "control".
* CALL METHOD o_xml->create_with_data( dataobject = <dat> ).
DATA lf_retcode type sy-subrc.
DATA ls_Control TYPE DCXMLSERCL. "OPTIONAL
" don't leave empty parts away:
ls_Control-INIT_TREAT = 'N'.
CALL METHOD o_xml->set_data
EXPORTING
* name = 'DATA'
* alias =
dataobject = gt_Rentob
* parent_node =
control = ls_Control
receiving
retcode = lf_retcode
.
* CALL METHOD o_xml->create_with_data
* EXPORTING
** name = 'DATA'
* dataobject = gt_Rentob
* receiving
* retcode = lf_retcode.
" for testing only:
CALL METHOD o_xml->display
* EXPORTING
* with_bdn = SPACE
.