Sometimes the only way to meet a CO reporting requirement is to have your ABAP team generate a custom program. The integrity and performance of that program depends on the quality of the instructions you give the team. Table COEP plays an important role here, because its indexes will help ensure good report response time and it contains the data that the report will need. The author shows you how to confirm that the data you expect to be in that table really exists.
Key Concept
Invariably, users will need reporting functionality that a standard CO report doesn’t provide or that is not possible using R/3 reporting tools such as Report Writer and Report Painter. Your only option might be custom ABAP development. Once you are convinced that this is your only option for creating a CO report, then you will probably have to create design specifications for an ABAP programmer.
The quality of the ABAP program you get back depends on those design specifications. A mistake in the specs might mean poor performance or the reports not running at all. You can provide good program specifications for ABAP development if you focus on two key areas: ensuring good response speed and the manual validation of data. In both cases, you need to know where and how the data needed for the reports is stored, and this is what I will show you in this article.
Understanding the data contained in the table COEP is helpful for both reducing response time and manually validating data. You typically use this table when customized reports require dollars and quantities for CO objects. Transactions contained within the table include cost center assessments and distributions; activity confirmations; settlement; issues; receipts; and settlement for discrete, repetitive processes and make-to-order production orders. COEP also contains similar transactions for plant maintenance, project systems, and so on.
The rows populated and the data contained in the COEP fields will vary depending on your system’s configuration and modules implemented.
Using Indexes Boosts Performance
Performance is a critical issue when dealing with any large SAP table. For example, the COEP table in just a mid-sized company can easily contain 60 million records or more. The most important step in ensuring good response time for a custom CO report is the use of one of the COEP indexes when accessing table records. The larger the table the more critical this step becomes. Typically, the fastest COEP indexes use the controlling area (KOKRS) and document number (BELNR) fields, or ledger (LEDNR) and (OBJNR) object number fields. Using indexes allows the specified data to be accessed directly without sequentially reading through the file to find each record.
In the event the index required does not exist, it is possible to create a secondary index to enhance performance. This activity should be discussed with and performed by the Basis team.
Manual Validation of Data
Manual validation involves displaying the contents of a table to ensure the data your design specifications require exists. Due to the vast number of tables contained in the R/3 system, you should never overlook the manual validation step when creating design specs for a custom report. It’s easy to incorrectly assume that the needed data exists and start development. Unless you have manually validated the table contents, you will not be aware of any problems caused by non-existent data until the ABAP program has been written and you see the test results.
Here’s how you might manually validate the entries contained in COEP for a process order. The R/3 system in my example uses the FI/CO, Materials Management (MM), Production Planning (PP), Project Systems (PS), and Sales and Distribution (SD) modules. However, the process would be the same if you used a Plant Maintenance (PM) order, a repetitive order, or an internal order.
Step 1. Display Process Order Entries
A useful report that shows CO transactions for orders is accessible via transaction code KOB1. It shows all the CO entries for a process order and may be used on all types of production orders, plant maintenance orders, and internal orders. On the Order: Line Items screen (Figure 1), enter the number of the process order for which you want to validate the data (100052120 in my example). To determine a valid order number, contact your PP resource or use transaction code SE16 to query table AUFK (Order Master Data). AUFK provides a listing of all order numbers for all types of orders. Make sure that the date range is valid for the order being displayed.
When displaying settlement transactions, the Posting date...to field in Figure 1 should be set to the last day of the period. No matter what day (document date) settlement transactions are processed, R/3 always uses the last day of the period as the posting date for all settlement transactions. Use another date and you might wonder what happened to the settlement transactions when you display production order costing data.
You also need to select the Display variant and Totals variant in the Settings tab in Figure 1. KOB1 offers several display variants that allow the displayed report content to be changed. (Note that in release 4.6, the Totals variants field is no longer available in the Settings tab.) Execute the transaction to move to the next step.

Figure 1
Select the process order information at the Order: Line Items screen of KOB1
Step 2. Access the COEP Table Directly
Perhaps the data you see in Figure 2 is what you want, but it is not in the format you would like it to be in and none of the standard data display options in that report offer you what you need. You might decide to ask for custom ABAP code as the way to get the desired format. If this is the case, you will save both yourself and your ABAP programmer a surprise if you first make the small effort to ensure that the standard report (i.e., KOB1) is merely reading its data from the COEP table rather than reading the data and then applying some kind of math or other logic to that data as part of its display function. The only way to know for sure is to access table COEP directly, so that you can manually verify that what is stored there looks just like (or at least close enough to) what you see in Figure 2. Figure 2 shows the CO transactions generated by the process order. If you don’t see all the fields for which you want to validate data, you may add them using the Additional field on button.
Note
Before adding a new field, you must right-click on the report to determine where the additional field will be added.

Figure 2
CO Transactions for process order 100052120
A process order typically contains issues, activity confirmation, a goods receipt for the produced material, and a settlement. In this example, the transactions include the following documents:
- 803361349: Shows the finished good being put into inventory (material movement 101, basic goods issue movement) and reflects the materials consumed by the order (material movement 261, basic goods receipt movement).
- 1500736937: Contains the activity costs consumed when the order is confirmed. (Note that this order has not been settled. Settlement will generate a document type (DT) SA for the last day of the posting period.)
To validate the data for the first document listed in Figure 2, execute transaction code SE16. You will see the screen shown in Figure 3. Here, you enter US01 for the CO area and 803361349 for the Document number.

Figure 3
The COEP Selection Screen
Step 3. Specify Fields to Be Displayed
Figure 4 shows all the transactions associated with document 803361349. Now you can specify the fields associated with the document that you want to appear in the custom report. Use the menu path Settings>List Format>Choose Fields to reach the screen shown in Figure 5.
Using the middle icon at the bottom of the pop-up window, unselect all fields and click on the boxes to the right of the fields that you want to validate for the report design spec. After completing the selection, click the green check mark to validate that the data you expect to be in your report exists for the fields you selected. Figure 6 shows that document 803361349 contains line items 001, 002, and 004. These entries reflect the goods receipt of the produced material as well as the components consumed to produce the finished material.
Repeat the above steps to validate the data for the remaining documents shown in Figure 2. You can also extend this analysis method to explore all the transactions contained in table COEP. Once you have researched the transactions and fields that populate COEP, you can develop a detailed design document that can accom-modate almost any CO custom reporting need.

Figure 4
Transactions associated with document 803361349

Figure 5
Selection screen for field names associated with document 803361349

Figure 6
Data in selected fields associated with document 803361349
Bill McNaughten
Bill McNaughten is a senior applications consultant for Cap Gemini Ernst & Young who specializes in the implementation and support of the SAP R/3 CO module. His SAP career began in 1996 with Anheuser Busch. After completing a successful implementation, Bill spent several years as an independent consultant before joining CGEY. In his seven years of experience, he has specialized in implementing product costing systems in manufacturing environments. Bill's hobbies include playing the guitar and listening to all styles of music.
You may contact the author at wpmcnaughten@cgeykcsc.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.