Skip to Content
Author's profile photo Kshitij Rameshrao Deshmukh

Easy steps to perform the DataSource Enhancement for the standard FI_GL/AR/AP Extractors/DataSource using ABAP Code through Business Transaction Event (BTE). Part -2

Applies to:

SAP NetWeaver Business Warehouse (formerly BI) – SAP BW 3.5 & 7.x. Versions.


The article explains the step by step procedure for DataSource Enhancement using ABAP Code for FI_GL/AR/AP Extractors through Business Transaction Event (BTE).

Table of Contents:

1. Introduction

2. Test Scenario for adding the extra fields into the standard 0FI_GL_4 extractor

3. Describing the Test Scenario

4. Related content


In many BW Projects, we have seen that most of the time we need to enhance the standard FI_GL/AR/AP extractors and pull the data apart from the base/origin tables on certain Business logic/requirement. In this scenario, enhancing the 0FI_GL_4 DataSource and adding the extra fields from the EKKO, EKPO, MEBW tables.

Test Scenario:

Following are the simple steps to achieve the DataSource Enhancement through BTE.

Below details of extra fields.


Vendor:                   EKKO-LIFNR                   into                ZZGR_LIFNR           (Extractor Field)

Plant in Stock:        EKKO-RESWK                into                ZZGR_RESWK         (Extractor Field)

Receiving Plant:     EKPO-WERKS                into                ZZGR_WERKS         (Extractor Field)

PO Quantity:          EKPO-MENGE               into                ZZGR_MENGE        (Extractor Field)

PO Price:                 EKPO-NETPR                 into                ZZGR_NETPR          (Extractor Field)

Standard Price:      MBEW-STPRS               into                ZZGR_STPRS           (Extractor Field)    

Now Go to T-Code: RSA6 and select the DataSource.


Select the DataSource and go inside the extract structure.


Select the include “CI_BSIS


Append the additional fields.


Note: Don’t forget to specify the reference table (DTFIGL_4/CI_BSIS) and reference fields for Quantity, Currency and Unit field.





Again, Go to: RSA6 and select the DataSource in edit mode.


Unchecked the additional fields, which is newly added in the structure.


Save & Activate the DataSource.

Now Coding Part to populate the data through BTE.

Go to T-Code: SE80 and copy the standard Function Module (Template) “SAMPLE_PROCESS_00005021” from the Function Group “BFFMSMPL3” with a new name for example:


Copy FM.jpg

Then Go to: SE37 and open the FM in edit mode ZBWFI_FILL_CI_00005021.



Write the code in Source code Tab:

“Details from EKKO:Purchasing Document Header

          SELECT  SINGLE          lifnr AS zzgr_lifnr

                                                reswk AS zzgr_reswk

          INTO  CORRESPONDING FIELDS OF <fs_dtfigl_4>


          FROM  ekko

          WHERE      ebeln = wa_bseg-ebeln.

“Details from EKPO:Purchasing Document Item

       SELECT  SINGLE           werks AS zzgr_werks

                                               menge AS zzgr_menge

                                               netpr AS zzgr_netpr

          INTO  CORRESPONDING FIELDS OF <fs_dtfigl_4>

          FROM  ekpo

          WHERE      ebeln = wa_bseg-ebeln

               AND      ebelp = wa_bseg-ebelp.

“Details from MBEW:Material Valuation

        SELECT  SINGLE           stprs AS zzgr_stprs

          INTO  CORRESPONDING FIELDS OF <fs_dtfigl_4>

          FROM  mbew

          WHERE      matnr = wa_bseg-matnr  “BSEG-MATNR

               AND      bwkey = wa_bseg-werks. “BSEG-WERKS

Save & Activate the FM.

And now test the DataSource in RSA3. And collect all objects into TR.


Replicate/Import the DataSource in the BW/etc. Targets  (Destination) and load the data into respectively Data Targets.

Related content:

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      So much helpful. Thanks for sharing.

      Author's profile photo Former Member
      Former Member

      Excellent Document!Thanks for sharing...