Está en la página 1de 3

Introduction

????????????Business Transaction Events (BTE)?allows attaching additional compon


ents, in the form of a function module to the R/3 system. Business transaction e
vents function in the same manner as customer exits
The standard program contains an enhancement in the form of a Business Transacti
on Event. The standard program calls a service function module, which determines
and processes the active implementation of the enhancement. The naming conventi
on 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 s
tores 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 Eve
nts.
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 fo
r duplicate AP invoices. This process is triggered when an invoice is posted int
o 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 in
voice number if it exists), invoice date, invoice amount (only if reference numb
er does not exist) and currency. Additionally, the duplicate check displays a wa
rning message only.
In this context, let's check for duplicate invoices for the?combination of refer
ence number and amount fields.?Additionally, the requirement is to flag a duplic
ate 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 docume
nt types.
- ???????? Configurations to enable and activate the BTE must be done prior to d
eveloping 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. Sele
ct 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 displ
ayed. 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 creat
e a product through the menu path: SETTINGS -> PRODUCTS -> ....of a customer. Th
en? 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 SETTI
NGS -> PROCESS MODULES -> ....of a customer.
- ??????????? Attach the Z function (ZFI_PROCESS_1110) to the product as shown i
n 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_INVO
ICE_CHECK for duplicate invoice entry. This FM triggers?Open FI 1110 event, whic
h 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 di
ffers. Hence this record gets posted.
- ???????? Try posting/parking the document through transaction FB60 with the sa
me value as in the first record in the above table (screen shot). Error should o
ccur 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/20
10; XBLNR = INVOICE1234; WRBTR = 2500.00?????????- ???????? Execute the Transact
ion 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 whil
e parking/posting the document.
Error is displayed only after activating the BTE.?????????
- ???????? Warning is dispalyed for the same value before activating the BTE.??

También podría gustarte