SAP ABAP: Using BTE in FB02 or FB03 to reflect changes made on FI document to Custom table

Requirements: Need to update custom table field when changes made on FI Document number.

We can use the BTE(Business Transaction Events) to capture changes made on a particular FI Doc.

Please follow these steps.
1) Execute Tx FIBF. Click on Menu-Evironment.

SAP ABAP BTE FB02 changes FI document Custom table

2). Select "Info system(P/S)".
 SAP ABAP BTE FB02 changes FI document Custom table

3). On the Publish & Subscribe Interfaces, just press the execute button.
SAP ABAP BTE FB02 changes FI document Custom table

4). Upon executing, it will list all existing P&S BTE. From the list, we will going to use the 00001110 - CHANGE DOCUMENT. This BTE will be fired up once the SAVE button is clicked. Double click the CHANGE DOCUMENT.
SAP ABAP BTE FB02 changes FI document Custom table

5). On the Interface Detail, click on the Sample function module button.
SAP ABAP BTE FB02 changes FI document Custom table

6). It will proceed to Transaction Function Builder.
SAP ABAP BTE FB02 changes FI document Custom table

7). Copy the function module to custom function.
SAP ABAP BTE FB02 changes FI document Custom table

8). Select function group.
SAP ABAP BTE FB02 changes FI document Custom table

9). On the function module source code, we could see the interface IMPORTING and the TABLES.
SAP ABAP BTE FB02 changes FI document Custom table

10). See sample codes to update custom table sgtext. From the interface parameters, you can do any logic or whatever requirements.
SAP ABAP BTE FB02 changes FI document Custom table

11). After implementing your logic, save and activate the custom function module then return to FIBF main screen. Click on Settings->Products->...of a customer.
SAP ABAP BTE FB02 changes FI document Custom table

12).  On the Change View, here we have to add the newly created function module. Click New Entries button.
SAP ABAP BTE FB02 changes FI document Custom table

13). On the New Entries, type in "ZBTE_T01" as our sampe Product under Product column and our custom function module which is "ztest_interface_00001110".
SAP ABAP BTE FB02 changes FI document Custom table

14). Click the Active checkbox column and then save.
SAP ABAP BTE FB02 changes FI document Custom table

15). Once saved, click the BACK button to return to FIBF main screen. Again, select Settings -> P/S Function Modules -> ...of a customer.
SAP ABAP BTE FB02 changes FI document Custom table

16). On the "Publish&Subscribe BTE: Customer Enhancement". We need to add new entries. Click on the New Entries button.
SAP ABAP BTE FB02 changes FI document Custom table

17).  On the Event column, type in the interface event which is "00001110".
SAP ABAP BTE FB02 changes FI document Custom table

18). On the Product column type in our newly created products which is ZBTE_T01 or you can select it from the list box.
SAP ABAP BTE FB02 changes FI document Custom table

19). Type in the function module "ZTEST_INTERFACE_00001110". Click SAVE.
SAP ABAP BTE FB02 changes FI document Custom table

20). Now that the BTE already created, we have to test it if it works perfectly. Execute Tx FB02 OR FB03.
SAP ABAP BTE FB02 changes FI document Custom table

21). On the Document Overview, we are going to change the LONG TEXT/SGTEXT of line item # 5.
SAP ABAP BTE FB02 changes FI document Custom table

22). Double click line item # 5 and type anything on the text field and then click SAVE button.
SAP ABAP BTE FB02 changes FI document Custom table

23). After clicking SAVE button, our sample BTE will be triggered and a Popup message informing custom table has been updated.
SAP ABAP BTE FB02 changes FI document Custom table

24). Additional example informing user that the field Long text of the custom table has been updated.
 SAP ABAP BTE FB02 changes FI document Custom table
That's all folks. Thank you.

Mabuhay, Philippines!

Comments

Post a Comment

Popular posts from this blog

SAP ABAP: Capturing CHECK BOX event in FM REUSE_ALV_GRID_DISPLAY / Cell Editing

SAP ABAP: Smartforms/SAPscript formatting

SAP ABAP: Adding leading zero to char or string.