Skip to Content

Introduction

This document details about generic extraction based on function module.

Scenario

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.

/wp-content/uploads/2012/11/1_155877.png

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

2.PNG

ECC Side

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

3.PNG

4.PNG

4a.PNG

5.PNG

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

6.PNG

7.PNG

Copy only the required function module.

8.PNG

9.PNG

3)  Now change this function module in TCode SE37.

10.PNG

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.

11.PNG

Go to Source code tab and enter the code.

code1.PNG

code 2.PNG

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

4) Create the Generic datasource in RSO2.

12.PNG

Give the function module name and extract structure name.

13.PNG

5) Generate the Datasource.  Check in RSA6.

14.PNG

6) Check your datasource in RSA3.

15.PNG

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

BI Side

1) Select the application component and replicate metadata.

/wp-content/uploads/2012/11/16_155933.png

17.PNG

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

/wp-content/uploads/2012/11/21_155935.png

/wp-content/uploads/2012/11/22_155936.png

3) Create InfoObjects.

18.PNG

19.PNG

20.PNG

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

23.PNG

24.PNG

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

/wp-content/uploads/2012/11/1_155877.png

/wp-content/uploads/2012/11/26_155945.png

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. 

To report this post you need to login first.

19 Comments

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

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

    Regards,

    Suman

    (0) 
    1. Anjali P 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.

      Regards,

      Anjali

      (0) 
    1. Anjali P Post author

      Thanks Renjith !!

      Have followed all your white papers on LO extraction…so 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.

      Regards,

      Anjali

      (0) 
  2. Srinivas .

    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…

    Thanks,

    Srinivas

    (0) 
    1. Anjali P 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.

      Regards,

      Anjali

      (0) 
  3. Vikrant Soni

    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.

    Thanks,

    Vikrant

    (0) 
  4. Atul Salgare

    Hello Anjali,

    Plz give me solution on delta update concept.

    Actually i m fetching data according to date (ERDAT) from multiple tables.now 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.

    (0) 

Leave a Reply