<?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: Help! Question on calling a function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205413#M132047</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are better to use export to memory with different ID for different hierarchy and refresh once is done. &lt;/P&gt;&lt;P&gt;This way is clean and can be used globally as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Apr 2006 01:42:18 GMT</pubDate>
    <dc:creator>ferry_lianto</dc:creator>
    <dc:date>2006-04-17T01:42:18Z</dc:date>
    <item>
      <title>Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205404#M132038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,everybody.&lt;/P&gt;&lt;P&gt;I have a problem about function module. I created a normal function module which would call itself when user double clicked some screen elements. But when I exit the function called in second time, the value of the global variants in function called in first time changed to the value in function called in second time. It seems that they shared the global variants. So is there any ease approach to recover the data to the original value?&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Apr 2006 03:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205404#M132038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-15T03:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205405#M132039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the same function is being called twice, apparently its the latest values which are set when the function called second time, will be retained. I don't think the initial values can be recovered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it must to implement a recusive function in your case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Apr 2006 03:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205405#M132039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-15T03:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205406#M132040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try not using global variants. Pass the value instead of using global.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sameena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Apr 2006 04:47:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205406#M132040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-15T04:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205407#M132041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;  you can use field-symbols instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IM_TEST is the importing parameter&lt;/P&gt;&lt;P&gt;EX_TEST is the exporting parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION ZTEST_RECURSION.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     REFERENCE(IM_TEST) TYPE  C
*"  EXPORTING
*"     REFERENCE(EX_TEST) TYPE  C
*"----------------------------------------------------------------------

field-symbols : &amp;lt;var&amp;gt; type c.
if im_test = 1.
assign im_test to &amp;lt;var&amp;gt;.
*&amp;lt;var&amp;gt; = 4.
elseif im_test = 3.
assign im_test to &amp;lt;var&amp;gt;.
endif.

if im_test = 1.
CALL FUNCTION 'ZTEST_RECURSION'
  EXPORTING
    IM_TEST       = '3'
          .

endif.

ex_test = &amp;lt;var&amp;gt;.
ENDFUNCTION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Kinshuk Saxena&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS reward points if you find the post helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Apr 2006 06:23:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205407#M132041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-15T06:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205408#M132042</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;in that case you need to export to memory before calling the Same FM. after calling the FM retrieve the same from memory. that way you can get back the old values.&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>Sat, 15 Apr 2006 06:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205408#M132042</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-15T06:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205409#M132043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all&lt;/P&gt;&lt;P&gt;So I think I must add some codes for retrieve the original value as Vijay Babu Dudla  said&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Apr 2006 02:45:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205409#M132043</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-16T02:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205410#M132044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think that is going to work, because the same EXPORT statement will FIRE when you CALL the FUNCTION for the SECOND TIME, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare a STATIS variable and EXPORT the values only of the variable is initial and after exporting, SET the field value to X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note : Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Apr 2006 03:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205410#M132044</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-16T03:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205411#M132045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why are you complicating the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple answer would be to use passby value mechanism in function module interface, as sameena said, if the value being spoke about is one of the parameters in the FM interface. If it a variable declared inside the function group (not a parameter), declare that locally instead of declaring it in the TOP include. In either case value changed in Call2 will not reflect back into Call1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you need more information on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraju Chidurupalli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Apr 2006 05:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205411#M132045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-16T05:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205412#M132046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nagaraju Chidurupalli,I need to transfer some values to screen, so defined some global variants. Is there any better way to do this?&lt;/P&gt;&lt;P&gt;Ravikumar Allampallam, I think I can export to the different ID KEY according to the different hierarchy of calling FM.&lt;/P&gt;&lt;P&gt;And another way I think it is maybe to use 'submit program' or 'call transaction' instead of 'call function', can it works?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Apr 2006 01:25:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205412#M132046</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-17T01:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205413#M132047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you are better to use export to memory with different ID for different hierarchy and refresh once is done. &lt;/P&gt;&lt;P&gt;This way is clean and can be used globally as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Apr 2006 01:42:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205413#M132047</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-04-17T01:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Question on calling a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205414#M132048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Recursive calls are very tricky and I really can't think of a reason that it would need to be done in an ABAP program. They are useful in system functions like sorts, but rarely used in business functions. I think you could do what you want much more easily with say, while/endwhile coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you must code recursively, look at your global variables after each call is returned. The test of any function is 'does it return the correct data?' Does yours?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this doesn't help, perhaps you could post your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Apr 2006 02:46:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-question-on-calling-a-function-module/m-p/1205414#M132048</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-17T02:46:41Z</dc:date>
    </item>
  </channel>
</rss>

