<?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 FM PROBLEM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205326#M132019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DEAR ALL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CAN I INCLUDE SUBROUTINE IN FUNCTION MODULE .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Apr 2006 09:51:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-10T09:51:48Z</dc:date>
    <item>
      <title>FM PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205326#M132019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DEAR ALL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CAN I INCLUDE SUBROUTINE IN FUNCTION MODULE .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2006 09:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205326#M132019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-10T09:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: FM PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205327#M132020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes U can add subroutine in FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Calling Subroutines&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You use subroutines for local modularization. Function modules can also use this technique. The function module that they call are defined in the corresponding main program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you only want to call a subroutine from a single function module, it is best to define them in the same include program as the function module itself, directly after the ENDFUNCTION statement. These subroutines can be called from all function modules in the function group, but for clarity, they should only be called from the function module that precedes them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to define a subroutine that will be called from several different function modules, you can define a special include program for it with the name L&amp;lt;fgrp&amp;gt;F&amp;lt;xx&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Subroutines&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&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;&amp;lt;b&amp;gt;Defining Subroutines&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A subroutine is a block of code introduced by FORM and concluded by ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM &amp;lt;subr&amp;gt; [USING   ... [VALUE(]&amp;lt;pi&amp;gt;[)] [TYPE &amp;lt;t&amp;gt;|LIKE &amp;lt;f&amp;gt;]... ] &lt;/P&gt;&lt;P&gt;            [CHANGING... [VALUE(]&amp;lt;pi&amp;gt;[)] [TYPE &amp;lt;t&amp;gt;|LIKE &amp;lt;f&amp;gt;]... ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;subr&amp;gt; is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM...ENDFORM block. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Calling Subroutines&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You call subroutines using the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM... [USING   ... &amp;lt;pi&amp;gt;... ] &lt;/P&gt;&lt;P&gt;                       [CHANGING... &amp;lt;pi&amp;gt;... ].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Subroutines can call other subroutines (nested calls) and may also call themselves (recursive calls). Once a subroutine has finished running, the calling program carries on processing after the PERFORM statement. You can use the USING and CHANGING additions to supply values to the parameter interface of the subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2006 09:55:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205327#M132020</guid>
      <dc:creator>vinod_gunaware2</dc:creator>
      <dc:date>2006-04-10T09:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: FM PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205328#M132021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can. Is your question the same or different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2006 09:57:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205328#M132021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-10T09:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: FM PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205329#M132022</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;yes you can do that, if you are creating it will ask you to include in the include ****F01 or you can do it in the same FM it self.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2006 10:02:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205329#M132022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-10T10:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: FM PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205330#M132023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope you are not asking for including the code for a routine within the function module code as follows. &lt;/P&gt;&lt;P&gt;This is not possible if that is what you are asking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION POPUP_TO_DISPLAY_VALUE.
*"-------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(COLBEG)
*"     VALUE(COLEND)
*"     VALUE(ITEMTXT)
*"     VALUE(TEXTLINE1)
*"     VALUE(TEXTLINE2)
*"     VALUE(TEXTLINE3)
*"     VALUE(TEXTLINE4)
*"     VALUE(TITLE)
*"-------------------------------------------------------

* Überschrift
  GLID-TITLE   = TITLE.
  GLID-ITEMTXT = ITEMTXT.

* Ausgabe
  GLID-TEXTLN1 = TEXTLINE1.
  GLID-TEXTLN2 = TEXTLINE2.
  GLID-TEXTLN3 = TEXTLINE3.
  GLID-TEXTLN4 = TEXTLINE4.

  CALL SCREEN 100 STARTING AT 40 COLBEG
                  ENDING   AT 75 COLEND.
&amp;lt;b&amp;gt;--&amp;gt; You can have a PERFORM statement between the
FUNCTION and ENDFUNCTION, but not the code of the FORM 
routine itself.&amp;lt;--&amp;lt;/b&amp;gt;
ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can either write the routine after this ENDFUNCTION &lt;/P&gt;&lt;P&gt;statment or create a seperate include as others here &lt;/P&gt;&lt;P&gt;explained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please close the thread if answered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Apr 2006 21:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-problem/m-p/1205330#M132023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-10T21:58:33Z</dc:date>
    </item>
  </channel>
</rss>

