You can find the right BTE while putting the breakpoint in FM BF_FUNCTIONS_FIND.
After you get the BTE then go to FIBF then Create the product (Settings->Products->Of a Customer) and then Integrate the BTE with Product, Function module in (Settings->P/S Modules->Of a Customer ).
You can write you code in the Function module. Function module import and export parameters available with SAMPLE_INTERFACE_<BTE>.
Copy this BTE to your Custom function module then write your code. This FM integrate in the above mentioned point