Gain insight into preconditions for archiving purchasing documents that reduce database maintenance time, storage requirements, and data backup, among other benefits. Gather strategies to avoid unnecessary errors and pitfalls when archiving purchasing documents in the SAP system.
Key Concept
Data archiving is the process of removing a large volume of data that is no longer needed online in the system, but which must be available for reference when needed. This data management strategy ensures the optimal performance of the SAP system.
|
The process of data archiving can be very challenging if not properly planned and implemented. This is partly because of the process dependencies that are inevitable in an enterprise system. For example, purchase orders should be archived before archiving contracts. Furthermore, unfamiliarity with the prerequisites, definitions, and customization settings for archiving purchasing documents can be a recipe for an error-prone archiving exercise. Acute knowledge of these preconditions is central to the successful data archiving, especially purchasing documents.
Before archiving purchasing documents, you must ensure you perform specific checks on the purchasing documents under consideration. This will save you the headache of avoidable troubleshooting and consequently ensure that you are on time in your purchasing document archiving project.
The benefits of archiving purchasing documents include reduction in database maintenance time, storage requirements, and backup, restore, and access time for database tables. Furthermore, data archiving helps reduce network load, index trees, and variants for queries. It also enhances buffer use. The system supports the archiving of internal purchasing documents (e.g., purchase requisition) and external purchasing documents (e.g., purchase order, request for quotation/quotation and contract) using the archiving object MM_EBAN.
I discuss the checks and balances for archiving purchasing documents using several archiving scenarios. I first discuss prerequisites for error-free archiving of all purchasing documents, then emphasize specific archiving expectations for purchase requisitions, purchase orders, scheduling agreements, quotation requests, and contracts.
Prerequisites for Archiving All Purchasing Documents
All purchasing documents must satisfy a number of requirements before you can archive them:
- Appropriate user authorization provisioning
- Deletion indicator setting in purchasing documents
- Residence times setting
Appropriate User Authorization Provisioning
To archive a document, you must have the required authorization: S_ARCHIVE. The authorizations that you can assign to a user include:
- 01: All authorizations (e.g., read, write, and reload archive files as well as execute the delete program and change mode in archive management)
- 02: Change mode in archive management
- 03: Read and analyze archive files and display mode in archive management
Furthermore, depending on the purchasing document, you need additional authorization for specific archiving objects with activity 06 – delete. The authorization objects are detailed below against the respective purchasing documents:
Deletion Indicator Setting in Purchasing Documents
You can block or delete items in purchasing documents without deleting the entire purchase document itself. When you do this, the system updates the deletion indicator automatically. The value of the LOKEZ field (i.e., the deletion indicator) in the purchasing document table determines whether an item is deleted or blocked. When an item is blocked, the value of the field LOKEZ is set to S as shown in Figure 1. You can access this screen by displaying the entries in the purchase document tables (for example, table EKPO) via transaction SE11.
Note
You cannot archive purchasing documents with blocked items.

Figure 1
Deletion indicator in the purchasing documents
Residence Times Setting
One of the customizing settings that influences data archiving in the SAP system is the residence times setting. This helps determine how the system handles the qualification of a purchasing document for archiving. In customizing, you can define residence times (Figure 2) by following the paths below for the corresponding purchasing document type:
- Purchase Requisition: SAP Customizing Implementation Guide > Materials Management > Purchasing > Purchasing Requisition > Define Tolerance Limit for Archiving
- Purchase Order: SAP Customizing Implementation Guide > Materials Management > Purchasing > Purchase Order > Define Tolerance Limit for Archiving
- Request For Quotation/Quotation: SAP Customizing Implementation Guide > Materials Management > Purchasing > RFQ/Quotation > Define Tolerance Limit for Archiving
- Scheduling Agreement: SAP Customizing Implementation Guide > Materials Management > Purchasing > Scheduling Agreement > Criteria for Archiving > Define Tolerance Limit for Archiving
- Contract: SAP Customizing Implementation Guide > Materials Management > Purchasing > Contract > Criteria for Archiving > Define Tolerance Limit for Archiving

Figure 2
Residence times settings in customizing
The system allows you to define two parameters for the residence times: 1 and 2. Residence time 1 defines the number of days after which the archiving program may activate the deletion indicator, while Residence time 2 defines the number of days after which the archiving program may delete documents that have the deletion indicator activated for them. During archiving, it is important to note that purchasing documents with changes within the number of days defined in the residence times cannot be archived because the deletion indicator is not activated for them. You have to reset Residence time 1 to activate the deletion indicator and allow archving.
Every purchasing document is unique and has specific archiving requirements. In the following sections, I explain the archiving requirements for:
- Purchase requisitions
- Purchase orders and scheduling agreements
- Contracts
-
Quotation requests
Purchase Requisitions
Purchase requisitions are standard purchasing documents that define the requirement for a material or service. The creation indicator determines how the purchase requisition was created (e.g., via a production order or store order). Figure 3 shows some creation indicators for a purchase requisition. To access the screen, use transaction ME5A or follow menu path Logistics > Materials Management > Purchasing > Purchase Requisition > Display.

Figure 3
Creation indicator options in a purchase requisition
The creation indicator of purchase requisitions also determines how the purchase requisitions are archived. For instance, the archiving object for purchase requisitions created via a sales order is MM_EBAN. (To successfully archive purchase requisitions, the associated sales orders must be completely invoiced.) MM _EBAN is not used for purchase requisitions created through production orders – it is the archiving object of the source document (production order) instead.
Purchase Orders and Scheduling Agreements
A purchase order is the buyer’s formalized instruction to a vendor to supply specific goods or render specific services based on agreed terms and conditions. A scheduling agreement allows you to create delivery schedules that specify purchase quantities and delivery times.
You must consider goods receipt (GR), invoice receipt (IR) and final invoice (FI) control indicators when archiving purchase orders and scheduling agreements. These control indicators affect how the system behaves when archiving purchase orders and scheduling agreement. The GR indicator defines whether a goods receipt is expected for the ordered item. The IR indicator defines whether an invoice receipt is expected for the ordered item. The FI indicator defines whether outbound deliveries are expected for the ordered item. You can set the GR indicator in the Delivery tab in the purchase order item details window (Figure 4). Set the IR indicator and the FI indicator in the Invoice tab of the purchase order item details window (Figure 5).

Figure 4
Goods Receipt indicator

Figure 5
Inv. Receipt and Final Invoice indicators
When archiving purchase orders and scheduling agreements, note the following to ensure a successful archiving process:
- If the ordered item is linked to a goods receipt, the item must be completely delivered or the quantity for the goods receipt must be equal to or more than the ordered quantity less the under delivery tolerance limit
- If no goods receipt is expected for the ordered item, but an invoice receipt is expected, then either no outbound delivery should be expected for the ordered item or the invoice receipt quantity must be equal to or greater than the ordered quantity
- If the ordered item is linked to both a goods receipt and invoice receipt, the goods receipt quantity and the invoice receipt quantity must be equal. This is to ensure that the GR/IR account is zero.
You cannot archive purchase orders and scheduling agreements if the following items are present:
- Parked invoices: Data is registered in the system and saved in a document, but not posted
- GR blocked stocks: Stocks that are received as non-valuated from a vendor based on certain terms and conditions. Inventory valuation and update occurs after the stocks are released via movement type 105.
- Delivery costs: Use transaction MR11 (maintain GR/IR clearing account) to clear delivery costs (Figure 6)

Figure 6
Clear the delivery cost accounts
Contracts
A contract is fulfilled when a quantity or value is agreed upon via the issuance of contract release orders. To successfully archive contracts, the date of the last purchase order on a release order must be greater than or equal to the number of days defined in the Residence time 1 setting in customizing. Furthermore, you need to delete all release documentation records to archive the document. Use transaction ME23K to access a release document or use menu path Logistics > Materials Management > Purchasing > Outline Agreement > Contract > Change (Figure 7).

Figure 7
Components of release order documentation
Quotation Requests
A quotation request is a purchasing document used to transmit a requirement defined in a requisition for goods and services to potential vendors. To archive quotation requests, you must ensure that a quotation request is assigned to a corresponding quotation. Otherwise, you need to reject the item via transaction ME47 by checking the box in the R (rejection indicator) column in the line item (Figure 8). Also, the deadline for the submission of the quotation must not have been exceeded or you cannot archive the document.

Figure 8
Activate the rejection indicator (R)
Kehinde Eseyin
Kehinde Eseyin is a security architect. He holds a bachelor’s degree in computer science. He has about 12 years of IT security, governance framework, IS risk, and compliance experience gained by working in numerous global organizations. Over the years, he has demonstrated competencies in security design, information assurance, cyber security, data privacy, threat and vulnerability management, penetration testing, business architecture, project management, IT audit, IS controls framework, and identity and access management.
You may contact the author at eseyinok@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.