Skip to end of metadata
Go to start of metadata

 Business Transaction Events (BTE)
 
TABLE OF CONTENTSIntro
Checklist
To Implement BTE
Process Flow
Results

 


 


 

 

 

     

Introduction

            Business Transaction Events (BTE) allows attaching additional components, in the form of a function module to the R/3 system. Business transaction events function in the same manner as customer exits
The standard program contains an enhancement in the form of a Business Transaction Event. The standard program calls a service function module, which determines and processes the active implementation of the enhancement. The naming convention for these function modules is OPEN_FI_PERFORM_E (or OPEN_FI_PERFORM_P). This function module determines the active implementations for each enhancement and stores them in an internal table. The implementing function modules are processed in the sequence defined by the internal table.
In the SAP Customizing Implementation Guide (IMG), find the entry "Use business transaction events" under the "Financial Accounting Global Settings" node of the Financial Accounting area. Choosing this entry calls a transaction (FIBF) where you can execute all of the actions necessary for using Business Transaction Events.

This document explains how to implement BTE with an example.
            A vendor may send a duplicate invoice. Controls must be in place to check for duplicates and inform the user. SAP has a standard process to check for duplicate AP invoices. This process is triggered when an invoice is posted into the system.
The standard process in SAP checks for duplicates by comparing an invoice being entered with invoices already posted and/or parked. The duplicate check compares the following fields - company code, vendor number, reference number (vendor invoice number if it exists), invoice date, invoice amount (only if reference number does not exist) and currency. Additionally, the duplicate check displays a warning message only.
In this context, let's check for duplicate invoices for the combination of reference number and amount fields. Additionally, the requirement is to flag a duplicate with an error message (hard stop) if the above said combination is found.

Check List

-          Reference field will be configured as Mandatory for AP invoice document types.
-          Configurations to enable and activate the BTE must be done prior to developing the enhancement (transaction FIBF).
   

To implement BTE

Step -1:
-             Execute the Tcode BERP   and select the business process interface 00001110 then execute it.
 BERP transaction looks like this

 Click on "Process Interface' F4 in above screen. The below screen appears. Select 00001110 from the below screen
 
 After selecting the value from above screen press F8.
        -             Click on the button 'Sample function module' and you would be taken to SE37 and the sample function SAMPLE_PROCESS_00001110 would be displayed. Make a copy of this function module in to ZFI_PROCESS_1110.
   
After clicking on Sample Function Module, the screen moves to SE37

Below is the pseudo code required for the duplicate invoice check to be written inside FM

*---------------------------------------------------------------------*
*      Select The Existing Data From Bsip Table Into The Work Area
*---------------------------------------------------------------------*
  SELECT SINGLE belnr                     "Accounting Document Number
         xblnr                     "Reference Document Number
         wrbtr                     "Amount in document currency
         lifnr                     "Account Number of Vendor or Creditor
         bldat INTO                "Document Date in Document
        (wa_bsip-belnr,
         wa_bsip-xblnr,
         wa_bsip-wrbtr,
         wa_bsip-lifnr,
         wa_bsip-bldat)
      FROM bsip 
         WHERE xblnr = i_xblnr
         AND lifnr = i_lifnr
         AND  BUKRS = i_bukrs
         AND  BLDAT = i_bldat
         AND  WAERS = i_waers
         AND  WRBTR = i_wrbtr.
 *---------------------------------------------------------------------*
* If it Found Duplicate document then it show an Error Message
*---------------------------------------------------------------------*
    IF sy-subrc = 0 AND wa_bsip-belnr <> i_belnr.

 * display error message here

    ENDIF.

Step-2:
-             This step involves Business Transaction Event (BTE) configuration where the custom function module created in the step-1 should be made active in the BTE process.
 -             Execute the T-code FIBF for Business Transaction Events and create a product through the menu path: SETTINGS -> PRODUCTS -> ....of a customer. Then  create a product by clicking on 'NEW ENTRIES' button and  specify ZFI_INV as product then  save the product.

  -             Then we have to attach the Z-function module (ZFI_PROCESS_1110 ) created in the first step to this product. For this, follow the menu path SETTINGS -> PROCESS MODULES -> ....of a customer.

-             Attach the Z function (ZFI_PROCESS_1110) to the product as shown in the first line and save it. Now all are set.
     

Process Flow

Execute the transaction FB60
Enter Company, Vendor id, Reference key, Invoice date, Amount
Does a document already exist for the same Company / Vendor / Date / Reference / Amount?
Yes - > display an error message
No ->  Post the Document (Manual / Interface)
                       
When the T-code FB60 executed, it triggers the function module FI_DUPLICATE_INVOICE_CHECK for duplicate invoice entry. This FM triggers Open FI 1110 event, which calls FM  ZFI_PROCESS_1110.  

Results

  • BTE throws error if the XBLNR and WRBTR values are same.
  • Table BSIP which stores the posted/parked documents. 
    Note the second which has same values as the first record but the XBLNR value differs. Hence this record gets posted.

-          Try posting/parking the document through transaction FB60 with the same value as in the first record in the above table (screen shot). Error should occur if BTE is activated. Warning should be displayed if BTE is not activated.

-          The Values of the first record are LIFNR  = 2000042; BLDAT = 01/13/2010; XBLNR = INVOICE1234; WRBTR = 2500.00         -          Execute the Transaction code: FB60 for posting an invoice document.  Enter the Vendor code, Invoice date, Reference, amount as mentioned above.
   
As the Reference and Amount (marked in RED above) are same, error is thrown while parking/posting the document.

Error is displayed only after activating the BTE.         
-          Warning is dispalyed for the same value before activating the BTE.       

  • No labels

3 Comments

  1. It is really very useful documentation.

    Thanks you

    sai krishna

  2. Former Member

    Hi,

    Also check setting in OMRDC-OMSG-OBA5-OBA7 for the duplicate invoice check,

     

    Devendra

  3. Hello, i would like to ask if someone remember which BTE number is correct for "saving" documents in FI.

    I don´t remember if it´s 1130/1120

    What I need is to use a BTE to make SAP catch a number in a field and the document vendor position amount and send it to another system with and interface connection through the BTE.

    The user  won´t be able to have the document modifications if the does not complete  the field. For this I know there is a BTE.

    Thanks!!!