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