0% found this document useful (0 votes)
5 views

How to save IDOC as an XML.pdf

IDoc is a standard data structure in SAP for data transfer between SAP and external systems, facilitating electronic data interchange. XML is a shareable data format that allows easy information exchange between various systems. The document explains how to export IDoc data as XML in SAP, noting that the resulting XML may require formatting corrections before use.

Uploaded by

ranjitkapase07
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

How to save IDOC as an XML.pdf

IDoc is a standard data structure in SAP for data transfer between SAP and external systems, facilitating electronic data interchange. XML is a shareable data format that allows easy information exchange between various systems. The document explains how to export IDoc data as XML in SAP, noting that the resulting XML may require formatting corrections before use.

Uploaded by

ranjitkapase07
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

What is an IDOC?

IDoc (intermediate document) is a standard data structure used


in SAP applications to transfer data to and from SAP system applications
and external systems. Using IDocs, companies with SAP ERP systems, for
example, can exchange data with external entities like their partners or
customers.

The transfer between SAP systems is done through SAP's Application Link
Enabling (ALE) system, while the transfer from an SAP system to an
external system happens through electronic data interchange (EDI). This
allows data to be exchanged between the different systems without
converting data from one format to another.

What is an XML?
Extensible Markup Language (XML) lets you define and store data in a
shareable manner. XML supports information exchange between computer
systems such as websites, databases, and third-party applications. Predefined
rules make it easy to transmit data as XML files over any network because the
recipient can use those rules to read the data accurately and efficiently.

Sudheerbabu1358@gmail.com Ph: 8500420368


IDocs in SAP
IDocs are the central import and export format of SAP ERP systems. They
can therefore be used for data exchange with other software systems, e.g.
when transferring customer data from a CRM system. IDocs are also
particularly relevant in electronic data interchange (EDI) with external
suppliers and customers. Further, much like saving an IDoc to your hard
drive, deleting an IDoc, or reprocessing an IDoc, exporting an IDoc as an XML
isn’t too difficult.

No matter which application scenario, you will often encounter the issue
where you will need a specific IDoc as an XML file on your local hard drive.
Repeatedly exporting files through a partner profile configured in
transaction WE20 is ill advised due to uncontrolled side effects, e.g.
repeating DESADV dispatches to clients.

The XML file is thus the best way forward, as it has many advantages and
can for example be used to debug incorrect behaviour in software
downstream from SAP. There are various functions available for exporting
IDoc data in SAP. In a previous article we explained how to export IDoc
data in Excel format. SAP also offers functions for exporting an IDoc as an
XML file however.

In the following section, we will present you with an approach where it is


not required to use your own ABAP code. With this approach, you will not
have to create an ABAP code or transport it on a P-level. This method is
also well suited for debugging on a P-system, under the condition that the
user has the needed permissions for transaction SE37.

Export an IDoc as an XML


To export an IDoc as an XML, you will first need to open transaction SE37.

Sudheerbabu1358@gmail.com Ph: 8500420368


Transaction SE37 in SAP

Enter the element IDOC_XML_TRANSFORM in the function block and


execute it by clicking on F8. As you can see on the picture below, the IDoc
is now shown as an XML data.

Enter the IDoc number

Sudheerbabu1358@gmail.com Ph: 8500420368


Now enter the IDoc number that is to be exported in the DOCNUM field.
Before the value can be entered, the zeros must be removed. Then
execute the transaction with F8. The IDoc is now displayed as an XML file,
as shown in the following image:

XML Representation of the IDOC

Pressing ctrl+A, ctrl+C or ctrl+V will allow you to view the XML content with
any editor.

As shown in the screenshot, the generated XML file has a small flaw: the
opening angle brackets (< und </) of the elements are followed by spaces,
and the closing angle brackets (>) have spaces before them. This means
that this XML is not formatted properly.

Sudheerbabu1358@gmail.com Ph: 8500420368


To correct this, you can copy the XML data into an editor (Notepad++ e.g.)
and search and replace the spaces around the angle brackets.

Summary
By using the method, you will be able to quickly and easily export IDoc data
as XML files from an SAP system. The only disadvantage is that the
resulting XML file is not valid and needs to be corrected with an editor,
before it can be transmitted to further applications.

Sudheerbabu1358@gmail.com Ph: 8500420368

You might also like