Skip to Content
Author's profile photo Former Member

function module based generic extractor

FM based extractor

Requirement: To create a generic function module based extractor on ECC R/3 side.

a: first, we need to create the structure and function module and

b: then create the data-source.

c: Test the extractor.

Step1: Create Extract Structure in T-code Se11.

Select radio-button : data-type: enter name and press create button.

Enter the fields and description you would like to have in your data-source.

These fields you can get from standard tables from which you want to retrieve the data.




Step2: Create function module in t-code SE37.

The steps for function module are explained later in Step4.

Once we have the function module ready, we can go to Step3.

func module01.png

Step3: Enter details in RSO2 transaction: Application Component, function module, extract structure.

On BW side: The data-source will be visible in this application component



Press the field list button(F7), next to change pencil button, to set the selection parameters for the extractor.


The fields list will be coming from extractor.


Step4_01: Function module: Enter values in Tabs: Import, Tables, Exceptions as shown. Make sure the checkbox are selected.




Step 4_02: Place the code in Source code tab.


I have taken field from these tables, which are linked by a key like company code, financial transaction number or deal number.


I have attached the code later.

Step5: Test in RSA3. Give the extractor name and press enter.



We have got 21 records as our output.


Step6: Code Structure:


Part A

**1 – Tables and Internal tables declaration

Part B

**2 – Declare Output internal tables similar to Extract Structure

**3 – Declare selection screen and other counters

**4 – Capture Select ranges values

**5 – Capture Extractor

* Check DataSource validity

* Fill parameter buffer ranges for data extraction calls

Part C

**6 – Use Open Cursor for first and main select statement

**7 – Other Select Statements

**8 – Generate Output data

**9 Assign the final output internal table to E_T_DATA for result set

Sample code:

Step7: BW-side: Replicate the data-sources for the ECC Source system.

You will find your newly created data-source in the list of application

component.We know the application component we have chosen is TR-CM.

Create info-package and you can do the first load till PSA.


Assigned Tags

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

      Thanks a lot, it's really helpful.
      However it seems that your code allow to only load  1 datapakid. I assume it's because your datasource doesn't have to get a lot of records.
      How to handle it with many datapakids ?
      Is your code complete ?  I don't find any statement to close the cursor.

      Author's profile photo Amit Patil
      Amit Patil

      Just Saw the comment from someone but no reply from author - may be too late but might help someone in future..

      Just after the Select on main table put an Endif.

      and then post the remaining code after it and remove the extra endif.... it will break in multiple packets... 🙂