Enhancement Framework – Function Module Enhancement

By | June 2, 2014 | Enhancement Implementation | 5,299 | 3

Way to enhance the Function module to have additional logic. Functional enhancement can also be used for adding additional optional parameters in the FM Signature.

Enhance the Function Module logic

Function module logic enhancement is achieved via Source code enhancements. There are couple of implicit enhancement points available in every FM. These enhancement options can be implemented to enhance the functionality of the FM

To implement the enhancement point in the FM:
1 Display the FM in SE37
2 Make sure you are in the Source Code of the FM, Tab Source Code
3 From menu Select Function Module > Enhance Source Code
4 Select menu Edit > Enhancement Operations > Show implicit Enhancement
5 Once you see the implicit points, you can implement the implicit enhancement as described in Implementing Implicit Enhancement

FM_Source_Enhancement_1

Enhance the Function module Signature

Many times the enhancement in the source code is not quite enough. You may need to add the new parameters in the FM signature, either Importing or exporting.

Enhancement to FM Signature allows you to add new parameter to the FM signature. You can use this new parameter to make decision in your source code enhancements.

You might think – If you add the new parameter as importing parameter and what if callers wont pass that parameter, which is true in most of the cases. As you are extending the standard FMs and those FMs would be called somewhere in the system. Ignoring that parameter would lead to runtime time errors in the std FM calls. To avoid this Enhancement Framework, would create the new parameters as Optional. You can’t make them as mandatory.

To be able to create the Enhancement to the FM signature,
1 Display FM in SE37
2 Go to the tab where you want to add the new parameter
3 Select Menu Function Module > Enhance Interface

FM_Interface_Enhancement_1

4 Provide the Implementation Name
You can’t select the same implementation which you have used for the source code enhancements. However, you can collect all the FM Interface enhancements within same Function Group in one Function Module.

FM_Interface_Enhancement_2

Once you Enter the name of the Implementation and if it is successfully created, you would notice a new column with Enhancement Implementation in the signature table controls.

FM_Interface_Enhancement_3

5 Create the new Parameter. When you create the new parameter, it is by default set to Optional which is not changeable.

FM_Interface_Enhancement_4

6 Finally you can use this new parameter in the source code enhancements.

FM_Source_Enhancement_2

Next Article

Enhancement Framework – Table Enhancement Category

Table of Content – Enhancement Framework

Like It? Share!!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{273 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 273 articles.

Load comments

3 Comments

  • Anand

    Thank you.

  • Hi Naimesh

    Could you please explain in deeper about this topic data dictionary and bdc session method as well as background job scheduling and if have a time bapi. Or otherwise send me to any good pdf’s for me. I am new to sap.
    Please help me.
    email : phani.pbtech99@gmail.com.
    sorry ask this kind of issues. don’t feel any thing bad.

    Your blog is very good.

  • Tommas

    Hello Naimesh,
    great “enhancement series” :-) I wonder about this FM interface. It can by very usefull, but..
    I guess there is no way to enhance FM calls by adding these new parameters?

Comments on this Post are now closed. If you have something important to share, you can always contact me.

You seem to be new here. Subscribe to stay connected.