<?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: sub routine in Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194653#M1002617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what i really want to know it what is the difference when ceating the subroutine in the FM itself just below the ENDFUNCTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the differenct when creating the subroutine in the include01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the only difference i see it that the first one i have to put USING since i can have access to my import parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while in the second way i have access to all my global variables including the import parameter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jul 2008 06:28:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-24T06:28:38Z</dc:date>
    <item>
      <title>sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194648#M1002612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to create a subroutin in a function module &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is it better to do like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION TEST.

perform f_routine using im_bukrs im_werks.

ENDFUNCTION.

form f_routine using im_bukrs im werks.
// here i have to use using import parameter since i wont have access to the import parameter
endform.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or i put the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform in another include let's say include01 but in this way will i have access to my import parameter directly without the USING&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194648#M1002612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T06:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194649#M1002613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put your form in include01. Declare valriables with same type as that of your import paramters in TOP include. pass your import parameter values to these varibles before calling the perform. now you can use those variables in your form.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:18:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194649#M1002613</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T06:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194650#M1002614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Newbie,&lt;/P&gt;&lt;P&gt; I dont think there is any performance issue or any kind of problem in your code you can use perform as you have used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sudharshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:19:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194650#M1002614</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T06:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194651#M1002615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Newbie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   If you are askign about the parameters used in the subroutines form (im_bukrs and im_werks), you can very well use them in your form as they are getting passed to the form with "USING" statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But one thing you need to chnage in the form statement to use this is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if im_bukrs is of type bukrs&lt;/P&gt;&lt;P&gt;  and im_werks if of type werks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you have to mention that in your form as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;form f_routine using im_bukrs type bukrs&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;im_ werks type werks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endform.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   and If you are asking about the Function module parameters  to use in form the you have to declare separately in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help&lt;/P&gt;&lt;P&gt;Reagrds.&lt;/P&gt;&lt;P&gt;Swarna Munukoti.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Swarna Munukoti on Jul 24, 2008 8:24 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Swarna Munukoti on Jul 24, 2008 8:25 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:23:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194651#M1002615</guid>
      <dc:creator>former_member217544</dc:creator>
      <dc:date>2008-07-24T06:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194652#M1002616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If ur subroutine is used by 1 Fm then u can put it with the FM definition. like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION TEST.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;perform f_routine using im_bukrs im_werks.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;form f_routine using im_bukrs im werks.&lt;/P&gt;&lt;P&gt;// here i have to use using import parameter since i wont have access to the import parameter&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;But if it is going to be used by multiple Fms then put it in a separate include program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if ur FM interface is global then u can access the import parameter(s) of ur FM directly within the subroutine without the USING clause. It is not dependent on where ur subroutine is defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;joy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194652#M1002616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T06:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194653#M1002617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what i really want to know it what is the difference when ceating the subroutine in the FM itself just below the ENDFUNCTION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the differenct when creating the subroutine in the include01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the only difference i see it that the first one i have to put USING since i can have access to my import parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while in the second way i have access to all my global variables including the import parameter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:28:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194653#M1002617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T06:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194654#M1002618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ...&lt;/P&gt;&lt;P&gt;Check the function grup inside which you have defined this FM. There will be other FMs.&lt;/P&gt;&lt;P&gt;If you want other FMs to use this subroutine, then declare the subrouting in an include of the function grup,&lt;/P&gt;&lt;P&gt;Other wise you can declare the subroutine as you have written.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:29:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194654#M1002618</guid>
      <dc:creator>former_member195383</dc:creator>
      <dc:date>2008-07-24T06:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: sub routine in Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194655#M1002619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION TEST.
 
perform f_routine using im_bukrs im_werks.
 
ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;you click on the routine and it will propose the include XXXXF01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it will create the Form some thing like below. since you are passing params to the routine, here you can work the parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form f_routine using  im_bukrs type bukrs
                              im werks type werks_d. 
// here i have to use using import parameter since i wont have access to the import parameter
endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sub-routine-in-function-module/m-p/4194655#M1002619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T06:35:14Z</dc:date>
    </item>
  </channel>
</rss>

