Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding the function modules

Former Member
0 Likes
477

Hi anybody pls tell me

what are the scenarios for the creation of function module

can you give me the some examples

thanks in advance

3 REPLIES 3
Read only

Former Member
0 Likes
457

Watch this thread

Read only

Former Member
0 Likes
457

<b>Function Modules</b>

Function modules are procedures that are defined in function groups (special ABAP programs with type F) and can be called from any ABAP program. Function groups act as containers for function modules that logically belong together. You create function groups and function modules in the ABAP Workbench using the Function Builder.

Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library. The R/3 System contains a wide range of predefined function modules that you can call from any ABAP program. Function modules also play an important role in database updates and in remote communications between R/3 Systems or between an R/3 System and a non-SAP system.

Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.

The Function Builder also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed

Read only

Former Member
0 Likes
457

hi ,

to create a function module :

whenever u need to use some specific function again n again u can make a function for it.

like if u need to mutiply by 1000 so the foll code can be used.

eg

FUNCTION Z_INTO_1000.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(INPUT) TYPE KWMENG

*" EXPORTING

*" VALUE(OUTPUT) TYPE KWMENG

*"----


output = input * 1000.

ENDFUNCTION.

regards,

sohi