<?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 Function Modules as Methods in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405422#M536164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to call few FM as methods.  ANyone has ANy sample example for it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2007 03:13:20 GMT</pubDate>
    <dc:creator>prasad_reddy9</dc:creator>
    <dc:date>2007-06-28T03:13:20Z</dc:date>
    <item>
      <title>Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405422#M536164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to call few FM as methods.  ANyone has ANy sample example for it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 03:13:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405422#M536164</guid>
      <dc:creator>prasad_reddy9</dc:creator>
      <dc:date>2007-06-28T03:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405423#M536165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntactical constraints will not allow you to call function modules as methods. What you can do is define some methods in a class and inside the method implementation just call the FM in the same way as you call it from some other place. Then call the method using the syntax used for calling methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS: set_make&lt;/P&gt;&lt;P&gt;                IMPORTING im_make    TYPE string                                    &lt;/P&gt;&lt;P&gt;                                   im_model   TYPE string.   &lt;/P&gt;&lt;P&gt;ENDCLASS.                    "zl_lcl_vehicle DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   call function &amp;lt;FM name&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "set_make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.               "zl_lcl_vehicle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance of the vehicle class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT z_vehicle1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Normal Syntax for method calls&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD: z_vehicle1-&amp;gt;set_make EXPORTING im_make  = 'HYUNDAI'&lt;/P&gt;&lt;P&gt;                                              im_model = 'SANTRO'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Award points if found useful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 05:30:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405423#M536165</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T05:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405424#M536166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just few clarifications...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the importing, exporting and changing parameters of the FM must match the Methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What abt 'table' option option?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO we handle handle exceptions as events or just let the called FM raise its own messages?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 05:53:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405424#M536166</guid>
      <dc:creator>prasad_reddy9</dc:creator>
      <dc:date>2007-06-28T05:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405425#M536167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import a parameter in method - Export it to FM if required&lt;/P&gt;&lt;P&gt;Import a parameter from FM   - Use it in the method if required. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table option is for importing/exporting tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module will handle the exceptions defined in its interface and return the value in sy-subrc. You can check it and code some functionality depending on the value of sy-subrc. This depends on your requirement. If the FM  does not handle any exception that you want to handle, you can handle it explicitly using exception classes and TRY-CATCH statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you need any further clarifications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 06:02:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405425#M536167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T06:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405426#M536168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can u elaborate on the tables option?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know how to use it in FM's but in classes how do u handle it, especially for passing it to the FM inside the method? Just declare it in changing type of the class?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 06:06:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405426#M536168</guid>
      <dc:creator>prasad_reddy9</dc:creator>
      <dc:date>2007-06-28T06:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405427#M536169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the following piece of code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: ty_itab TYPE standard table OF sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;       Class (Definiton)  zl_lcl_vehicle&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Definition of Vehicle class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle DEFINITION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    METHODS: set_make&lt;/P&gt;&lt;P&gt;                IMPORTING value(im_itab) TYPE ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PRIVATE SECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA: gt_itab TYPE STANDARD TABLE OF sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "zl_lcl_vehicle DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;       Class (Implementation)  zl_lcl_vehicle&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       Implementation of Vehicle class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS zl_lcl_vehicle IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD set_make.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'Z_MOBILE_NUMBER_DIST'&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        t_in_slifght = im_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "set_make&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCLASS.               "zl_lcl_vehicle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaring a reference variable with reference to the vehicle class.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This vareiable contains a reference to an object of theclass&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA z_vehicle1 TYPE REF TO zl_lcl_vehicle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : gt_itab TYPE STANDARD TABLE OF sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create instance of the vehicle class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE OBJECT z_vehicle1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Normal Syntax for method calls&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD: z_vehicle1-&amp;gt;set_make EXPORTING im_itab = gt_itab.&lt;/P&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;&lt;P&gt;&amp;lt;b&amp;gt;Award points if found useful.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 06:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405427#M536169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T06:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405428#M536170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems FM may need to be called 'In Background Task' !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I cant seem to make the FM accpept importing parameters from the method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405428#M536170</guid>
      <dc:creator>prasad_reddy9</dc:creator>
      <dc:date>2007-06-28T07:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405429#M536171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the FM define a TABLES parameter and while calling the FM assign the table imported by the method to it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 07:21:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405429#M536171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T07:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405430#M536172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; It is helpful.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Can u elaborate on the tables option?&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I know how to use it in FM's but in classes how do u&lt;/P&gt;&lt;P&gt;&amp;gt; handle it, especially for passing it to the FM inside&lt;/P&gt;&lt;P&gt;&amp;gt; the method? Just declare it in changing type of the&lt;/P&gt;&lt;P&gt;&amp;gt; class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;short answer: yes&lt;/P&gt;&lt;P&gt;TABLES parameters are forbidden in OO context. You should not use them. They work only with STANDARD TABLE WITH HEADER LINE, which are forbidden in ABAP OO. Even when working with FMs you should not use them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2007 11:45:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405430#M536172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-28T11:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: Function Modules as Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405431#M536173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can always declare tables without header line. Thats not a problem I think.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to do this and the FM inside the method was not accepting the input parameters from the method. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Anyone has  a sample code for this type of a thing, it would be of immense help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2007 03:51:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-modules-as-methods/m-p/2405431#M536173</guid>
      <dc:creator>prasad_reddy9</dc:creator>
      <dc:date>2007-06-29T03:51:21Z</dc:date>
    </item>
  </channel>
</rss>

