{"id":7692,"date":"2025-09-02T00:56:00","date_gmt":"2025-09-01T19:26:00","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?question=what-is-bte-in-sap"},"modified":"2025-09-02T00:56:00","modified_gmt":"2025-09-01T19:26:00","slug":"what-is-bte-in-sap","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=what-is-bte-in-sap","title":{"rendered":"What is BTE in SAP?"},"content":{"rendered":"<p><strong>BTE (Business Transaction Event)<\/strong> is an enhancement technique in SAP used to <strong>insert custom logic into standard SAP processes<\/strong> <em>without modifying SAP\u2019s standard code<\/em>.<\/p>\n<ul>\n<li>Similar to User-Exits or BAdIs, but more specific to Financial Accounting (FI), Accounts Receivable (AR), Accounts Payable (AP), and related modules.<\/li>\n<li>It allows us to enhance SAP standard functionality during business transactions like posting documents, clearing open items, etc.<\/li>\n<li>Controlled by event numbers, which SAP triggers at predefined points in the standard process.<\/li>\n<\/ul>\n<h5>Where is BTE Used?<\/h5>\n<ul>\n<li>In <strong>FI<\/strong> (e.g., validations, substitutions in postings).<\/li>\n<li>In <strong>SD<\/strong> and <strong>MM<\/strong> indirectly via FI postings.<\/li>\n<li>Examples:\n<ul>\n<li>Triggering custom checks before posting an invoice.<\/li>\n<li>Sending data to a 3rd-party system after payment posting.<\/li>\n<li>Adding customer-specific logic during clearing.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h5>Steps to Implement a BTE<\/h5>\n<h6>1. Find the Relevant Event<\/h6>\n<ul>\n<li>Use Transaction FIBF \u2192 Environment \u2192 Info System \u2192 Business Transaction Events<\/li>\n<li>Search by process (e.g., FI posting).<\/li>\n<li>Example event: 00001030 \u2013 \u201cSample process for document posting\u201d.<\/li>\n<\/ul>\n<h6>2. Create a Product<\/h6>\n<ul>\n<li>Go to FIBF \u2192 Environment \u2192 Products \u2192 Of a customer<\/li>\n<li>Create a new product (<code>ZBTE_001<\/code>)<\/li>\n<li>Mark it as \u201cActive\u201d.<\/li>\n<\/ul>\n<h6>3. Assign the Event to Your Product<\/h6>\n<ul>\n<li>FIBF \u2192 Environment \u2192 Process Modules \u2192 Of a customer<\/li>\n<li>Enter the event (e.g., 00001030)<\/li>\n<li>Assign your product.<\/li>\n<li>Specify the <strong>function module<\/strong> that will run.<\/li>\n<\/ul>\n<h6>4. Create a Function Module<\/h6>\n<ul>\n<li>Copy a <strong>sample function module<\/strong> delivered by SAP (they start with <code>SAMPLE_PROCESS_...<\/code>).<\/li>\n<li>Create your own in customer namespace (<code>Z_...<\/code>).<\/li>\n<li>Add your logic.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>FUNCTION Z_BTE_DOC_POST.<br \/>\n*&#8221;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n*&#8221;*&#8221;Interface:<br \/>\n*&#8221; IMPORTING<br \/>\n*&#8221; VALUE(I_BKPF) TYPE BKPF &#8221; Document Header<br \/>\n*&#8221; VALUE(I_BSEG) TYPE BSEG &#8221; Document Line<br \/>\n*&#8221; EXPORTING<br \/>\n*&#8221; VALUE(E_SUBRC) TYPE SY-SUBRC<br \/>\n*&#8221;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nDATA: lv_msg TYPE string.<\/p>\n<p>&#8221; Example: Block posting if document type is SA and amount &gt; 10,000<br \/>\nIF I_BKPF-BLART = &#8216;SA&#8217; AND I_BSEG-DMBTR &gt; 10000.<br \/>\nMESSAGE &#8216;Manual journal entry &gt; 10000 not allowed&#8217; TYPE &#8216;E&#8217;.<br \/>\nE_SUBRC = 1. &#8221; Error<br \/>\nELSE.<br \/>\nE_SUBRC = 0. &#8221; Success<br \/>\nENDIF.<\/p>\n<p>ENDFUNCTION.<\/p>\n<p>&nbsp;<\/p>\n<h6>5. Test Your BTE<\/h6>\n<ul>\n<li>Run the transaction (e.g., <strong>FB01<\/strong> or <strong>F-02<\/strong> for posting).<\/li>\n<li>Your custom logic should trigger.<\/li>\n<\/ul>\n<h6>Example Use Case<\/h6>\n<p><strong>Business Requirement:<\/strong><br \/>Block manual journal entries (<code>Document Type SA<\/code>) above <code>10,000<\/code> unless entered by a specific user.<\/p>\n<p><strong>Implementation:<\/strong><\/p>\n<ul>\n<li>\n<p>BTE Event: <strong>00001030 (FI Document Posting)<\/strong><\/p>\n<\/li>\n<li>\n<p>Function Module: <code>Z_BTE_DOC_POST<\/code> (as shown above).<\/p>\n<\/li>\n<li>\n<p>Logic checks the <code>Document Type<\/code>, <code>Amount<\/code>, and <code>User<\/code>.<\/p>\n<\/li>\n<\/ul>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[158],"question_tags":[178,407,177],"class_list":["post-7692","question","type-question","status-publish","hentry","question-category-abap","question_tags-abap","question_tags-bte","question_tags-sap"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7692"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7692"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7692"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}