Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XML format of IDOC

former_member239066
Participant
0 Kudos
18,330

Hi Experts,

I would like to download the XML format of an IDOC.  For example, I would like to have something like this with all the fields of the IDOC:

<?xml version="1.0" encoding="UTF-8"?>

<ZORDERS01 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Schemas/zorders01.xsd">

<IDOC BEGIN="1">

  <EDI_DC40 SEGMENT="1">

    <TABNAM>EDI_DC40</TABNAM>

    <DOCNUM>0000000000004711</DOCNUM>

    <DIRECT>1</DIRECT>

    <IDOCTYP>ORDERS01</IDOCTYP>

    <CIMTYP></CIMTYP>

    <SNDPOR>SAPP01</SNDPOR>

    <SNDPRT>LS</SNDPRT>

    <SNDPRN>aaaaaaaaaa</SNDPRN>

    <RCVPOR>aaaaaaaaaa</RCVPOR>

    <RCVPRN>aaaaaaaaaa</RCVPRN>

  </EDI_DC40>

  <E1EDK01 SEGMENT="1">

    <BSART>ZOPE</BSART>

    <LIFSK>03</LIFSK>

  </E1EDK01>

  <E1EDK14 SEGMENT="1">

    <QUALF>006</QUALF>

    <ORGID>20</ORGID>

Is there any transaction that enables to download the structure of an IDOC in this format?

Thanks,

Vitish.

8 REPLIES 8
Read only

Former Member
0 Kudos
6,258

Hi Vitish,

Please use the procedure mentioned below, which may help you what you intend to

- Input t-code IDOC

- In selection screen, select 'Analyse IDOC field values

- Press F8

- Input your IDOC number

- Check mark on 'Also evaluate empty fields

- Click on 'Output in internal form' : this is very much important thing

- The execute

- You will see all the data

- Then go to 'List'>Save/send option from where you can achieve your purpose.

Please validate the same at your end, let me know in case you need any further inputs from my end.

BR/Thanks

Pranav Agrawal

Read only

0 Kudos
6,258

Hi pranav,

Thanks for your reply.  But i am not getting the output i wanted.  Below is teh output i get when i follow your suggestions:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

|Seg.type                   |Qualified segment ID|                              |                                                            |                                                                                                                                    |

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

|Segm.Name                  |Q                   |Fld Name                      |Description                                                 |Fld Cont.                                                                                                                           |

|EDIDC                      |                    |MANDT                         |Client                                                      |390                                                                                                                                 |

|EDIDC                      |                    |DOCNUM                        |IDoc number                                                 |0000000000213061                                                                                                                    |

|EDIDC                      |                    |DOCREL                        |SAP Release for IDoc                                        |731                                                                                                                                 |

|EDIDC                      |                    |STATUS                        |Status of IDoc                                              |53                                                                                                                                  |

|EDIDC                      |                    |DOCTYP                        |IDoc Type                                                   |                                                                                                                                    |

|EDIDC                      |                    |DIRECT                        |Direction for IDoc                                          |2                                                                                                                                   |

|EDIDC                      |                    |RCVPOR                        |Receiver port (SAP System, EDI subsystem)                   |SAPD51                                                                                                                              |

|EDIDC                      |                    |RCVPRT                        |Partner Type of Receiver                                    |LS                                                                                                                                  |

|EDIDC                      |                    |RCVPRN                        |Partner Number of Receiver                                  |D51TDEX310   

but this is not what i want.

I would like output like this:

<?xml version="1.0" encoding="UTF-8"?>

<ZORDERS01 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Schemas/zorders01.xsd">

<IDOC BEGIN="1">

  <EDI_DC40 SEGMENT="1">

    <TABNAM>EDI_DC40</TABNAM>

    <DOCNUM>0000000000004711</DOCNUM>

    <DIRECT>1</DIRECT>

    <IDOCTYP>ORDERS01</IDOCTYP>

    <CIMTYP></CIMTYP>

    <SNDPOR>SAPP01</SNDPOR>

    <SNDPRT>LS</SNDPRT>

    <SNDPRN>aaaaaaaaaa</SNDPRN>

    <RCVPOR>aaaaaaaaaa</RCVPOR>

    <RCVPRN>aaaaaaaaaa</RCVPRN>

  </EDI_DC40>

  <E1EDK01 SEGMENT="1">

    <BSART>ZOPE</BSART>

    <LIFSK>03</LIFSK>

  </E1EDK01>

  <E1EDK14 SEGMENT="1">

    <QUALF>006</QUALF>

    <ORGID>20</ORGID>

Read only

mohd_riyajuddin
Participant
0 Kudos
6,258

Hi Vitish.

For this

T-Code-> IDOC

Click on analyse field values Radio button

F8

Give IDOC no.

Click on push button "Output In Internal Form"

F8

then click on menu button

List->Export->Local File

Choose radio button "XML'

then give ur desired location ur file is downloaded

Read only

mohd_riyajuddin
Participant
0 Kudos
6,258

This message was moderated.

Read only

former_member215575
Active Participant
6,258

Hi Vitish,

Use function module 'OUT_IDOC_XML_TRANSFORM' to download IDoc in XML format. IDoc number and file path to be provided as input.

Regards,

SG

Read only

0 Kudos
6,258

This is a perfect answer. This worked for my scenerio.

Read only

mohd_riyajuddin
Participant
Read only

0 Kudos
6,258

Thanks for sharing this link. Very usefuel.