Skip to Content
Author's profile photo Former Member

Generic extractor using SUBMIT program

Generic extractor using SUBMIT program


The document will provide you step by step detail on creating a generic extractor and fetching the data using SUBMIT Program statement. The below development is done on the ECC as well as BW side.

Here is a scenario where we need to collect the data output of the TCODE ‘ZF126’ from ECC system and get it fetch in the BW system.Below are the steps involved:

Changes to be done in the program of the Tcode

     1.  Go to the Tcode ZF126.




   2. Once we press enter, we can see the Tcode ZF126 as below


3. When you go to System >> Status on the Menu bar, you will see the report program which is used to trigger the Tcode ZF126           (here the program is ZFRG_FICOR013_WTR_IN_V2)



4.  As we can see there are some mandatory fields in the TCode ZF126, in order to trigger the Tcode we create a variant for it.            (Here the variant created is WHTNEW). This variant WHTNEW will be called from the extractor using SUBMIT statement.


5. Ongoing through the program ZFRG_FICOR013_WTR_IN_V2 (the program of the tcode ZF126) ,we see that the program                returns the  data in an internal table li_zidwtfidoc.


6. Once we identify the internal table li_zidwtfidoc which returns the records from the program, we can use export                                 li_zidwtfidoc to a memory id so that we can have the records which are fetched in the internal table li_zidwtfidoc to be                       available in a memory id.


Changes to be done related to functional module extractor

1. Create a structure with the necessary fields. The Currency and quantity fields must have reference fields also (here the structure is ZWHT_VENDOR).                                  



NETWR is a currency field so it must have reference field that is in the base table. Click Currency / Quan and give that field name.



2. In transaction SE80, Select Function group, name RSAX. Right click and Copy.




3. Give the function group name and copy only the function modules which you require.Here we have copied FM                        ‘ZWHT_VENDOR_RSAX_BIW_GET_DATA’ from ‘RSAX_BIW_GET_DATA_SIMPLE’ and this is the only FM required for                Generic Extractor.



4. When we go to tables tab in the FM, we can see the E_T_DATA which is of type ‘ZWHT_VENDOR’, it is the structure                        which will hold the data returning from the FM.



5. In the Functional module extractor , we use submit statement to trigger the program ZFRG_FICOR013_WTR_IN_V2                       and get the records from the internal table li_zidwtfidoc. We use import statement to get the data of the internal table                       li_zidwtfidoc to an internal table it_idwtfidoc.


6. In addition to a simple  generic extractor , we have use  submit statement and then importing the values of internal table

    into an interanl table of generic extractor. .Please find the below code snippet in the attach file                                                      ZWHT_VENDOR_RSAX_BIW_GET_DATA.txt)  for the FM ZWHT_VENDOR_RSAX_BIW_GET_DATA used in this  scenario.

      Here is a link for a step by step procedure of simple  Function module generic extractor                                           

7. After completion of all the changes ,we can check in the TCode RSA3 whether the extractor is fetching data or not. Give the           Data source name ZWHT_VENDOR_EXTRACTOR and press enter, give the relevant details in the selections, once we press          execute, we can see the number of data records extracted (Here 8 records are fetched based on the selection).        /wp-content/uploads/2015/06/pic14_734742.jpg

Changes to be done on BW side

  1. On BW side , we need to go to ‘Choose Source system’ and select the relevant system under BI. (Here it is RDJCLNT370)


2. Once the source system is selected, we need to go to the Application Component which we gave  while creating the Function module extractor in R/3 side (here it is Financial Accounting (FI)). Right click on it and replicate metadata.


3. On completion of replicate metadata, We can see the data source ‘ZWHT_VENDOR_EXTRACTOR’ in the system.


4. In order to test whether data source is fetching data from ECC or not. We need to run the infopackage. We can see the data           records in the request monitor as below.


  5.  The Data in the PSA is as below.


This is the flow when we debug the entire process:

Go to Tcode rsa3, and give the data source name and the values to the selctions, and press extraction.


The debugger first goes to export statement in the FM ZWHT_VENDOR_RSAX_BIW_GET_DATA, and then to the submit statement.


Once the Submit statement is triggered, it then goes to import statement of the FM ‘Z_FI_WT_ALV_INTERFACE’ which is called in the program ‘ZFRG_FICOR013_WTR_IN_V2’ as show below


Once the submit statement is triggered, we export the records (8 records) of internal table li_zidwtfidoc to a memory ‘ZIDWTFIDOC’


As we have the internal table li_zidwtfidoc in the memory id, we import the internal table li_zidwtfidoc to another internal table it_idwtfidoc of the FM ZWHT_VENDOR_RSAX_BIW_GET_DATA from the memory id ‘ZIDWTFIDOC’.


As seen in the screenshot above, internal table it_idwtfodoc has 8 records which are from li_zidwtfidoc. Now as we have the data in an internal table it_idwtfodoc which is of the FM ‘ZWHT_VENDOR_RSAX_BIW_GET_DATA’, we can  process these records and pass it in the structure E_T_DATA which is the returning table of the FM.

Once the entire processing is done, we can see 8 records are extracted in the TCode rsa3


On pressing the ALV GRID button you can see the contents of the records extracted in ALV format.


Assigned Tags

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

      Nice explanation!! Its really useful document. Thanks.

      Author's profile photo Rachit Aggarwal
      Rachit Aggarwal

      Hi Ashish ,


      Request you please send me Function Module Code ..

      Because i am getting dump while using Submit Program .


      Mail :





      Author's profile photo Krishna Chivukula
      Krishna Chivukula

      very good explanation of extracting data via program. Good one Former Member . have you attach the code  ?

      Author's profile photo Maheshbabu Bodicherla
      Maheshbabu Bodicherla

      Hi Ashish,

      Requesting you to share FM code.




      Author's profile photo Abhay Patil
      Abhay Patil

      HI Ashish,

      This is really details explanation and useful.

      I would like add some more points and alternative way for without modifying ZPROGRAM (Step 6).

      1 ) Dynamically get the Internal table in the Function Module no need to use IMPORT/ EXPORT.

      2)  Send Internal table data as per packets size.


      FIELD-SYMBOLS : <lt_pay_data> TYPE ANY TABLE .

      DATA lr_pay_data TYPE REF TO data.


      cl_salv_bs_runtime_info=>set( EXPORTING display = abap_false
      metadata = abap_false
      data = abap_true ).



      cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = lr_pay_data ).
      ASSIGN lr_pay_data->* TO <lt_pay_data>.
      CATCH cx_salv_bs_sc_runtime_info.

      * MESSAGE `Unable to retrieve ALV data` TYPE 'E'.


      cl_salv_bs_runtime_info=>clear_all( ).

      i_to = s_s_if-maxsize.

      if lr_pay_data IS NOT INITIAL .

      * Store all the Zprogram internal table data to IT_TAB.
      LOOP AT <lt_pay_data> ASSIGNING <LT_TEST> .

      APPEND IT_TAB. " to e_t_data.

      *Divide data for 1st packet
      LOOP at IT_tab FROM i_start TO i_to.

      APPEND IT_TAB to e_t_data.


      i_start = i_to + 1.
      i_to = i_start + s_s_if-maxsize.

      *Divide data for next packet's
      LOOP at IT_tab FROM i_start TO i_to.

      APPEND IT_TAB to e_t_data.


      i_start = i_to + 1.

      i_to = i_start + s_s_if-maxsize.
      ENDIF. "First data package ?


      Thank you all.