4 minute read

How to Delete an IDoc in an SAP ERP System

Working with IDocs

An IDoc (Intermediate Document) is the central import and export format of an SAP ERP system. By using IDocs, you can export and import any type of data from an SAP system. In addition to the pre-defined IDoc formats, such as ORDERS, ORDRSP, DESADV, etc, you can also define your own IDoc formats.

In the SAP system, transaction BD87 is a useful tool for the administration of IDocs (see here for our article on IDoc processing SAP ERP with transaction BD87). Ideally, all IDocs have a green or yellow status in transaction BD87.

The following screenshot shows transaction BD87 in a test system. As you can see, some IDocs are in an error status. The status below would not be acceptable in a production system, as it would mean that important data would potentially not leave the system or were not received by it.


Transaction BD87 with Faulty IDocs
Transaction BD87 with Faulty IDocs

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

There are two options to correct the red status in a production system. Either the IDoc can be edited and processed again, or the faulty IDoc can be deleted and the data regenerated. For outbound IDocs this means that the generating process in SAP needs to be started again (e.g., retriggering of DESADV IDoc generation using new LALE message entry). However, for inbound documents, this means that the data needs to be sent to the SAP system again, e.g., from the EDI system.

But first you want to delete the old IDoc, to keep a clean transaction BD87.

White Paper - EDI Integration in SAP

Deleting IDocs

There are two options to delete an IDoc.

The first option is to change the IDoc status, e.g. reset it to status 31 (error, no more processing) or to status 38 (IDoc archived). The IDoc is not physically deleted, but the status is reset, so that the IDoc does not stay in a defective status in transaction BD87.

The other option is to physically delete the IDoc. SAP provides transaction WE11 for this purpose, as shown in the Figure below.


Transaction WE11 to Delete IDocs
Transaction WE11 to Delete IDocs

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Similar to transaction BD87, you can select IDocs using several different parameters. Just as with transaction BD87, it is highly recommended to use extreme caution when using transaction WE11, as you could accidentally delete many IDocs. Fortunately, after clicking on execute (alternatively pressing F8), transaction WE11 will issue a confirmation prompt, as shown in the following screenshot.


Confirmation Prompt in Transaction WE11 when Deleting IDocs
Confirmation Prompt in Transaction WE11 when Deleting IDocs

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

If you are not sure, you can alternatively start a test run instead of deleting. In this case, the deletion is only simulated, and you can see how many IDocs would be deleted. Since deleting is a potentially irreversible action, one should be very careful about what exactly is selected for deletion.

After the deletion, an overview of the deleted artifacts will be displayed.


Transaction WE11 Results
Transaction WE11 Results

© 2020. SAP SE or an SAP affiliate company. All rights reserved. Used with permission of SAP SE.

Which of the two methods is used to delete an IDoc depends primarily on the compliance rules of the respective company. For example, transaction WE11 may be deactivated in the production system because, for audit reasons, you want to prevent something from being removed from SAP. Furthermore, access to transaction WE11 may only be possible for a small group of users (e.g., EDI administrators), as one would like to prevent the business units from accidentally cleaning up the system.

Any questions about IDocs or SAP?

You still have questions about SAP, IDocs or EDI? Please contact us or use our chat — we’re more than happy to help!

You may also find the following articles helpful:

 

SAP ERP and SAP S/4HANA are the trademarks or registered trademarks of SAP SE or its affiliates in Germany and in several other countries.

Subjects

most read

Keep on reading

3 minute read

How to create an SAP transaction code

Want to know how to create an SAP transaction code for an existing ABAP program so that you can easily call the program?

6 minute read

How to Set Up and Manage Automatic SAP Jobs

SAP jobs can be used to automate processes in SAP ERP so they can be carried out without user intervention. We explore the key features.

4 minute read

IDoc Status Change in SAP ERP

IDoc statuses are not always the clearest - particularly when errors occur. In this article we explain how to change IDoc status as required.

5 minute read

How Can I Add an Entry to an SAP Table?

In this article we show how to add entries to an existing SAP table - even if it does not have its own maintenance dialog.

5 minute read

Alternatives to the Seeburger PI Adapter

The end of maintenance for the Seeburger PI Adapter is imminent. What alternatives are there and which is the best suited for your business?

4 minute read

IDocs in SAP S/4HANA: The Differences to SAP ECC 6.0

The change to S/4HANA also impacts the format of IDocs. In this article we explore IDocs in S/4HANA and the new and changed elements.

11 minute read

Migration to SAP S/4HANA - 5 Key Considerations

Are you prepared for migration to SAP S/4HANA? Discover the 5 key questions all businesses looking to upgrade to SAP's new ERP system should consider.

11 minute read

Exchange of Electronic Invoices with the SAP eDocument Framework

Companies have to increasingly implement e-Invoicing for different countries. This blog post explains how the SAP eDocument Framework can help you.

2 minute read

How Can You Save an IDoc from SAP on Your Hard Drive?

Wondering how to export IDocs as a file on your local computer? We created a handy guide!

5 minute read

Create and Process UBL Documents with Attachments in SAP

Enable your SAP solution for UBL based e-Invoicing over Peppol. Click here for an example case based on the XRechnung in Germany.

6 minute read

IDoc Processing in an SAP ERP System with Transaction BD87

Companies utilising SAP ERP and exchanging documents need a central tool to manage, view and search for IDocs. Transaction BD87 is the answer.

12 minute read

EDI_DC40: Understand the SAP IDoc Control Record

A correctly filled control header is essential for the identification and processing of IDocs. We show what settings are needed in SAP.

We use cookies to provide an optimal website experience. You decide which one you want to allow. Depending on the setting, however, not all functionalities may be available to you. Data protection & imprint.