SAPTechno

Note 568227 - Account changes cause data inconsistencies

Header
Version / Date 11 / 2006-02-17
Priority Correction with high priority
Category Program error
Primary Component SD-BIL-RR Revenue Recognition
Secondary Components SD-BIL-CA Account Assignment

Summary
Symptom

In the revenue recognition, account changes in Customizing of the account determination always lead to data inconsistencies if revenues have already been recognized or billed for items relevant for revenue recognition of a sales and distribution document.

The following symptoms may occur in this context:

    1. If you change and then save an existing sales document, the system generates new control lines (VBREVK). The 'old' control lines remain in the table. If you recognize or bill revenues afterwards, postings to the incorrect clearing accounts are made.
    2. A billing document/credit memo relevant for revenue recognition finds other accounts than the sales document. A transfer to financial accounting is not possible.
    3. During the revenue recognition (VF44/VF46), the system uses the control lines with the 'new' clearing accounts. Postings to the incorrect accounts are made.
    4. If a cross-company-code process is involved, the system also determines new accounts at goods issue. The revenue lines to be generated (VBREVE) do not have their own control lines and thus cannot be recognized.
    5. If you start an analysis using Transaction VF47, the log displays the following error:

           E16 - Detail lines have determined balance on 'deferred revenues' and on 'non-billed requests'.

              This error is due to the 'new' clearing accounts.
Other terms

Standard revenue recognition, VA02, VA42, VL02N, VL09, VF01, VF02, VF04, account determination, deferred revenues, non-billed requests, buffering G/L accounts, SAKN1, SAKN2, RV_INVOICE_ACCOUNT_DETERM, SD_REV_REC_DETERM_UNBILLED_ACC, SD_REV_REC_BILLING, VBREVK, VBREVE, VBREVR, VF47, E16, cross-company, KONVFLAG, RR_REV, RR_CCDR, SD_GET_ACCOUNTS_FROM_KONV, SD_GET_ACCOUNTS_KONV_REFRESH

Reason and Prerequisites

The system performs an account determination for the corresponding conditions for each item relevant for revenue recognition. Regardless of the revenues recognized or billed, the accounts found are included in the corresponding document.

Since accounts in revenue recognition is key information, the system generates 'new' control lines and may assign values that have already been posted to these 'new' control lines. Future postings are made to the redetermined clearing accounts whereas the revenues posted in the past were posted to the 'old' accounts. The result are balances remaining on the affected clearing accounts.

Solution

As in the past, the system always carries out an account determination for items relevant for revenue recognition. However, if revenues have already been recognized or billed for the item involved, a redetermined account is not included in the corresponding condition, instead the original account is retained.

This, however, does not apply to the actual revenue accounts. They can still be changed at any time and are added to the respective document.

To ensure this function, the following problems were also corrected:

    1. If you save a delivery relevant for revenue recognition, the system initializes the revenue recognition status in the VBUP-RRSTA table. When you implement this note, the status remains.
    2. If you transfer a billing document with items relevant for revenue recognition to financial accounting and if an error occurs in revenue recognition (function module: SD_REV_REV_BILLING), no valid error message is displayed. If you implement this note, the system may display the following messages:
      a) S011 - No order number exists for determining control lines.
      b) S010 - No control line for item &2 in document &1
      c) S007 - Accrual period not determined for doc &1 &2;
             no revenue dist possible
      d) S012 - Account for 'restricted revenues' missing in item &2 of document &1
      S012 - Account for 'deferred revenues' missing in item &2 of document &1
      e) S013 - Account for 'non-billed requests' missing in item &2 of document &1
      S012 - Account for 'deferred revenues' missing in item &2 of document &1
      f) S003 - Internal error within revenue recognition(characteristic &1)

              The system does not try to create a FI document.

    3. If you do not set a default billing type in Customizing of the SD document type, no account determination will be executed when saving the SD document. As a result, the system updates control lines (VBREVK) without a clearing account ('deferred revenues'). After implementing this note, an incompleteness is displayed.

This error is eliminated in the subsequent release of Release 4.70.

Implementation
    1. In Transaction SE11, create the following data elements (not relevant for Release 4.5B/4.6A):
      a) Data element             : RR_CCDR
      Development class/package: VFE
      Short description        : Revenue recognition:
      ID 'def revenues/cross-company case
      Elementary type - Domain : XFELD
      Field label
            - Short (06)      : CCdefR
            - Medium (10)      : CC/def.rev
            - Long (31)        : CrossCompany/deferred revenues
            - Heading (06)     : CCdefR

                       Documentation

                       Short text
Revenue recognition: Ind. 'def revenues'/cross-company case

                       Definition
Before the implementation of Note 568227, the accruals account 'Deferred revenues' of the delivering company code was updated in the corresponding sales document condition in the cross-company case. This information was included in field KONV-SAKN2.

                       However, the revenue recognition requires the clearing account of the billing company code for the accrual. Thus, the information in field KONV-SAKN2 in the cross-company case is not required because it is the clearing account 'Deferred revenues' of the delivering company code in this case.

                       To ensure that the clearing account 'Deferred revenues' of the billing company code is not lost in the case of an account change, the clearing account of the billing company code is included in field KONV-SAKN2 of the delivering company code as of Note 568227.

                       For upward compatibility reasons, you must specify when or if the account in field KONV-SAKN2 is a clearing account of the billing company code.  That is, if the 'Def. revenues/cross-company case' indicator is set, it is always a clearing account of the billing company code.

                       Use
Revenue recognition

                       This indicator is only set internally within the account determination.

                       Dependencies
This indicator is only set in the cross-company case.

      b) Data element             : RR_REV
      Development class/package: VFE
      Short description        : Revenue recognition:
      Direct posting to revenue account
      Elementary type - Domain : XFELD
      Field label
            - Short (06)      : DirRev
            - Medium (10)      : Dir.Revenu
            - Long (31)        : Direct revenue posting
            - Heading (06)     : DirRev

                       Documentation

                       Short text
Revenue recognition: Direct posting to revenue account

                       Definition
This indicator defines whether the value of the condition is to be posted directly to the determined revenue account. If this indicator is not set, the posting is made to the corresponding accruals account.

                       Use
Revenue recognition

                       Example
Condition 'DIFF' is determined for the billing item. In the order item, this condition is unknown. Therefore, no control lines exist either. When transferring the billing documents to the financial accounting, an error may occur if condition 'DIFF' is not flagged as 'direct revenue posting'.

The accounting document could not be created.

    2. In Transaction SE11, add the following fields to data structure KONVFLAG (Description of flags locked in the KONV) (not relevant for Release 4.5B/4.6A):

              Component    Component type
---------    --------------
FIELD5      RR_REV
FIELD6       RR_CCDR

    3. In Transaction SE11, create the following data structure:

              Structure                : KONVREV
Development class/package: VFE
Short description        : Revenue recognition: Accounts of the sales document items of DB

Field name/Comp  Type name/Comp type  Short description
---------------  -------------------  -----------------
MANDT            MANDT                Client
VBELN            VBELN_VA            Sales document
KNUMV            KNUMV                No of document condition
KPOSN            KPOSN                Condition item number
STUNR            STUNR                Step number
KSCHL            KSCHA                Condition type
SAKN1            SAKNR                G/L account number
SAKN2            RR_SAKDR            Account for deferred revenues

Additional field as of Release 4.6B

Field name/Comp  Type name/Comp type  Short description
---------------  -------------------  -----------------
KBFLAG          KBFLAG               Bit encrypted flags in Pricing

    4. Use Transaction SE80 to create the following include in the VFRR function group:

              Include    : LVFRR001
Title .... : Include LVFRR001 - FORM: READ_UR_ACCOUNT_FROM_VBREVK
Type      : Include program
Status     : SAP standard production program
Application: Sales

              Development class/package: VFE

              Remove the lines generated in the includes. This also applies to the include links in the program SAPLVFRR, if these were added automatically. Only this way can you execute an automatic implementation using the "Note Assistant".

    5. In Transaction SE80, create the following Includes in function group V60A:

              Include: LV60AD29
Title : Include LV60AD29: FORM DETERMINE_REV_REC_ACCOUNTS

              Include: LV60AD30
Title  : Include LV60AD30: FORM DETERMINE_REV_REC_ACCOUNTS_CC

              Include: LV60AD31
Title  : Include LV60AD31: FORM DETERMINE_OLD_DEFERRED_REV_ACC

              Other attributes

                   Type      : Include program
    Status     : SAP standard production program
     Application: Sales

                   Development class/package: VF

              Remove the lines generated in the includes. This also applies to the include links in the SAPLV60A program, if these were added automatically. Only this way can you execute an automatic implementation using the "Note Assistant".

    6. Use Transaction SE37 to create the following function modules in the VFRF function group:

              Function module          : SD_GET_ACCOUNTS_FROM_KONV
Development class/package: VFE
Short text              : Read and buffer account information from KONV

              Function module definition:
Changing parameter FCS_KONVREV specifies a condition of a sales document for which the revenue account (SAKN1) and the clearing account (SAKN2) are to be read directly from the database. The function module returns this information in the FCS_KONVREV changing parameter.

              In the function module itself, the conditions are read and buffered per sales document so that the access to the database is limited to a minimum.

              If KNUMV is not transferred into the function module, it is determined using the sales document header.

              In addition, the function module can be used to return all conditions of a sales document. To do this, set the FIF_ SDOC_COND_ALL import parameter to 'X'. The read conditions are made available in the FIT_KONVREV parameter table.

              If you only require conditions for one item, set the FIF_ SDOC_COND_ALL import parameter to 'I'. The conditions of the item are provided in the FIT_KONVREV parameter table.

              The following condition information is returned by the function module:
      - Revenue account  (KONV-SAKN1)
      - Clearing account (KONV-SAKN2)

Parameters in Release 4.5B

Import param       Ref field   Ref type  Dflt  Opt  Ref
------------      ----------  --------  ----   ---  ---
FIF_SDOC_COND_ALL  TYPE        CHAR1    SPACE  X

Changing param     Ref field   Ref type  Dflt  Opt  Ref
--------------    ---------  --------  ----  ---  ---
FCS_KONVREV        KONVREV

Table param        Ref struct  Ref type  Dflt  Opt
-----------        ----------  --------  ----  ---
FIT_KONVREV        KONVREV                      X

Exceptions
----------
NO_CONDITION_FOUND
NO_KNUMV_FOUND

Parameters as of Release 4.6A

Import param       Type spec   Ref type  Dflt  Opt  Value
------------      ---------   --------  ----   ---  -----
FIF_SDOC_COND_ALL  TYPE        CHAR1    SPACE  X

Change param       Type spec   Ref type  Dflt  Opt  Value
------------      ---------   --------  ----   ---  ----
FCS_KONVREV        TYPE        KONVREV

Table parameter  Type spec   Ref type  Opt
------------------    ----  ---------  ---
FIT_KONVREV LIKE KONVREV X

Exceptions
-----------------
NO_CONDITION_FOUND
NO_KNUMV_FOUND

The short texts apply to all releases

Parameter              Short text
---------              ----------
FIF_SDOC_COND_ALL Flag  Flag: Get all document conditions
                        --> 'X'; only items --> 'I'
FCS_KONVREV            Accounts of sales document item from database
FIT_KONVREV            All accounts of sales document from database
NO_CONDITION_FOUND      No condition was found in table
                        KONV(database)
NO_KNUMV_FOUND          No condition number found

              Function module          : SD_GET_ACCOUNTS_KONV_REFRESH
Development class/package: VFE
Short text               : Delete internal table of the account information

              Function module definition:
The internal table for storing condition information that was read directly from the database is initialized.

    7. Use Transaction SE37 to add the parameters listed below to the interfaces of the following function modules:
      a) RV_INVOICE_ACCOUNT_DETERM        (function group: V60A)

Parameters in Release 4.5B

Import param  Ref field   Ref type  Default  Opt  Ref
------------  ---------  --------  -------  ---  ---
XVBUP         VBUPVB                        X

Table param   Ref struct  Ref type  Default  Opt
-----------  ----------  --------  -------  ---
XVBFA        VBFAVB                        X

Parameters as of Release 4.6A

Import param  Type spec   Ref type  Default  Opt  Value
------------  ---------  --------  -------  ---  -----
XVBUP        TYPE        VBUPVB            X    X

Table param  Type spec   Ref type  Opt
-----------   ---------  --------  ---
XVBFA        LIKE        VBFAVB    X

The short texts apply to all releases

Parameter    Short text
---------    ---------
XVBUP        SD document: Item status
XVBFA        SD document flow

      b) SD_REV_REC_DETERM_UNBILLED_ACC (function group: VFRR)

Parameters in Release 4.5B

Import param          Ref field   Ref type  Dflt  Opt  Ref
------------          ---------   --------  ----  ---  ---
FIF_SAKUR_FROM_VBREVK  CHAR1      SPACE           X
FIF_SALESDOC_NUMBER    VBAK-VBELN                  X
FIF_SALESDOC_ITEM      VBAP-POSNR                  X

Parameters as of Release 4.6A

Import param          Type spec   Ref type    Dflt  Opt Value
------------          ---------   --------   ----   ---   -----
FIF_SAKUR_FROM_VBREVK  TYPE        CHAR1      SPACE  X    X
FIF_SALESDOC_NUMBER    TYPE        VBAK-VBELN        X    X
FIF_SALESDOC_ITEM      TYPE        VBAP-POSNR        X    X

The short texts apply to all releases

Parameter              Short text
---------              ----------
FIF_SAKUR_FROM_VBREVK  Flag: Get ur-account from control line
FIF_SALESDOC_NUMBER    Current sales document number
FIF_SALESDOC_ITEM      Current sales document item

    8. Use Transaction SE91 to create the following messages:

                       Message class   : VFRR
Function        : Change (F6)

                       Message number  : 011
Message text    : No order number exists for determining control lines
Self-explanatory: X

                       Message number  : 012
Message text    : Account for 'deferred revenue' missing in item &2 of document &1
Self-explanatory: X

                       Message number  : 013
Message text    : Account for 'non-billed requests' missing in item &2 of document &1
Self-explanatory: X

    9. Use Transaction SE91 to change message VFRR007 as follows:

                       Message class  : VFRR
Function        : Change (F6)
Message number  : 007
Message text    : Accrual period not determined for doc &1 &2;
Self-explanatory: X
Long text       : Delete

    10. Implement the attached source code. To do that, use the Note Assistant.
    11. Save and activate the changed objects.
Explanations

If items relevant for revenue recognition are involved, the system always carries out an account determination. However, it depends on the following factors whether the determined clearing accounts are included in the corresponding condition record:

  • Have revenues been billed?     -> (VBUP-FKSTA 'AB')
  • Have revenues been recognized? -> (VBUP-RRSTA 'A')
  • Has the item been delivered?   -> (VBUP-LFGSA 'AB')
  • Does account 'Deferred Revenues' already exist on the database in the cross-company case?

The actual revenue account (SAKN1) is always redetermined and reset.

Therefore, the following applies for the individual document types:

    1. Sales documents/revenue recognition category 'A' and 'B' (Sales orders and credit/debit memo requests without reference, contracts)

                       You change and save a sales document for which revenues have already been recognized or billed. Instead of using the clearing account determined from the account determination for 'Deferred Revenues' (SAKN2), the system retains the clearing account that already exists in the corresponding condition record.

                       If no new pricing has been carried out for the sales document, the accounts are still contained in the internal table (TKOMV) and no change is required. This is different if pricing has occurred. In such a case, the accounts in the internal table were deleted. The database must be accessed to determine the conditions of the sales document (more precisely, the 'old' clearing accounts for 'Deferred Revenues') (function module: SD_GET_ACCOUNTS_FROM_KONV). These are then included in the internal table (TKOMV).

                       If the sales document contains items that are subject to the service-related revenue recognition (category 'B'), the system also checks the overall delivery status (VBUP-LFGSA). If deliveries were already created, the clearing account for 'Deferred Revenues' is maintained or determined as described above.

                       Since the clearing account for 'non-billed requests' is not stored in the conditions (KONV), the system determines this account on the basis of the control lines (VBREVK) in the above case. In this case it is assumed that there may be only one clearing account for 'non-billed requests' per item.

                       For newly added conditions, the system always redetermines the clearing accounts on the basis of the corresponding account determinations.

                       The system always uses the actual revenue accounts (SAKN1) from the account determination, that is, preceding documents or 'old' condition records are irrelevant.

    2. Contract release order including contract as a preceding document/revenue recognition category 'B'

                       For these documents, the account change functions have been excluded for the time being. A solution is delivered with Notes 798033 (Release 4.6C ), 811045 (Release 4.70) or 819805 (Release 5.00).

    3. Credit memo and debit memo requests with reference/revenue recognition category 'F'

                       If you create credit or debit memo requests with reference to a sales document or a billing document, the system determines the clearing accounts for 'Deferred Revenues' from the condition records of the corresponding sales document (for example contract or sales order).

                       The system gets the clearing account for 'non-billed requests' from the control lines (VBREVK) of the corresponding sales document.

    4. Billing documents/revenue recognition category 'A' and 'B' (including credit memos and debit memos without reference)

                       When you create a billing document, the system uses the clearing account for 'Deferred Revenues' from the condition records of the preceding document.

                       However, the fact also applies here that the accounts of the preceding document were deleted during a new pricing. Consequently, the system must read the conditions of the preceding document from the database to determine the 'old' clearing accounts for 'Deferred Revenues'.

                       The system always determines the corresponding clearing account for 'non-billed requests' on the basis of the corresponding control lines.

                       For newly added conditions, the system redetermines the clearing accounts for 'Deferred Revenues' using the account determination. If the corresponding control lines are missing for a redetermined clearing account, the following errors occur during the transfer to financial accounting:

    • S010 - No control line for item &2 in document &1
    • S012 - Account for 'restricted revenues' missing in item &2 of document &1
    • The same applies to clearing accounts for 'non-billed requests'. Here, the following error message occurs:
    • S013 - Account for 'non-billed requests' missing in item &2 of document &1

    • Of course, you can also post conditions of items relevant for revenue recognition directly to a revenue account. However, the condition must then be flagged accordingly. For further information, see Note 496721.
    5. Billing documents/revenue recognition category 'D'

                       When you create a billing document, the system always carries out an account determination for the 'deferred revenues' clearing accounts. The account determined is included in the corresponding condition record.

                       A clearing account for 'non-billed requests' is not required.

    6. Goods issue (deliveries)/revenue recognition category 'B'

                       When you post the goods issue, the system always gets the account for 'deferred revenues' from the condition records of the preceding document.

                       The system always determines the corresponding clearing account for 'non-billed requests' on the basis of the corresponding control lines.

    7. Credit memos and debit memos with reference to billing documents/revenue recognition category 'A' and 'B'

                       If you create credit memos or debit memos with reference to billing document, the system determines the clearing accounts for 'deferred revenues' on the basis of the condition records of the corresponding sales document (for example, contract, sales order).

                       The system gets the clearing account for 'non-billed requests' from the control lines (VBREVK) of the corresponding sales document.

    8. Special case of a cross-company-code process/revenue recognition category 'A' and 'B'

                       If a cross-company-code process is involved for a sales document, the system updates the account assignment information of the delivering company code in this document. If the sales document items are items relevant for revenue recognition, the system always carries out yet another account determination to redetermine the revenue accounts (SAKN1) or the clearing accounts (SAKN2) for 'deferred revenues' of the billing company code. This account information is buffered by the SD_BILLING_SAK_COND_TO_MEM function module and read later by the SD_BILLING_SAK_COND_FROM_MEM function module to generate the revenue recognition data correctly for the company code to be billed.

                       The actual account change logic does not differ from the one of the sales document without a cross-company-code process (see explanations for sales documents). The major difference is the storage of the clearing account for 'deferred revenues'. Since no clearing account is required for the delivering company code, the KONV-SAKN2 field can be used for the billing company code in the 'active' conditions of the sales document. That is, if a cross-company-code process is involved, the system stores the clearing account (SAKN2) determined from the account determination of the billing company code in the corresponding condition record and therefore in the KONV-SAKN2 field of the delivering company code. This ensures that postings are always made to the correct clearing account also in future revenue recognition processes.

                       Since the KONV-SAKN2 field included the clearing account of the delivering company code in a cross-company-code process before the implementation of this note, it must be clear in the future if the clearing account is a clearing account of the billing company code. Technically, this is solved by bit 6 of the bit-encrypted field from the KONV-KBFLAG condition table. That is, if the clearing account is clearing account 'deferred revenues' of the billing company code, this bit 6 is flagged. A more detailed documentation for this indicator is attached to the RR_CCDR data element which is used in the KONVFLAG data structure in the FIELD6 field. The conversion is made by the SD_BITS_TO_WORKAREA (import) and SD_WORKAREA_TO_BITS (update) function modules.

                       'Old' sales document items for which revenues have already been billed or recognized or that have already been delivered are a problem. In that case, the 'active' condition records have the clearing account for 'deferred revenues' of the delivering company code; in other words, the KONV-SAKN2 field includes a clearing account without bit 6 of the bit-encrypted KONV-KBFLAG field being set. If you change an account in Customizing now, you can no longer determine the 'old' clearing account for 'deferred revenues' of the billing company code when you save the change because this clearing account was stored neither in the sales document nor in Customizing. In this case, the system includes the redetermined clearing account for 'deferred revenues' (that was found by the account determination for the billing company code) in the 'active' condition record of the corresponding sales document item. The results are additional control lines (VBREVK) and new revenue lines (VBREVE) with new clearing accounts which may cause incorrect postings in the course of the further revenue recognition process.

                       If such 'old' sales documents exist and if you have changed clearing accounts in Customizing, the clearing accounts of the billing company code must be contained in the 'active' condition records of this document that were posted to by means of the revenue recognition in the past. You must not forget to set bit 6 in the bit-encrypted field KONV-KBFLAG in order to display the clearing accounts as accounts of the billing company code.

                       The system determines the clearing account for 'non-billed requests' in the same way as for a sales document without a cross-company-code process (see explanations for sales documents).

                       The system also carries out an account determination when you post the goods issue in the cross-company case. The system determines the accounts for the billing company code and uses the clearing accounts from the preceding document (if existing) in this process.
Remark

If you implement this note, you can change clearing accounts in Customizing without causing problems in the revenue recognition in general. However, bear in mind that clearing accounts are key information in the VBREVx tables, therefore you should make a thorough test after changing an account.

In addition, problems occur in the following processes:

    1. You change 'old' sales documents in the cross-company case (see section 'Special case of a cross-company-code process').

              The bit-encrypted KONV-KBFLAG field is only available as of Release 4.6A. Therefore, this function is not available for the cross-company case in Release 4.5B. This means that the system always redetermines the accounts for the billing company code via the account determination in that release.

    2. Use of conditions that only become 'active' in the future.

              A sales document item relevant for revenue recognition contains a periodic billing plan. For some dates, conditions exist that do not become 'active' until the future due to their validity date so that they do not exist in the sales document item. Therefore, no condition records exist in KONV either in which a clearing account for 'deferred revenues' could be updated.
On the other hand, these conditions are considered in the revenue recognition for future periods, that is, control lines (VBREVK) and revenue lines (VBREVE) already exist.
In other words, if future conditions have already been recognized or billed and if you have changed an account in Customizing, the system generates additional control lines and revenue lines for the redetermined clearing accounts. This may lead to incorrect postings in the course of the further revenue recognition process.

    3. Account change for contract release orders including contracts as preceding documents

              If the contracts are value contracts or quantity contracts with a service-related revenue recognition and if contract release orders were made for these contracts, this note does not yet support the account change in Customizing. This problem is solved by Notes 798033 (Release 4.6C), 811045 (Release 4.70) or 819805 (Release 5.00).

Affected Releases
Software Component Release From Release To Release And subsequent
SAP_APPL4646A46BX
SAP_APPL46C46C46CX
SAP_APPL470470470

Correction delivered in Support Package
Support Packages Release Package Name
SAP_APPL46CSAPKH46C45
SAP_APPL470SAPKH47012

Related Notes
957570Incorrect account for non-billed receivables (part 2)
892382Conditions relevant for Revenue recognition (new)
877121Incorrect account determination for unbilled revenues
862593Release finds accruals accounts other than contract
805094Incompleteness for conditions with exclusion
784827Missing accounts in VBREVK for new condition
784674M/AM version of Note 568227
777996Account settings for revenue recognition process
644296SD reconciliation account determintn for revenue recognition
389038Exceptions from SD_REV_REC_BILLING cannot be displayed