<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Diff between Function Module and subroutine in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735962#M899131</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many threads covering the exact same topic and I believe SDN has an excellent search functionality. Please use it.&lt;/P&gt;&lt;P&gt;One thing that may distnguish a FM module woud be that it shares its global memory across the Function&lt;/P&gt;&lt;P&gt;Group. The Function Group is loaded as a whole into memory with the first call. Any function module from the same group can then acess and share the same global data and acn access/modify it.It can be claimed that subroutines can be called this way too, in any program, by using &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; PERFORM xyz IN PROGRAM abc IF EXISTS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;. However, the global memory will depend upon the called program abc and since subroutines can be called in diffrent main program, global memory wont be shared. Please debug a few standard trasactions to understand how this is used in practice.&lt;/P&gt;&lt;P&gt;In essence, performs are more localized in context, FMs are more global. &lt;/P&gt;&lt;P&gt;Otherwise,I believe, FMs and subrotines can accomplish the exact same things.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Apr 2008 14:15:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-25T14:15:50Z</dc:date>
    <item>
      <title>Diff between Function Module and subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735957#M899126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  explain the difference between Function Module and Subroutine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 13:46:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735957#M899126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T13:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between Function Module and subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735958#M899127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Subroutines:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;   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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Function Modules:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 13:48:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735958#M899127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T13:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between Function Module and subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735959#M899128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;funtion modules                       subroutines&lt;/P&gt;&lt;P&gt;1.they can be tested by itself       1.they cannot .&lt;/P&gt;&lt;P&gt;2.they can be remote enabled      2.they cannot .&lt;/P&gt;&lt;P&gt;3.they can handle exceptions      3.Only a few can handle.&lt;/P&gt;&lt;P&gt;4.they have to be maintained in   4.It is not necessary.&lt;/P&gt;&lt;P&gt;  a function group.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 13:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735959#M899128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T13:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between Function Module and subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735960#M899129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;Generally Subroutines are used with in the programs. Even we can call the subroutines of other programs but in very rare cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If some functinality is global then we will create the function modules and use it across the programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possibles to call the subroutines of another system.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(Like from SAP to Non SAP or vice versa, One SAP system&lt;/STRONG&gt; &lt;STRONG&gt;to another) But this is possible with function modules by&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;*defining the FM as &lt;STRONG&gt;RFC(Remote function call).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Every FM must be associated with one function group. When u execute FM in one session for first time, whole function group will be loaded from the data base to application server.&lt;/P&gt;&lt;P&gt;In case of subroutines this will not happens. Control will directly goes to the code of another program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like this the list is end less. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 14:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735960#M899129</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-04-25T14:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between Function Module and subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735961#M899130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use a subroutine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can use it in any other program but we are not able to accesss it from other system.we are not able to pass exceptions in subroutines.it is created in a program means it is local.&lt;/P&gt;&lt;P&gt;in these we will use using,changing,using value and changing value to pass parameters means values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use a functional module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can use it from any other program and from any other system also(RFC functional module).we are able raise exceptions.it is created in se37.it is global.&lt;/P&gt;&lt;P&gt;in these we will use import,export,changing and tables to pass parameters and exceptions to raise exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 25, 2008 1:26 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 14:01:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735961#M899130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T14:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between Function Module and subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735962#M899131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are many threads covering the exact same topic and I believe SDN has an excellent search functionality. Please use it.&lt;/P&gt;&lt;P&gt;One thing that may distnguish a FM module woud be that it shares its global memory across the Function&lt;/P&gt;&lt;P&gt;Group. The Function Group is loaded as a whole into memory with the first call. Any function module from the same group can then acess and share the same global data and acn access/modify it.It can be claimed that subroutines can be called this way too, in any program, by using &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; PERFORM xyz IN PROGRAM abc IF EXISTS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;. However, the global memory will depend upon the called program abc and since subroutines can be called in diffrent main program, global memory wont be shared. Please debug a few standard trasactions to understand how this is used in practice.&lt;/P&gt;&lt;P&gt;In essence, performs are more localized in context, FMs are more global. &lt;/P&gt;&lt;P&gt;Otherwise,I believe, FMs and subrotines can accomplish the exact same things.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 14:15:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-function-module-and-subroutine/m-p/3735962#M899131</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T14:15:50Z</dc:date>
    </item>
  </channel>
</rss>

