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

Difference between Function Module and Subroutines

Former Member
0 Likes
956

Hi friends,

What is the "Difference between Function Module and Subroutines"

Cheers

R.Kripa.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
748

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,Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library,Unlike subroutines, you do not define function modules in the source code of your program.

Subroutines are procedures that you can define in any ABAP program and also call from any program. Subroutines are normally called internally, that is, they contain sections of code or algorithms that are used frequently locally. If you want a function to be reusable throughout the system, use a function module

reward points if it helps

regds

gunjan

5 REPLIES 5
Read only

Former Member
0 Likes
749

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,Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library,Unlike subroutines, you do not define function modules in the source code of your program.

Subroutines are procedures that you can define in any ABAP program and also call from any program. Subroutines are normally called internally, that is, they contain sections of code or algorithms that are used frequently locally. If you want a function to be reusable throughout the system, use a function module

reward points if it helps

regds

gunjan

Read only

Former Member
0 Likes
748

Hi Kripa,

In simple ,

Function Modules :<b> Global usage </b>(used in any pgm,any no)

Subroutines : <b>Within the Form </b>.

Rgds,

Jothi.

Mark Useful answers.

Read only

Former Member
0 Likes
748

Hi Friends,

I accept ... FM is global usage and Subroutine is for local usage ...

But still if we want a Functionality in a program say suppose "addition of 2 numbers" I can have that as a FM "ADD_2_NUMBERS" with 2 input parameters and one output parameter ....and similarly in the program itself i can have a subroutine to which i can pass 2 input parameters and one output parameter .....

If i want the same fucntionality in another program i can call the FM ..... But i can also call the Subroutine of the earlier program by using "SUBMIT" statement ...

So this is where iam not clear ???

Cheers

R.Kripa.

Read only

0 Likes
748

hi

as far as i understand..it's do woth global memmory and local memory allocation...it's just the way they are stored and ur usage fetches them from golbal or local memory....

thats it...

regards

gunjan

Read only

Former Member
0 Likes
748

Ok ... thanks for the answers ....

Cheers

R.Kripa.