Ansicht
Dokumentation

FARR_BADI_EXTND_CHEK - BAdI: Extended Check Before Saving to Database

FARR_BADI_EXTND_CHEK - BAdI: Extended Check Before Saving to Database

PERFORM Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the Revenue Accounting (FI-RA) component. You can use this BAdI to check the data before it is committed and saved to the database table of Revenue Accounting.

Revenue Accounting generates and updates contracts from operational documents. During these processes, operational documents from the customer's operational or logistics systems are used. These operational documents can be sourced from an SAP system or a non-SAP system, and the data in these operational documents may change over time. There may also be errors in the customers' implementation or inconsistent data coming from the operational documents. Any of these factors can contribute to data inconsistency in Revenue Accounting. If incorrect data is generated and saved in the database, it takes great efforts to correct it. Therefore, this BAdI is designed as a preventative check before the inconsistent data is transferred to the database.

If any inconsistent data is detected by the preventative check, the system will stop the process of the corresponding contract. The inconsistency can be detected either from the processing of revenue accounting items (RAI) or a manual change on the user interface (UI).

  • If the inconsistency is detected from the revenue accounting item processing, the system stops the revenue accounting item processing and marks the impacted revenue accounting items with an error status. So the corresponding revenue accounting contract is neither created nor updated. However, in the case of mass processing, other contracts with no inconsistencies are still processed as normal and are saved to the database.
  • If the inconsistency is detected from manual changes, the system reports an error message without saving the revenue contract to the database.

By default, this BAdI checks whether:

  • the total amount of allocation effects for performance obligations in a revenue accounting contract is zero and the total allocated price of a contract is equal to the total transaction price.
  • the allocated amount of a performance obligation is equal to the total amount of all the periods from the revenue schedule for this performance obligation in the deferral item table.
  • the effective quantity of the performance obligation is equal to the total quantity of all fulfillments for an event-based performance obligation, if the performance obligation is fully fulfilled; the effective quantity of the performance obligation is equal to the total quantity of all fulfillments for a time-based performance obligation.
  • the effective quantity of a time-based performance obligation is equal to the scheduled quantity from the deferral item table and fulfillment table.
  • the latest deferral item flag is set correctly.
  • the total amount of posted revenues is equal to the scheduled number in the deferral item table.
  • the total amount of posted invoice corrections is equal to the invoiced amount in the deferral items.
  • the special indicator is populated correctly. This means that for every main price condition type from the sender component, the special indicator field must be populated with value 'P'. For each reconciliation key and performance obligation, there must be one condition indicated as the main price condition.
  • the allocation effect of a performance obligation is equal to the allocated amount minus the transaction price of this performance obligation.
  • the transferred invoice amount in FARR_D_INVOICE table is equal to the posted invoice amount in FARR_D_POSTING.
  • there is any performance obligation without deferral items.
  • transaction currency and local currency have different signs.
  • PAOBJNR is correctly maintained according to the settings in CO-PA.
  • deferral items are created, updated, or deleted correctly with the right reconciliation keys.
  • there are the following inconsistent situations during revenue accounting item processing for contracts with a fixed exchange rate method:
  • the fixed rates of the contracts are missing.

  • the currency keys in posting entries are different from those in the corresponding contracts.

  • The currency key settings at contract level are different from those at company code level.

  • the exchange difference is missing during invoice processing.

By implementing this BAdI, you can also perform the following tasks:

  • Disable the default checks listed above.
Suppose you want to disable some default checks because these checks are irrelevant or you only want to activate the checks in the test system. You can create your own implementation class and inherit the class CL_FARR_EXTENDED_CHECK. Then you override the method INIT_NO_CHECK_SETTINGS. In the implementation, set corresponding component NO_CHECK_EXX of MS_NO_CHECK to ABAP_TRUE so that you can disable the default checks.
  • Exclude certain contracts from the preventative check.
Suppose you want to exclude specific contracts from the checks because the amount that is resulted from the inconsistency is insignificant compared to the transaction price of the contract. You can create your own implementation class and inherit the class CL_FARR_DATA_EXTENDED_CHECK. Then override method CHECK_CONTRACT. When implementing PROCESS_INPUT, you copy the code for default implementation and add a condition check at the very beginning of the code to see whether the contract is in the exceptional list or meets certain criteria when reading IS_CONTRACT_DATA_BUFFER. If the condition is met, the system performs the checks.
  • Implement customer-specific check logics.
Suppose you want to implement some customer-specific checks. You can create your own implementation class and inherit the class CL_FARR_DATA_EXTENDED_CHECK. Then override method CHECK_CONTRACT. When implementing CHECK_CONTRACT, you first call the implementation of the superclass and then add your own logics after the super class implementation has been called.

For more information about the standard settings (filters, single or multiple uses), see the Enhancement Spot Element Definitions tab in the BAdI Builder (transaction SE18).

BAdI method documentation:

For information about implementing BAdIs as part of the Enhancement Framework, see the SAP Library for the SAP NetWeaver Platform on the SAP Help Portal at http://help.sap.com/nw_platform. Choose a release and then Application Help. In the SAP Library, choose SAP NetWeaver Library: Function-Oriented View -> Application Server -> Application Server ABAP -> Application Development on AS ABAP -> ABAP Customer Development -> Enhancement






rdisp/max_wprun_time - Maximum work process run time   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 8128 Date: 20240523 Time: 200115     sap01-206 ( 147 ms )