<?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: Regarding difference between Subroutines and Function modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004883#M77476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandrika,&lt;/P&gt;&lt;P&gt;The subroutines are basically modularized code of a report or a module pool program or even a function module.&lt;/P&gt;&lt;P&gt;But these subroutines are restricted to be used for that report or module pool program/function modules.So subroutines are program specific and so client dependent.You can alway have an include with subroutines written and u can use this include in different program, may it be a module pool program or a report.&lt;/P&gt;&lt;P&gt;Function modules are also client dependent and they when excuted for different clients will yield different results since they refer to client dependent tables in the system.&lt;/P&gt;&lt;P&gt;Although they may have interface same as subrotines like importing exporting changing and tables....&lt;/P&gt;&lt;P&gt;They can be independently used in any program.&lt;/P&gt;&lt;P&gt;So both they are reusable.&lt;/P&gt;&lt;P&gt;Please let me know for further clarifications.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Aug 2005 09:45:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-27T09:45:40Z</dc:date>
    <item>
      <title>Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004882#M77475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello evrybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether both subroutines and functional modules are client dependent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the technical difference between subroutines and function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;chandrika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Aug 2005 09:22:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004882#M77475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-27T09:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004883#M77476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandrika,&lt;/P&gt;&lt;P&gt;The subroutines are basically modularized code of a report or a module pool program or even a function module.&lt;/P&gt;&lt;P&gt;But these subroutines are restricted to be used for that report or module pool program/function modules.So subroutines are program specific and so client dependent.You can alway have an include with subroutines written and u can use this include in different program, may it be a module pool program or a report.&lt;/P&gt;&lt;P&gt;Function modules are also client dependent and they when excuted for different clients will yield different results since they refer to client dependent tables in the system.&lt;/P&gt;&lt;P&gt;Although they may have interface same as subrotines like importing exporting changing and tables....&lt;/P&gt;&lt;P&gt;They can be independently used in any program.&lt;/P&gt;&lt;P&gt;So both they are reusable.&lt;/P&gt;&lt;P&gt;Please let me know for further clarifications.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Aug 2005 09:45:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004883#M77476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-27T09:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004884#M77477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi chandrica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;following r the major differences between subroutine and function modules :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Functions can handle exceptions but subroutine cannot.&lt;/P&gt;&lt;P&gt;2.function module can be tested independently whereas  subroutine cannot.&lt;/P&gt;&lt;P&gt;3.FM returns value whereas subroutine may or may not return values.&lt;/P&gt;&lt;P&gt;4.FM globally called anywhere in ABAP program whereas subroutine always called before defining the subroutines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;rajdeep singh flora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Aug 2005 09:53:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004884#M77477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-27T09:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004885#M77478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandrika&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good design always looks for modularization and reuse of code. Subroutines and function modules are used for this purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In normal scenario, Subroutines are defined and used locally in a program. Although, you can use subroutines of other programs also, as well as you can define subroutines in a subroutine-pool and use in in many programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But main motive of subroutines is modularization of code so that it is easy to understand and maintain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function module is the bigger scenario for reuse of code. Main motive is to create the functionality once at database level and use it again and again. Also, it makes the code more reliable, if we know that function module is correct, we just need to use it correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish Jain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Aug 2005 09:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004885#M77478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-27T09:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004886#M77479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandrika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was looking at the responses given here for your question. I am sorry but I have to disagree with Karthik here. Client dependency or client independent does not come into picture in this discussion at all. Any piece of code(subroutines, function modules or programs etc) is client independent, which means if you write a piece of code in one client, then that is visible and can be executed from anywhere. Whether they work on client independent tables or client dependent tables, is up to the purpose of the code. There is no restriction that you cannot select data from client independent tables in sub routines or function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, another point made by Karthik that subroutines are specific to a program is not entirely true. If the subroutine logic and the parameters suit your purpose, you can always call a subroutine of another program in your program, even though it is rarely used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intended purpose of subroutines is to provide more modularization and readability, but added advantage is that it can also be used for reusability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intended purpose of function modules is more for reusability and encapsulation. So if you want to encapsulate certain reusable logic and provide a standard interface to the outside world. Please note that the primary stress here is on reusability and encapsulation and not on modularization, whereas in subroutines that is the primary purpose, but has the others as secondary benefits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A function module exists as an independent executable piece of code, but a subroutine can only be executed within a main program. So the context in which they are executed during runtime are different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these answers give you enough insight into the two constructs, please rewarad and close the post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Aug 2005 14:36:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004886#M77479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-27T14:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004887#M77480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Srinivas,&lt;/P&gt;&lt;P&gt;My purpose of declaring client dependency was to emphasize on the reasult they output.I completely agree that the piece of code u write is client independent but not the results.And the point that u mentioned that subroutines are not entirely program denpendent is not convincing, as the subroutines which u write as you have mentioned to suit your purpose is also an incude( right ) which i had mentioned in the earlier context; and has to be included in your program before use.&lt;/P&gt;&lt;P&gt;Thanks Bye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2005 05:01:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004887#M77480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-29T05:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding difference between Subroutines and Function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004888#M77481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Function Modules can be remote enable, which is not possible in subroutines.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 10:06:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-difference-between-subroutines-and-function-modules/m-p/1004888#M77481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-12T10:06:34Z</dc:date>
    </item>
  </channel>
</rss>

