Skip to Content

Generic FM to fetch Data from ECC – ABAP resuable component for EP Developments

If our interest is to implement any master data activates using Enterprise portal, it is very much important to make sure that user enters correct data in his request for any activity – especially when the request under goes many approval levels using BPM.


in above 2 lines:

Master Data  : Customer master / Material Master / Vendor Master / GL Account.

Activities       : Creation / Change / Delimit / Deletion / Block / Extend.



We need GET_LIST or GET_DETAIL function modules to fetch the data from ECC, to display it as drop down in EP – Which makes sure that user enters valid data in his/her request.

Standard Example:






Problem Domain:

If there is no GET_LIST or GET_DETAILS or any other alternative function module to get the details of an object (sales orgs, distribution channels, division – for example), are we going to write one RFC function module for each object??


Generic RFC Function module to fetch data from given table / data base view.


The scope of this FM is to fetch 2 fields mentioned in FILEDS_LISTseparated by space (Preferably a code and its description) from the table or data base view mentioned at TABLE filtered with additional conditions mentioned in the FETCH_COND field.Exports the code at FIELD1, description at FIELD2 and Code, description concatenated and separated by ‘-‘ in FIELD3 of export table.

Key design points:


1. This is an application of dynamic internal table creation using Fields symbols, dynamic templates and classes.

 – Importing:

        TABLE           –

        FIELD_LIST    – 

        MAXLINES      – 

        FETCH_COND – 



Where ZEP_STRING is a structure

FIELD1   CHAR  10      Table Record

FIELD2   CHAR  50      Description of the Code

FIELD3   CHAR  65      Code – Description

2. The same FM can be used in case if code and descriptions are available in two or more different tables. Create one Data base view (not maintenance view in SE11 using appropriate tables) and use the same in TABLE import parameter.

3. Each line in the Function module code should be under at least one more than one TRY… CATCH Statements, to avoid technical errors .


  1. Avoid unnecessary RFC function modules by using single generic function module.
  2. Easy maintenance, which means, when ever there is a change in requirement it is very easy do change and deploy into EP as a model.
  3. Can be easily extended for multiple fields fetch.


  1. Fetch with complex Fetch condition. 
  2. Fetch data from more than one table.

Example 1:

Fetch Sales District details:


Result in EP:



Example 2:

Fetch data from more than one table.


This test data set is to fetch Reconciliation (MITKZ = ‘D’) GL Accounts for the given company code (BUKRS) and COA (KTOPL) in given language (SPRAS) – English.

The GL Account, Reconciliation Check and Description will be available in 2 different tables. Hence Create a table view ZEPV_RECONACNT, This is a database view for multiple tables as depicted below.

Tables : SKB1 & SKAT. And Join condition.


ABAP Development:

Click here.


 Thanks for reading, do not forget to leave your constructive comments, please.

You must be Logged on to comment or reply to a post.
    • Dear Pankaj,

      Here is the response from our EP Team - "WebDynpro for Java Programming using Java Connect (JCo) to connect to SAP ECC and fetch the data"

      Mohan Vamsi

      • Many people are now rewritting their WDJ apps as Web Dynpro ABAP in order to avoid all the hassles of RFC/JCo calls from Java.

        Just use the portal as an iView that starts the WD application in the ECC backend and you will use fewer resources in the portal.

    • Dear Michael,

      By using this Custom RFC - we can impose additional conditions on DATA Fetch, which is very much important for EP Development (on Performance point as well).


    • Dear Michale,

      Thanks for reading,

      Using this Custom Generic RFC we can impose additional conditions on data fetch, which is very important on performance stand point. Also, for example if you want to fetch field2, which is based on field1 which user already entered in EP request. Than we must have additional conditions on data fetch.

      Best regards,
      Mohan Vamsi

        • Yes Michael yours is valid point..!

          That import parameter OPTIONS, is used as the same way we used in our program.

          Let me use the same space to put the key differences. We had a performance challenge, hence we can't use SELECT & END SELECT.

          But finally, RFC_READ_TABLE can also be used for the same purpose, if there are no specific requirements.

          Thanks for your valuable inputs.

          Mohan Vamsi

          • SELECT...ENDSELECT is not normally the cause of performance issues. It is inappropriate activities inside the loop that are really to blame.
            If you can make a WHERE statement for SELECT that makes use of as many indexes as possible and doesn't return too many rows, then whether it is a SELECT...ENDSELECT or not shouldn't matter.