<?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: Fynction Modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753310#M902918</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;STRONG&gt;Pass by value&lt;/STRONG&gt; is not usually used for Normal Function modules, but for RFC enabled fuction modules.&lt;/P&gt;&lt;P&gt;RFC enabled FMs have slower performance when compared to Normal Fms since values are passed by value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A parameter can be made &lt;STRONG&gt;Optional&lt;/STRONG&gt; according to your requirement. &lt;/P&gt;&lt;P&gt;ie; it's not neccesary the calling program should supply a value for this paramter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Import&lt;/STRONG&gt; Parameter : Values transferred from the calling program to the function module. &lt;/P&gt;&lt;P&gt;You cannot overwrite the contents of import parameters at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A calling program will Export ie pass value to a Function module and the Function module will get the value by &lt;EM&gt;Import&lt;/EM&gt; ing it to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Export&lt;/STRONG&gt; Parameter : Values transferred from the function module back to the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a calling program had to get the value passed by a Function module,&lt;/P&gt;&lt;P&gt;The Function module should first &lt;EM&gt;Export&lt;/EM&gt; the data and the calling program will get the same as Import parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Changing&lt;/STRONG&gt; Parameter : Values that act as import and export parameters simultaneously. &lt;/P&gt;&lt;P&gt; The function module can alter the initial value and send it back to the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Tables&lt;/STRONG&gt; Parameter :  (Not recommended / Obsolete in ECC 6.0)&lt;/P&gt;&lt;P&gt;Internal tables that can be imported and exported. The function module can alter the contents. Tables are always passed by reference.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Refer : [Calling Function Modules|http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98ef35c111d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Remi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2008 08:12:10 GMT</pubDate>
    <dc:creator>RemiKaimal</dc:creator>
    <dc:date>2008-05-02T08:12:10Z</dc:date>
    <item>
      <title>Fynction Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753309#M902917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is meant by checking check box optional or  Pass by value or  optional and  Pass by value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the reason for import, export, and changing parameters can be used either by value or by reference. &lt;/P&gt;&lt;P&gt;Table parameters are always transferred by reference ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, calrrify for things in Function Modules, I have gone through many documents, but still I am confusing with those Optional and Pass by value for all those parameters ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance..&lt;/P&gt;&lt;P&gt; Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 06:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753309#M902917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T06:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fynction Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753310#M902918</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;STRONG&gt;Pass by value&lt;/STRONG&gt; is not usually used for Normal Function modules, but for RFC enabled fuction modules.&lt;/P&gt;&lt;P&gt;RFC enabled FMs have slower performance when compared to Normal Fms since values are passed by value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A parameter can be made &lt;STRONG&gt;Optional&lt;/STRONG&gt; according to your requirement. &lt;/P&gt;&lt;P&gt;ie; it's not neccesary the calling program should supply a value for this paramter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Import&lt;/STRONG&gt; Parameter : Values transferred from the calling program to the function module. &lt;/P&gt;&lt;P&gt;You cannot overwrite the contents of import parameters at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A calling program will Export ie pass value to a Function module and the Function module will get the value by &lt;EM&gt;Import&lt;/EM&gt; ing it to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Export&lt;/STRONG&gt; Parameter : Values transferred from the function module back to the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a calling program had to get the value passed by a Function module,&lt;/P&gt;&lt;P&gt;The Function module should first &lt;EM&gt;Export&lt;/EM&gt; the data and the calling program will get the same as Import parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Changing&lt;/STRONG&gt; Parameter : Values that act as import and export parameters simultaneously. &lt;/P&gt;&lt;P&gt; The function module can alter the initial value and send it back to the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Tables&lt;/STRONG&gt; Parameter :  (Not recommended / Obsolete in ECC 6.0)&lt;/P&gt;&lt;P&gt;Internal tables that can be imported and exported. The function module can alter the contents. Tables are always passed by reference.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Refer : [Calling Function Modules|http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98ef35c111d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Remi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753310#M902918</guid>
      <dc:creator>RemiKaimal</dc:creator>
      <dc:date>2008-05-02T08:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Fynction Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753311#M902919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;U&gt;Pass by value :&lt;/U&gt; It means you pass the value of the vparameter to the FM from the main program ( from where you called the FM) . In this case, if the value get changed inside the FM , it will not be reflected in the main program ( as the value stored in the memory address do not changed). the memory address retain the old value. So the effect of the change will only be visable inside the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Pass by referance :&lt;/U&gt;Here instead of passing the value of the parameter, you pass the memory address of the parameter. So if the value get changed inside the FM, the change happen in the memory address. So the effect get reflect in the main program also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Refer the following example:&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ytestab.

DATA: gc_flag TYPE c VALUE 'X'.

CALL FUNCTION 'ZTESTFM1'
  EXPORTING
    lp_flag       = gc_flag.
           
write: gc_flag.


FUNCTION ZTESTFM1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  CHANGING
*"     REFERENCE(LP_FLAG1) TYPE  C1
*"----------------------------------------------------------------------


field-symbols: &amp;lt;FC&amp;gt; type any.
data: lv_text(16) type c value '(YTESTAB)GC_FLAG'.

Assign (lv_text) to &amp;lt;FC&amp;gt;.
if sy-subrc EQ 0.
&amp;lt;FC&amp;gt; = 'M'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;It is pass by referance and the output will be 'M'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ytestab.

DATA: gc_flag TYPE c VALUE 'X'.

CALL FUNCTION 'ZTESTFM1'
  EXPORTING
    lp_flag       = gc_flag.
           
write: gc_flag.


FUNCTION ZTESTFM1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  CHANGING
*"     VALUE(LP_FLAG1) TYPE  C1
*"----------------------------------------------------------------------

field-symbols: &amp;lt;FC&amp;gt; type any.
data: lv_text(16) type c value '(YTESTAB)GC_FLAG'.

Assign (lv_text) to &amp;lt;FC&amp;gt;.
if sy-subrc EQ 0.
&amp;lt;FC&amp;gt; = 'M'.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;It is pass by value and the output will me 'X'.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:36:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753311#M902919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T08:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Fynction Modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753312#M902920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SRIDHAR  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Just saying in simple language &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPTIONAL in FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Importing parameters that meance the value we want for FM can be made optional .That meanse we dont have to give the value while calling that FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass by Value and pass by Reference  , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two ways to send or receive the importing or exporting parameters     pass by value  and  pass by reference &lt;/P&gt;&lt;P&gt;In pass by value  new copy of veriable is created on memory location of system and that is send .In pass by reference just only the memory location is send in parameters so duplications of values can be avoided.  As we know the internal tables are big in size .so it always used pass by reference so only memory location can only send insteded of whole table .Its imp consept ,same asked for Certification.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Avadhut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 08:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fynction-modules/m-p/3753312#M902920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T08:50:46Z</dc:date>
    </item>
  </channel>
</rss>

