Skip to Content
author's profile photo Former Member
Former Member

FM vs subroutines

Hello All,

What is the difference FM and subroutine. IF FM is global callable and subroutine is local to a program.

We can have include to define all the subroutines in a include and call them. correct?

What is the difference btwn FM and Subrotuine

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 03:34 PM

    Hi,

    <b>What is the difference between the function module and a normal ABAP/4 subroutine?</b>

    In contrast to normal subroutines function modules have uniquely defined interface.

    Sub routines do not return values.

    Sub routines do not return exceptions.

    Sub routines cannot be tested independently.

    Declaring data as common parts is not possible for function modules. Function modules are stored in a central library.

    Apart from those:

    <b>Subroutines :</b>

    1. You must have the same number of actual parameters as formal parameters , parameters are assigned in the sequence in which they are listed.

    2. When you call a subroutine using PERFORM, the system checks whether the types of the actual parameters in the PERFORM statement are compatible with the formal parameters.

    3. The interface is defined in the FORM routine. USING and CHANGING in the PERFORM statement are purely documentary.

    4. Internal tables are passed without their work area. You therefore need to declare one using a local DATA statement. Internal Tables must be passed by TYPE.

    <b>Function Modules :</b>

    1.Function modules are external subroutines with a transparent interface, optional parameters are allowed.

    2.Are central Repository objects, and are accessible system-wide. They are present as a set of function in a function module.

    3. Are developed and tested using the Function Builder

    4. Can be coded to RAISE exceptions

    Reward Points if this Helps.

    Manish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2006 at 03:31 PM

    Hi SDN FAN,

    and what about an RFC-CALL?

    Regards, Dieter

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.