2009 Sep 09 6:32 AM
Hi ABAPers,
Is there any standard procedure to convert IDOC's to XML format ? If
yes can anyone please help me the procedure or steps how to achieve
this conversion.
Regards
VEnk@
Hi ABAPers,
Is there any standard procedure to convert IDOC's to XML format ? If
yes can anyone please help me the procedure or steps how to achieve
this conversion.
Regards
VEnk@
2009 Sep 09 6:39 AM
2009 Sep 09 6:45 AM
Hi Sripal,
I have already searched in SDN and i have came across the inputs
that are there in the link that was provided by you and it is XML to IDOC
and my requirement in IDOC to XML.
Regards,
VEnk@
2009 Sep 09 6:52 AM
2009 Sep 09 7:01 AM
Ok,
You can use the below FM for this and can pass Idoc data to the tbale IDOC_DATA_40 in the FM
IDX_IDOC_TO_XML
Rgds,
Sripal
2009 Sep 09 7:01 AM
2009 Sep 09 9:21 AM
HI Gautham,
Your answer was helpful.
I am trying to use IDOC_XML_Translate.
Here if you can see the source code of the function module
at the end data is holding by STR and transformed and passed into screen number 100.
But i am trying to download the file so i have created a ZFunModule and in source code
i have used GUI_DOWNLOAD here the problem in STR is string not a table, so how to pass the STR data to Internal table.
Transformation
CALL METHOD idoc->get_xmldata_as_string
IMPORTING
data_string = str.
.
.
CALL SCREEN 100.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\Venkat\venkat.xml'
tables
data_tab = ?
Are you having any solution for this ? If yes please share.
Regards
VEnk@
2009 Sep 09 9:42 AM
Hello Venkat,
You cannot use this FM to display the idoc as XML.
If you see the source code of the FM, there is a select from the table IDOCSTYLE. From this the corresponding XSL transformation details are retrieved.
And i think you did not define the XSLT for the idoc type (or rather message type).
So this FM is of no use in your case.
BR,
Suhas
2009 Sep 09 9:49 AM
Hi Suhas,
Thanks for your information and the problem is solved.
Solved by myself.
Cheers!!
VEnk@
2009 Sep 09 9:55 AM
Hello Venkat,
Can you please share how you solved the problem?
I am curious to know 'coz this will be a very handy tool to display an Idoc as an XML.
Do revert back.
BR,
Suhas
2009 Sep 09 10:04 AM
Hi Suhas,
Basically i have created my custom Function Module.
If you can see the source code of the function module IDOC_XML_TRANSLATE at the end lines after
ENDTRY i have inserted GUi_DOWNLOAD which i have shown in BOLD
you can see. Basically i have used SPLIT keyword to capture my string
values into my inetrnal table.
CATCH cx_xslt_exception INTO gen_ex.
MESSAGE e110(idoc_xml1) WITH local_xslid wa_obj_location-url
RAISING error_loading_object.
EXIT.
ENDTRY.
SPLIT str AT SPACE INTO TABLE t_table.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\venkat.xml'
tables
data_tab = t_table
when you run the XML file will be stored in the file path as given.
I hope this ends the discussion.
Cheers!!
VEnk@
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |