You are on page 1of 5

2022-10-12 175522

175522 - ZKACOR21/ZKACOR21R - program for deleting


CO documents
Version 33 Type SAP Note
Language English Master Language German
Priority Recommendations / Additional Info Category Workaround of missing functionality
Release Status Released for Customer Released On 09.09.2021
Component CO-OM-CEL-E ( Postings )

Please find the original document at https://launchpad.support.sap.com/#/notes/ 175522

Symptom

You can delete any CO documents from actual postings in cost accounting with the
program ZKACOR21.
The program is an enhancement for the report RKACOR20 (see SAP Note 45122), with
which only CO documents that have been generated from external accounting
documents can be deleted.

If you must also use the deleted data for the delta extraction in BW, you should
use the report ZKACOR21R described below because it generates an inverse
posting.

Important:

If you use the SAP Simple Finance add-on for SAP Business Suite powered by SAP HANA, sFIN 1503,
and the following, subsequent posting of CO documents from external accounting is no longer
possible. In this case, contact SAP before you delete documents and try to post them subsequently.

Other Terms

CO document, CO interface, COBK, COEP, COEPL, confirmation

Reason and Prerequisites

Defective CO line items that have been generated from CO-internal postings or
allocations (also confirmations). The documents cannot be corrected or reversed
in a different manner.

Solution

In the attachment to this SAP Note, you can find the source code of the program
ZKACOR21, which you can implement in your system, if required.
The program deletes CO line items from CO-internal actual postings and corrects
the corresponding totals records.
If you activate the switch P_RWIN ("Call AC Interface"), documents are passed on
(prior to deletion) as inverse postings to possible receiver applications
(reconciliation ledgers, special ledgers, profit centers), which then carry out
adjustment postings. For this, however, the system must read the master data of
the objects concerned. Errors may occur if the master data is inconsistent or
does not exist. In this case, deactivate the switch P_RWIN. You then have to
clean up the data in the receiver applications using special correction programs
or by deleting and posting subsequently.

© 2022 SAP SE or an SAP affiliate company. All rights reserved 1 of 5


2022-10-12 175522

Note that in the case of incorrect usage of the program ZKACOR21, data is lost irrevocably.
However, executing the program RKACOR20 is not critical because it has been
ensured that documents deleted from financial accounting documents, material
documents, or SD documents can be posted subsequently.

Procedure for implementing the program ZKACOR21

Create the program as a local object in the customer namespace or in a user-


defined development class (transaction SE38).
Choose the program name ZKACOR21, program type 1, application 'K':
Title: "Correction program: Delete CO document with update totals record, FI-
SL,EC-PCA, ..."
Selection texts:
P_KOKRS: "Controlling area" (from Dictionary)
P_PROT: "Detail list"
P_RWIN: "Call AC Interface"
P_TEST: "Test run"
S_BELNR: "Document number" (from Dictionary)

You can copy the source code for the programs from this SAP Note into the ABAP
Editor using the clipboard or upload it to the ABAP Editor using the upload
function.

If project account assignments are affected, reconstruct the project database


afterwards. Project account assignments are WBS elements, networks, network
activities, and orders with assigned WBS elements. Call transaction CJEN for
this.
If necessary, reconstruct the availability control for projects (transaction
CJBN).

Important:
Deleting and subsequently posting CO documents may be problematic if one of the
following actions already exists for the document:

• Line item settlement to internal orders or projects

• Line items planned or invoiced for expense-related invoices

• Assessments for the period

• Line items were transfer posted

• Document was reversed

The last two items can be checked using the option "CO follow-on documents" in
transaction RKABSHOW. If a reversal document is concerned that was posted from
external accounting to CO, the fields COBK-STOKZ and COBK-STFLG in the document
header show whether the document was reversed or is a reversal document. In such
cases, you must reverse the transaction before deleting and subsequently posting
a CO document (for example, reverse line item settlement or transfer posting)
and repeat it after the document is repaired. If you do not do this, there is a
risk that document references are no longer correct, and documents may be
settled twice (individually), may be transfer posted, and so on. Normal
settlements cause no problems because possible differences are taken into
account in the next settlement run.

If you delete a reversed document or a reversal document, also delete the


associated reversal document or reversed document, respectively (and
subsequently post it if necessary).

© 2022 SAP SE or an SAP affiliate company. All rights reserved 2 of 5


2022-10-12 175522

Program ZKACOR21R for document reversal

If the deletion of the documents is not possible because follow-on documents


already exist that can no longer be reset or the posting period is already
closed, you can use the program ZKACOR21R to generate reversal documents for
different periods for these documents.

Due to an incorrect document number assignment for down payment documents, the
specified correction reports were changed on February 09, 2004. You should
therefore make sure that the current version is implemented. You can recognize
it in the source code of the subroutine POST_INVERTED_DOCUMENT.

Procedure for implementing the program ZKACOR21R:

Create the program in the customer namespace as a local object or in a user-


defined development class (transaction SE38). Choose the program name ZKACOR21R,
program type 1, application 'K': Title: "Correction Program: Reverse CO Doc. in
Diff. Period"

Selection texts:
P_KOKRS: "Controlling area" (from Dictionary)
S_BELNR: "Doc. number" (from Dictionary)
P_BUDAT: "Posting date" (from Dictionary)
P_PERIO: "Period" (from Dictionary)
P_PROT: "Detail lists"
P_TEST: "Test run"

Note that no follow-up documents are generated in other components (EC-PCA, FI-
SL, CO-PA, and so on) for this reversal document. The original posting and the
inverse posting refer to each other in the document text.

Software Components

Software Component Release

SAP_APPL 30D - 31I

SAP_APPL 40A - 40B

SAP_APPL 45A - 45B

SAP_APPL 46A - 46B

SAP_APPL 46C - 46C

SAP_APPL 470 - 470

SAP_APPL 500 - 500

SAP_APPL 600 - 600

SAP_APPL 602 - 602

SAP_APPL 603 - 603

© 2022 SAP SE or an SAP affiliate company. All rights reserved 3 of 5


2022-10-12 175522
SAP_APPL 604 - 604

SAP_APPL 605 - 605

SAP_APPL 606 - 606

SAP_APPL 616 - 616

SAP_FIN 617 - 617

SAP_FIN 618 - 618

SAP_FIN 700 - 700

Correction Instructions

Software Component From To Version Changed on ID

SAP_APPL 45A 616 9 17.06.2014 09:03:09 0000464435

SAP_FIN 617 700 4 09.09.2021 10:09:52 0001741179

SAP_FIN 617 700 3 09.09.2021 10:12:06 0001741180

SAP_APPL 31I 40B 3 27.04.2005 09:31:50 0000475743

SAP_APPL 31H 616 22 17.06.2014 09:01:16 0000109761

Other Components

Component Description

CO-OM-ACT-E Postings

This document refers to

SAP Note/KBA Title

862689 CO11N: Service proposal despite Customizing

643773 Confirmation: costs are not posted to subactivity

636923

© 2022 SAP SE or an SAP affiliate company. All rights reserved 4 of 5


2022-10-12 175522
549441 MIR7: Parked documents are not deleted

499865 ALE: Duplicate CO documents when posting IDoc CODCMT

45122 Deleting and posting CO documents subsequently

364472 Parked document and ALE: Update termination

356608 RKACOR20/21: Error in line item settlement

216434 Correction program ZCORGJHR: Incorrect GJAHR

167350 Incorrect value (transaction currency) for confirmation

155282 CO documents for confirmations: Correction programs

1351783

1298364 Dump during multiple overhead calculation

This document is referenced by

SAP Note/KBA Title

549441 MIR7: Parked documents are not deleted

1298364 Dump during multiple overhead calculation

45122 Deleting and posting CO documents subsequently

1438382 CO document not reversed during negative posting

155282 CO documents for confirmations: Correction programs

369147 MIR7: Parked document in CO not deleted

356608 RKACOR20/21: Error in line item settlement

862689 CO11N: Service proposal despite Customizing

499865 ALE: Duplicate CO documents when posting IDoc CODCMT

216434 Correction program ZCORGJHR: Incorrect GJAHR

364472 Parked document and ALE: Update termination

643773 Confirmation: costs are not posted to subactivity

167350 Incorrect value (transaction currency) for confirmation

Terms of use | Copyright | Trademark | Legal Disclosure | Privacy

© 2022 SAP SE or an SAP affiliate company. All rights reserved 5 of 5

You might also like