Skip to Content
Author's profile photo Anjali P

Generic Extraction based on Function Module


This document details about generic extraction based on function module.


We go for Generic Extraction when the standard extractors doesn’t support the customer requirements. There are 3 types of generic extractors

1)Based on View/table

2)Based on Infoset Query

3)Based on Function Module

Business Scenario

We go for generic extraction based on a function module when we have to incorporate some logic to extract values.  For this we have to use ABAP coding.  In this document, I would like to discuss a business scenario in HR module.  There is a standard SAP table PA0041 – HR Master Record: Infotype 0041 (Date Specifications).  This table has values in the format (DAR01,DAT01 till DAR12, DAT12).  Sample format is given below.


We need it in the format (Sample given below).


ECC Side

1.  We need to create a structure based on PA0041 table fields.





2. There are 2 function modules which we can use in this scenario in the function group RSAX.

RSAX_BIW_GET_DATA_SIMPLE                                                       RSAX_BIW_GET_DATA

Extraction Method:     F2- Function Module ( Simple Interface).               F1- Function Module ( Complex Interface).

Data Load:                Full Load preferable.                                            Delta Load Preferable.

RSO2 Settings:         No effect of delta settings                                    Standard delta settings.

Here we need to copy and modify RSAX_BIW_GET_DATA_SIMPLE. First copy the Function Group, Change name and assign it to your Function Group.

For this Goto TCode-SE80



Copy only the required function module.



3)  Now change this function module in TCode SE37.


Go to the ‘Tables’ tab and associate E_T_DATA with your structure (which you created for extraction).

The E_T_DATA is the internal table used to contain the data you extracted from OLTP system, which is then passed to the BW system.


Go to Source code tab and enter the code.


code 2.PNG

Now save and activate the function module.  Activate the function group in SE80.

4) Create the Generic datasource in RSO2.


Give the function module name and extract structure name.


5) Generate the Datasource.  Check in RSA6.


6) Check your datasource in RSA3.


Here go to ALV Grid and check whether data is getting populated as required.

BI Side

1) Select the application component and replicate metadata.



2) Create an InfoPackage and extract the records to PSA.



3) Create InfoObjects.




4) Insert this InfoObject as Infoprovider to make it a datatarget.



5) Create transformation and DTP and fetch this records to this Characteristic InfoObject.



Go to contents and check the data.

Since time-dependency is enabled, 0DATETO and 0DATEFROM will be automatically added by the system of which 0DATETO will be a primary key.

If you need to have this InfoObject in report then you need to create a DSO or an InfoCube on top of this InfoObject and fetch that in the BEx Query Designer.

I understand that there are other documents available on this topic and that the logic is the same but this is a real-time scenario in which we worked on and I

hope somebody will benefit from it. 

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Suman Chakravarthy K
      Suman Chakravarthy K

      Hi Anjali,

      Your presentation is good. But, these type of documents(standard documents) which are already available in SCN since long time. I suggest you to create documents on which you came across any difficult real time scenarios. These documents will really help our SAP BI Consultants in their endeavors.



      Author's profile photo Anjali P
      Anjali P
      Blog Post Author

      Thanks Suman!! 

      The document got published automatically while I was working on it.  I have mentioned my thoughts on publishing the document at the end.  Thanks again for those valuable comments.



      Author's profile photo Renjith Kumar Palaniswamy
      Renjith Kumar Palaniswamy

      Hi Anjali,

      Very nice article. The flow is good.

      I would also suggest to write an article to handle delta scenarios in Function module based extraction.


      P Renjith kumar

      Author's profile photo Anjali P
      Anjali P
      Blog Post Author

      Thanks Renjith !!

      Have followed all your white papers on LO getting you to comment is an honor.   Thanks for taking time out to go through this document.

      Will surely try to write up on deltas on FM scenario.



      Author's profile photo Prashanth Konduru
      Prashanth Konduru

      Anjali ...

      Really nice Blog with good explanation ...


      Prashanth K

      Author's profile photo Anjali P
      Anjali P
      Blog Post Author

      Thanks Prasanth!

      Author's profile photo Former Member
      Former Member

      Hi Anjali,

      Based on this article, I had a doubt long time and now time to ask as I saw this point in this article.

      I see your generic datasource "ZPA0041DA" under your "SAP" tree structure.


      5) Generate the Datasource.  Check in RSA6.


      Is this behavior only for Function module or below types also?

      1)Based on View/table

      2)Based on Infoset Query

      Please let me know if any already written document to showup datasource under "SAP" node or provide your valuable inputs...



      Author's profile photo Anjali P
      Anjali P
      Blog Post Author

      Hi Srinivas,

      RSA6 holds all the active datasources in the activated state.  This includes SAP delivered datasources which are activated in RSA5 as well as custom datasources. Yes it includes all types of Generic DataSources.  I have an image but somehow the insert image is disabled.



      Author's profile photo Former Member
      Former Member

      Hi Anjali,

      Really nice blog Anjali and the flow very nice.

      Thanks & Regards,


      Author's profile photo Anjali P
      Anjali P
      Blog Post Author

      Thanks Ajith 🙂

      Author's profile photo Former Member
      Former Member

      Good one !

      Author's profile photo Sopharo Bin
      Sopharo Bin

      Hi Anjali,

      Good explanation. Thank a lot for this valuable document. 🙂

      Thank you,


      Author's profile photo Anjali P
      Anjali P
      Blog Post Author

      Thanks Todor and Sopharo!

      Author's profile photo Raman Korrapati
      Raman Korrapati

      Good presentation and very useful article. Thanks for making and sharing.


      Author's profile photo Former Member
      Former Member

      can u show the flow with fm for delta too??

      Author's profile photo Former Member
      Former Member

      Hi Anjali,

      Was going through you document.

      Nicely written and well explained. I found the ENDCASE, CLOSE CURSOR missing and a ENDIF statement without IF  in the logic. Kindly check and update it, also it would be nice if you explain the additional stuff in the ABAP code like usage of Cursor Statements etc, which will help folks to get a better understanding.

      Appreciate your efforts here.



      Author's profile photo Bhavesh Jain
      Bhavesh Jain

      Really Nice article. well explained.

      Author's profile photo Robinson Muñoz
      Robinson Muñoz

      Gracias.Excelente ayuda!


      Author's profile photo Atul Salgare
      Atul Salgare

      Hello Anjali,

      Plz give me solution on delta update concept.

      Actually i m fetching data according to date (ERDAT) from multiple i want to use delta update concept in RSO2. Should i use this ERDAT field for timestamp.

      while using ERDAT field as a timestamp,in RSO2 i want fetch data according to date,but as a select-option its not showing in RSO2.

      Author's profile photo Senthil Kumar
      Senthil Kumar

      Hi Atul,

      If a field is used as Delta-specific Timestamp field, then it wont be available as select-option. This field will be utilized by the external system when triggering the INIT/Delta load on extractor.
      Usually for Delta-enabled data sources, the timestamp value will be maintained in a SAP standard table ROOSGENDLM whenever the job is triggered from the external system.

      Fields DELTAID and REPEATID in ROOSGENDLM will hold the high and low values respectively.

      INIT load: When External system runs the INIT load this ROOSGENDLM table will be updated with DELTAID as current date and time (based on timestamp type). REPEATID will be blank in this case.

      Delta Load: ROOSGENDLM will be updated with the time interval as REPEATID as previous runs higher limit and DELTAID as current date and time.

      So records will be fetched based on the Timestamp values.