Skip to Content

Generic extractor using SUBMIT program

Description:

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.

         

/wp-content/uploads/2015/06/pic1_734729.jpg

  

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


/wp-content/uploads/2015/06/pic2_734730.jpg

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)

      /wp-content/uploads/2015/06/pic3_734731.jpg

     /wp-content/uploads/2015/06/pic4_734732.jpg

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.

     /wp-content/uploads/2015/06/pic5_734733.jpg

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.

       /wp-content/uploads/2015/06/pic6_734734.jpg

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.

    /wp-content/uploads/2015/06/pic7_734735.jpg

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).                                  

     /wp-content/uploads/2015/06/pic8_734736.jpg

      

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.

       /wp-content/uploads/2015/06/pic9_734737.jpg

            

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

           

        /wp-content/uploads/2015/06/pic10_734738.jpg

          

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.

                    

      /wp-content/uploads/2015/06/pic11_734739.jpg


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.

                   

         /wp-content/uploads/2015/06/pic12_734740.jpg


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.

         /wp-content/uploads/2015/06/pic13_734741.jpg

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                                                     http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33?overridelayout=true

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)

      /wp-content/uploads/2015/06/pic15_734743.jpg

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.

       /wp-content/uploads/2015/06/pic16_734744.jpg

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

         /wp-content/uploads/2015/06/pic17_734745.jpg


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.

         /wp-content/uploads/2015/06/pic18_734746.jpg

  5.  The Data in the PSA is as below.

         /wp-content/uploads/2015/06/pic19_734747.jpg


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.

          /wp-content/uploads/2015/06/pic20_734748.jpg



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

           /wp-content/uploads/2015/06/pic21_734749.jpg


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


           /wp-content/uploads/2015/06/pic22_734750.jpg

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

          /wp-content/uploads/2015/06/pic23_734751.jpg


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’.


            /wp-content/uploads/2015/06/pic24_734752.jpg


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


              /wp-content/uploads/2015/06/pic25_734753.jpg


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


               /wp-content/uploads/2015/06/pic26_734754.jpg

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply