cancel
Showing results for 
Search instead for 
Did you mean: 

Purchase Order IDOC to XML (Outbound)

Former Member
0 Kudos

Hi Guys,

I did some search but cannot find the answer to my question. Is there any way to send out an XML file using an IDOC in version 4.6C? Basically I am creating a Purchase Order IDOC and my external system wants an XML file format. Can I accomplish this without using a middleware?

Your help would be greatly appreciated.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

ferry_lianto
Active Contributor
0 Kudos

Hi LeGo,

You do not need middleware to generate IDoc in XML format. You can do via <b>File Port (WE21)</b>.

Please check this weblog which will show you step by step on how to setup.

/people/suraj.sr/blog/2005/12/29/generate-test-case-for-an-idoc-scenario

Hope this will help.

Regards,

Ferry Lianto

Answers (3)

Answers (3)

ferry_lianto
Active Contributor
0 Kudos

Did you edit/change control record in WE19? Perhaps it still pointed to the old receiver system port.

Former Member
0 Kudos

Hi Ferry,

I have changed the control record to point to my XML port and I was able to generate an IDOC with status 03.

Former Member
0 Kudos

Oh by the way guys, I saw that Ferry's link is pointing to a blog related to XI. I am using 4.6C, is it still possible?

There is data in all the segments and I checked the file using transaction AL11 since I don't have UNIX access yet.

Below is what I can see in AL11 Tcode.

<?xml version = "1.0"?><_AFS-ORDERS05><IDOC BEGIN="1"><EDI_DC40 SEGMENT="1"><TABNAM><![CDATA[EDI_DC40]]></TABNAM><MANDT>501</MANDT><DOCNUM>0000000000293418</DOCNUM><DOCREL>46C</DOCREL><STATUS>30</STATUS><DIRECT>1</DIRECT><OUTMOD>2</OUTMOD><IDOCTYP><![CDAT

I have more data than this but I cannot see it.

Former Member
0 Kudos

LeGo,

Although the blog talks about XI the entire config is done on the R/3 side, don't worry about that.

So, if you are unable to see the data, get the file to your desktop using <b> transaction code </b> CG3Y and then see the data.

Regards,

Ravi

Message was edited by: Ravikumar Allampallam

Former Member
0 Kudos

Hi Guys,

Thanks a lot. I used FM IDOC_XML_DISPLAY to display the XML file and was able to see it successfully. I really appreciate all your help.

Best regards,

LeGo

ferry_lianto
Active Contributor
0 Kudos

Hi LeGo,

Chcek in WE02, does IDoc contain data record? If it does, perhaps the file contains a long string with no wrap around. If it does not then it explains.

Please check my previous links perhaps there is something missing step when you setup.

Former Member
0 Kudos

LeGo,

Yes you can do this. The port you are going to use for this will have to be defined as a XML file port. You can do this in WE21. Once you define the port, use that in the configuration of the PARTNER PROFILES and it will write the IDOC in a file in XML format.

Regards,

Ravi

note : Please mark the helpful answers

Former Member
0 Kudos

Hi Ravi,

Thanks for your quick reply. I would try this out and will let you know of the results.

Thanks again!

LeGo

Former Member
0 Kudos

Hi Guys,

Thanks for your answers. I was able to generate a file by configuring an XML port. But it seems that only the control record information was captured in the XML file. I cannot see the other data from the IDOC. Any idea on this?

Thanks!

LeGo

Former Member
0 Kudos

LeGo,

You should get the entire set of DATA RECORDS in the output file.

Let me know what are the settings you have done.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

Here's what I did. I created a port in WE21 under XML named XML_Test. I selected the physical directory radio button and put \temp\ as the value. I chose function module EDI_PATH_CREATE_MESTYP_DOCNUM.

Then I used my old outbound IDOC in WE19, put my XML port (XML_Test) as the recipient in the control record and clicked on the standard outbound processing button. An IDOC and a file were created but when I looked at transaction AL11, I only saw one line on the file.

Any ideas?

Thanks!

LeGo

Former Member
0 Kudos

LeGo,

Did you put the data in all the segments?

Only thos fields will be written in which the data is passed. The blank fields / segments will be ignored.

Regards,

Ravi

Former Member
0 Kudos

Hi Ravi,

Yes I did. I used an existing IDOC which I have previously generated from my output type. So the data segments are all populated with header and line item data.

Former Member
0 Kudos

LeGo,

If you done the settings (as in the blog pointed by Ferry), I can't see a place why you can't see the data.

Just check if the WORD WRAP is on also check in WE02 and veify the data in all the segments.

Regards,

Ravi