<?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: How to convert Function Module to subroutine in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951613#M696047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not in front of system so can't explain using code.&lt;/P&gt;&lt;P&gt;But you have USING CHANGING and TABLES in subroutines whichcan be linked to IMPORTING EXPORTING/CHANGING TABLES in FM.&lt;/P&gt;&lt;P&gt;And for exceptions you need to write your error message using MESSAGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Oct 2007 15:11:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-17T15:11:54Z</dc:date>
    <item>
      <title>How to convert Function Module to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951608#M696042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How we can  convert functional module to subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example i want to convert gui_download ( function module ) to &lt;/P&gt;&lt;P&gt;     PERFORM GUI_DOWNLOAD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you pls elaborate this using some code sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Parnith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2007 14:42:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951608#M696042</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-17T14:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Function Module to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951609#M696043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's easy&lt;/P&gt;&lt;P&gt;perform gui_download using filename ...etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form gui_download using p_filename type ....etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'gui_download'&lt;/P&gt;&lt;P&gt;filename = p_filename&lt;/P&gt;&lt;P&gt;...etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Rob Dielemans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2007 14:52:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951609#M696043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-17T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Function Module to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951610#M696044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to paste all the code from that FM to subroutine. But doing this is not recommended.&lt;/P&gt;&lt;P&gt;FM- When the functionality can be used in many programs. Big logic&lt;/P&gt;&lt;P&gt;Subroutine - To modularise the code. Same functionality within progra.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2007 14:54:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951610#M696044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-17T14:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Function Module to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951611#M696045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt; can you pls let me know how actually we need to define parameters in that function module to parameters of subroutine.&lt;/P&gt;&lt;P&gt;And also how we need to code for exceptions in subroutine.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you pls explain me by taking one small example.( converting gui_download FM to &lt;/P&gt;&lt;P&gt;Form GUI_Download.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Parnith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2007 15:06:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951611#M696045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-17T15:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Function Module to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951612#M696046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all it is not a good idea to convert a fm into a subroutine. Why do you need to duplicate code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If at all you want to do that, you can see function module import parameter declaration and declare your parameters into subroutine in similar fashion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like GUI_DOWNLOAD has import parameter FILENAME declared as string, you can do the same in your routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For exceptions, as you are handling this in routine, you need to use message command. Either you can store all messages into a internal table and display at the end or you can show error message and stop processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2007 15:10:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951612#M696046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-17T15:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert Function Module to subroutine</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951613#M696047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not in front of system so can't explain using code.&lt;/P&gt;&lt;P&gt;But you have USING CHANGING and TABLES in subroutines whichcan be linked to IMPORTING EXPORTING/CHANGING TABLES in FM.&lt;/P&gt;&lt;P&gt;And for exceptions you need to write your error message using MESSAGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2007 15:11:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-convert-function-module-to-subroutine/m-p/2951613#M696047</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-17T15:11:54Z</dc:date>
    </item>
  </channel>
</rss>

