Documente Academic
Documente Profesional
Documente Cultură
Module
By Shweta Chavan, Hitachi Consulting
Introduction
Many times the existing functionality in standard function module is not sufficient for a developer. In such
cases, to little more functionality, we copy the standard FM and make the Z custom copy of it. Or else
create the custom new FM for extra functionality and call multiple function modules.
In SAPs new enhancement Framework, SAP has provided this new enhancement technique which allow
user to enhance the standard function module. So when there are small changes required we can
enhance the function module itself. Once we made changes in standard FM, new changes would be
available to all objects in environment.
This article will elaborate you the way to enhance the standard function module. Here we are taking
example of Function module LAST_WEEK. We are enhancing the parameters in EXPORT & TABLES
with source code enhancement. We will also be enhancing the global data to declare some new
variables.
First lets see the original function module, its parameters & output.
output:
Lets now enhance this function module. We will add one more parameter in Export which will give no of
holidays in that week. We will also add table which hold details on holidays. Once we enhance this
function module LAST_WEEK it will start giving more appropriate details of last week.
interfac
2. A pop-up will come to Create Enhancement Implementation. Give the details to create custom
implementation and click on , give the package and save.
2. An include file will be opened. Click on enhance button . Now select menu Edit Enhancement
Operations Show Implicit Enhancement Option.
3. First click anywhere on """""""" line and then right click on same line. Go to Enhancement
Implementation create Implementation.
1. Now we have to enhance the source code to populate values in our export & table parameters. Go to
source code click on enhance . Select menu Edit Enhancement Operations Show Implicit
Enhancement Option.
2. Go to last line of function module. Before ENDFUNCTION statement you will see the available implicit
enhancement. Implement custom enhancement by clicking right click and selecting Enhancement
Implementation create Implementation.
You will see the newly added parameters in Export & Tables.
Notes
All parameters which you add in IMPORT/EXPORT/TABLE must be optional. This will not affect
existing objects which are using function module.
SAP doesnt support this function level enhancement to all standard function modules. There are
some FM in central repository which never be enhanced like FM POPUP_TO_CONFIRM.