SAP PP ORDER MANAGEMENT  |  Delete Production Order (CO02)

How to Delete a Production Order in SAP PP Using CO02 (Set and Undo the Deletion Flag)

Sooner or later every plant creates a production order that should not exist: a duplicate, a wrong material, an order for a product that was cancelled. SAP does not simply erase it. Instead it uses a two-stage process, a reversible deletion flag set in CO02 and a permanent deletion indicator that comes later through archiving. This guide walks through the CO02 steps, shows how to undo the flag, explains the checks to do first, and covers how the order is finally removed. If you run into any errors while following along, feel free to send a screenshot to pramod@learntosap.com for help.

✅ Can You Really Delete a Production Order in SAP?

In everyday speech people say "delete the production order," but SAP treats this as a controlled life-cycle step rather than an instant action. An order carries cost, stock and planning information, so removing it carelessly could leave gaps in controlling and inventory. For that reason SAP separates deletion into stages.

The first stage is the deletion flag, status DLFL. You set it yourself in transaction CO02. It marks the order as no longer needed and blocks further processing, but it can be removed again. The second stage is the deletion indicator, status DLT. It is normally set by an archiving preparation program after a defined waiting period, and once set it cannot be reversed. The third stage is archiving and deletion, where the order data is written to an archive and removed from the database.

For most users, "deleting" a production order simply means setting the deletion flag in CO02. That is what the steps in this tutorial cover, followed by a clear explanation of what happens afterwards.

SAP CO02 change production order screen showing the Functions menu for the deletion flag

📋 The Stages of Deleting a Production Order

StageStatusHow It Is DoneReversible?
1. Deletion flagDLFLSet in CO02, or by program in CO78.Yes, revoke it in CO02.
2. Deletion indicatorDLTSet by the archiving preparation run after a residence time.No.
3. ArchivingOrder archivedArchiving program writes the order to an archive.Only by reloading from archive, if your system allows it.
4. DeletionRemoved from databaseDeletion program removes archived orders.No.

Everything up to stage one is within a planner's reach. Stages two to four are normally handled by a scheduled background job under the control of the SAP basis or archiving team, in line with the company's data retention policy.

💡 Why the Deletion Flag Is Useful

The deletion flag does more than label an order. SAP documentation explains that orders with status DLFL are left out of the period-end closing process in cost object controlling, which improves performance. That is one reason many plants flag completed and settled orders regularly, rather than letting thousands of old orders accumulate in the month-end runs.

📝 Checks to Make Before You Set the Deletion Flag

Setting the flag is quick, but the checks beforehand decide whether it succeeds and whether you cause problems later. Work through these in order.

Rule of thumb: If the order was created by mistake and nothing has been posted to it, you can usually set the flag right away. If it has real history, treat it like any order at the end of its life: complete, settle, then flag.

🔧 Step-by-Step: Setting the Deletion Flag in CO02

The steps follow the original example, using production order 60004985.

1

Run transaction CO02, enter the production order number, for example 60004985, and press Enter. The order header opens in change mode.

2

Check the order status in the header. Confirm the order is not still in active use, meaning it is not released and partly processed in a way you did not expect.

3

If the order has confirmations, cancel them using CO13. This reverses the posted yield, scrap and activity values.

4

If the order has goods movements, reverse them, for example with CORS for the order's goods movements or by cancelling the material document. This restores stock and removes the order's consumption and receipt.

5

In the order header, open the Functions menu and choose Deletion Flag → Set. In some releases this entry is found under Restrict Processing. The order now receives the status DLFL.

SAP CO02 Functions menu with Deletion Flag option for production order 60004985 SAP CO02 selecting Set deletion flag, order status changes to DLFL
6

Save the order. The deletion flag is now stored. The order can no longer be processed in the normal way, and the system will treat it as a candidate for archiving.

🔄 How to Undo the Deletion Flag (Revoke)

If the flag was set by mistake, or the order turns out to be needed after all, you can reverse it. The path is the same as setting it, but you choose the opposite option.

1

Open the order in CO02. Because the order has status DLFL, make sure you are in change mode.

2

Choose Functions → Deletion Flag → Revoke (also described as Undo). The DLFL status is removed.

SAP CO02 revoking the deletion flag on a production order using Functions Deletion Flag Revoke
3

Save the order. It is back in normal processing and will be picked up by period-end closing again.

Important limit: You can only revoke the deletion flag while the deletion indicator (DLT) has not been set. Once the archiving preparation run has set DLT, the order opens in display mode only, and there is no standard way to reverse it. If you suspect an order might still be needed, do not let it reach that stage.

⚙ Order Statuses You Will Meet on the Way

StatusMeaningTypical Reason to Use It
CRTDCreatedOrder exists but is not released.
RELReleasedOrder may be worked on, confirmed and goods posted.
TECOTechnically completeNo more production work is expected; can be reset.
CLSDClosedOrder finished and settled at period end.
DLFLDeletion flagOrder marked for deletion, reversible.
DLTDeletion indicatorOrder prepared for archiving, not reversible.

In normal operations an order moves from created to released, then through confirmation and goods receipt, to technically complete, then to closed after settlement, and only then to the deletion flag. An order created in error can skip most of these steps and be flagged straight away, provided nothing has been posted to it.

📋 Deletion Flag vs Technically Complete vs Closed

These three are often mixed up, but they answer different questions. Technically complete (TECO) says "no more production work is expected on this order." It can be reset if the order has to be reopened. Closed (CLSD) says "the order is finished and its costs are settled." It belongs to the period-end process in controlling. The deletion flag (DLFL) says "this order should be removed from the system eventually."

If an order simply finished normally, you do not need to delete it at all. TECO and CLSD are the right statuses, and the order can later be archived under your retention rules. The deletion flag is for orders that should not remain in the system, either because they were created in error or because they are old enough to be cleaned up.

🔍 What Happens After You Set the Flag: CO78 and Archiving

Setting DLFL in CO02 is only the first stage. The rest is usually done in bulk. Transaction CO78 is the central entry point for production order archiving. Behind it sit programs that are often scheduled as background jobs in the following sequence.

StepProgramPurpose
1PPARCHP1Set the deletion flag in bulk, for orders that qualify.
2PPARCHP1Set the deletion indicator after the residence time. Cannot be revoked.
3PPARCHA1Archive orders that carry the deletion indicator.
4PPARCHD1Delete the archived orders from the database.

Two waiting periods, called residence times, control the timing: the deletion indicator can only be set once the first residence time has passed after the flag, and archiving follows after the second. The values are defined in Customizing, so check with your consultant before promising a deadline.

Archiving also depends on storage settings maintained by the basis team. Without an archive destination, the archiving step cannot run. Many smaller plants never complete the archiving stage and simply keep flagged orders in the database.

💡 Do You Need the Deletion Indicator at All?

A common question is whether you must continue to the deletion indicator after setting the flag. The answer is no. SAP community guidance confirms that it is not mandatory to set the deletion indicator after the flag. Many plants flag orders to remove them from daily use and from period-end processing and stop there.

The indicator becomes relevant only if you intend to archive and physically delete orders to free database space. Because it cannot be revoked, set it only for orders where no further costs or postings are expected, and only after the business agrees the retention period.

If your company has no archiving system yet, you can still use the flag safely. If archiving is introduced later, the existing flagged orders can be selected for the next stage at that time.

💼 Real-World Scenario: A Duplicate Order Created by Mistake

Pradnya Pawar, an SAP PP consultant working with a beverage manufacturer in Pune, received a call from a planner on a Monday morning. A production order for a bottled product had been created twice, and the duplicate, number 60004985, was already visible in the stock and requirements list, inflating planned supply.

Anand Rathi, the production supervisor, wanted it gone before the morning meeting. Pradnya opened the order in CO02 and checked the status: it had been created but not released, with no confirmations and no goods movements. That meant no reversal was needed. She chose Functions, then Deletion Flag, then Set, and the status changed to DLFL. She saved the order and asked the planner to refresh the stock and requirements list, where the duplicate supply no longer appeared.

An hour later Anand called back: the original order had a printing problem and the team wanted to reuse the duplicate after all. Because the deletion indicator had not been set, Pradnya reopened the order in CO02, chose Functions, Deletion Flag, Revoke, and saved. The order returned to normal. She used the moment to explain why the flag is safe to try but the deletion indicator is not, and agreed with Anand that the archiving job would only be run by the basis team at month end, after a review of the list of flagged orders.

❗ Common Mistakes When Deleting Production Orders

✅ Best Practices for Deleting Production Orders

🔒 Authorization Considerations

Changing an order's status is controlled by the authorization for order maintenance, normally checked by order type and plant. Many companies allow planners to flag orders they created, but restrict the bulk archiving transactions to a small group, since running them has lasting effects.

Reversing confirmations and goods movements requires its own authorizations, for example for confirmation cancellation and for material document reversal. If a planner can set the flag but not reverse the postings, the order will stay stuck, so test the full sequence with a real user before relying on it.

🔧 Troubleshooting Common Deletion Flag Issues

The "Set" option for the deletion flag is greyed out

The order status may not allow it. Check for open balances, unsettled costs or an assembly order. Community discussions note that for static assembly orders the system controls the flag, and that technically completing the order first can help in other cases.

The order opens in display mode only

The deletion indicator (DLT) has probably been set by an archiving run. It cannot be revoked in standard SAP, so a new order has to be created if work is still needed.

The flag was set but the order still shows in the stock and requirements list

Refresh MD04 and check the order status. If the order has other active statuses or the list was not refreshed, it may still appear. Also confirm the save was successful.

CO78 does not set the flag for some orders

The program selects orders based on its selection criteria and status conditions. Check the selection profile, the order type and whether the orders meet the required status, for example closed.

Costs remain on the order after flagging

The flag does not settle costs. Settle the order following your period-end procedure before flagging, or revoke the flag if follow-up costs must still be charged.

You need to delete many orders

Use the order archiving transaction CO78 rather than CO02, and agree the selection with your consultant so only the right orders are included.

🏢 How Different Plants Handle Order Clean-Up

The common thread is a clear, written rule that everyone follows, so deleted orders are the intended ones and nothing is lost by accident.

📋 Pre-Deletion Checklist

🔍 Confirming the Result in MD04 and the Order Information System

After saving, it is good practice to confirm the effect. Open the stock and requirements list for the material with MD04 and check that the order's planned receipt no longer appears as supply. If it still does, refresh the list and re-check the order status.

To see all flagged orders together, use the production order information system, COOIS, and select by status DLFL. This gives a quick list for review meetings, and it is the natural input for a later archiving run.

📱 Deleting Production Orders in SAP S/4HANA

The deletion flag concept and the CO02 steps in this guide apply in SAP S/4HANA as well, since production order status management is unchanged. In S/4HANA, data archiving remains available, and SAP encourages regular clean-up because large volumes of old orders affect period-end runs and database size.

Some newer releases add Fiori apps for managing production orders, but classic CO02 continues to work. Confirm the available options in your own release and test the flag, revoke and archive flow in a non-production client before changing your standard process.

📋 Related SAP Transactions

TransactionPurpose
CO01 / CO02 / CO03Create, change and display production orders.
CO13Cancel confirmations of a production order.
CORSReverse goods movements for an order.
KO88Settle a production order.
CO78Archive production orders and set deletion flag and indicator in bulk.
COOISProduction order information system, to list orders by status.
MD04Stock and requirements list.

🎓 Interview-Style Questions and Answers

Q: Can a production order be deleted directly?
Not directly. You set the deletion flag, and removal from the database happens later through the deletion indicator and archiving.

Q: What is the difference between DLFL and DLT?
DLFL is the reversible deletion flag set in CO02. DLT is the deletion indicator set by archiving preparation, which cannot be revoked.

Q: How do you undo a deletion flag?
In CO02, choose Functions, Deletion Flag, Revoke, and save.

Q: Which transaction archives production orders?
CO78.

Q: Why do plants set the flag regularly?
Flagged orders are excluded from period-end closing in cost object controlling, which improves performance.

Q: What should be done before flagging an order with postings?
Reverse confirmations and goods movements where appropriate, and settle costs.

📚 Quick Glossary

📝 Governance for Order Deletion

Deletion is easy to underestimate. Because the later stages cannot be undone, a short written procedure protects the business. State which statuses qualify, who may set the flag, how long flagged orders wait before the indicator is set, and who approves each archiving run.

Keep a log of archiving runs, with the date, the selection used and the number of orders affected. If someone later asks where an old order went, the log and the archive give a clear answer.

💡 Quick Decision Guide: Flag, TECO or Leave the Order Alone?

Not every unwanted order needs the deletion flag. This short guide helps choose the right action.

SituationRecommended Action
Order created by mistake, nothing posted.Set the deletion flag in CO02.
Order partly produced, remaining quantity no longer needed.Set technically complete (TECO) so no more work is expected.
Order finished and costs settled.Let it be closed in the period-end process; archive later under the retention rule.
Very old closed orders cluttering the system.Use CO78 to flag and archive in bulk, after agreement with finance.
Order has postings that need correcting.Reverse the postings first, then decide between TECO and the flag.

If you are unsure, TECO is the safer choice, because it can be reset. The deletion flag is also reversible, but it removes the order from period-end processing, which may hide a cost problem.

🔄 What Happens to Related Documents

A production order rarely stands alone. Before flagging, think about what is connected to it, because each link may need attention.

Taking a minute to review these links prevents the common surprise where an order is flagged, but its demand quietly returns in the next planning run.

📦 Handling Many Orders at Once

Flagging one order in CO02 is simple, but cleaning up hundreds is not a job for manual work. Use the order information system, COOIS, to list orders by plant, order type and status, and review the list with the business. Then use the archiving transaction CO78 to set the deletion flag in bulk for the approved selection.

Test the selection first in production mode only after a test run, and keep a copy of the list. The deletion indicator step is final, so it should be run only after the list has been signed off. A small amount of care here avoids the situation in which orders that were still needed are archived by a schedule nobody remembered.

🎯 Conclusion

Deleting a production order in SAP is a staged process, and the part most users handle is the first one: setting the deletion flag in CO02. Check the status, reverse confirmations and goods movements if needed, settle costs, then choose Functions, Deletion Flag, Set, and save. If you change your mind, revoke it the same way while the deletion indicator has not been set. Leave the deletion indicator and archiving to a planned, approved run through CO78, and keep this guide handy the next time an order needs to go.

❓ Frequently Asked Questions

Not directly. In CO02 you set a deletion flag (status DLFL), which blocks further processing and can be revoked. The order is physically removed only later, through deletion indicator and archiving, usually run with CO78.
The deletion flag (DLFL) is set in CO02 and can be removed again. The deletion indicator (DLT) is normally set by the archiving preparation program after a residence time and cannot be revoked.
Open the order in CO02 and choose Functions > Deletion Flag > Revoke, then save. This works only while the order has not received the deletion indicator.
The order status may not allow it, for example the order still has open balances, or it is an assembly order for which the system controls the flag. Check the status, settle or close the order, or use the order archiving programs.
CO78 is used for production order archiving. It runs the programs that set the deletion flag and deletion indicator, archive the orders and delete them from the database.
Yes. Orders with the deletion flag are not included in period-end closing for cost object controlling, which improves performance, so the flag should only be set when no more costs are expected.
No. It is not mandatory. Many plants set only the deletion flag. The indicator is needed only if you plan to archive and delete orders from the database.