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

fun mod

Former Member
0 Likes
341

how to handle errors in function modules

and

what is defference between function modules and subroutines

1 REPLY 1
Read only

Former Member
0 Likes
306

hi

good

difference between function module and subroutine

Fun modules are global programs

where as subroutines are LOCAL to a program

fun modules return values where as subroutines are not

Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.

You can create them from TCode SE37.

Go through the following doc:

Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.

Function Module Interfaces

The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:

Syntax

... IMPORTING parameters

EXPORTING parameters

CHANGING parameters

TABLES table_parameters

{RAISING

SUBROUTINES

definition

PERFORM FETCH_DATA using p1 p2

tables itab

changing p_v1

...

FORM FETCH_DATA using...tables...changing..

.............

ENDFORM.

thanks

mrutyun^