ABAP in Eclipse Create Function Module

Through this article we understand how to create function group and function module with Abap in Eclipse. We first create a function group and then create a function module with abap in eclipse.

ABAP in Eclipse Create Function Group

Right click on package to select New -> Other ABAP Repository Object .

ABAP in Eclipse Create Function Group and Function Module
ABAP in Eclipse Create Function Group and Function Module
ABAP in Eclipse Create Function Group and Function Module
ABAP in Eclipse Create Function Group and Function Module

Type func in the search box and select ABAP Function Group from the suggestions. Click Next.

ABAP in Eclipse Create Function Group and Function Module
ABAP in Eclipse Create Function Group and Function Module

Give the package name, function group name and description.

ABAP in Eclipse Create Function Group and Function Module
ABAP in Eclipse Create Function Group and Function Module

Click Next, select your transport request and click Finish.

The function group gets created.

ABAP in Eclipse Create Function Module
ABAP in Eclipse Create Function Module

Save, check and activate function group.

ABAP in Eclipse Create Function Group and Function Module
ABAP in Eclipse Create Function Group and Function Module

ABAP in Eclipse create Function Module

Every function module belongs to a function group. In the previous steps we created a function group, and now inside this function group we will create a function module.

Right click on package to select New -> Other ABAP Repository Object

ABAP in Eclipse Create Function Module
ABAP in Eclipse Create Function Module

In search box, type function and select Abap function module.

ABAP in Eclipse Create Function Module
ABAP in Eclipse Create Function Module

Click Next. Provide Name, description and function group name.

ABAP in Eclipse Create Function Module
ABAP in Eclipse Create Function Module

Click Next. Select your transport request and click finish. We get an empty function module.

FUNCTION ZAMARMN_FM
 " You can use the template 'functionModuleParameter' 
                           to add here the signature!
.

ENDFUNCTION.

In this function module, we need to code the import, exporting, changing or exceptions parameters as required. This is different from creating function module with ABAP GUI screens where in we add the interface to the function module through the various tabs available.

Create a simple function module with the below code and save, check and activate your work.

FUNCTION ZAMARMN_FM
  IMPORTING
    IV_CARRID TYPE SCARR-CARRID
  EXPORTING
    EV_SCARR TYPE SCARR.


SELECT SINGLE * FROM scarr INTO ev_scarr
    WHERE carrid = iv_carrid.

ENDFUNCTION.

The above function module has an importing and an exporting parameter with a small select single code. The idea is to understand how to create a function module with ABAP in Eclipse. Test your function module to see the result.

ABAP in Eclipse Create Function Module
ABAP in Eclipse Create Function Module