<?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: Call function in unique context in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732383#M1948921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have an issue with your Z-function : global (or statics) variables not being cleared, which is the problem if the RFC connection was left alive between 2 calls. You may test the issue quickly by using RFC_CONNECTION_CLOSE between 2 calls.&lt;/P&gt;&lt;P&gt;I don't think you need to investigate the other "solutions" (i.e. tRFC or these TRANSACTION_* function modules)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2016 15:25:13 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2016-07-13T15:25:13Z</dc:date>
    <item>
      <title>Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732382#M1948920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am implementing an function module which is able to be called by RFC. Inside this function a table - which is overtaken from the external system - will be processed by a regular loop.&lt;/P&gt;&lt;P&gt;For the RFC result I have to call an other function module (Z-function) and take over the result of this Z-function to the RFC result structure.&lt;/P&gt;&lt;P&gt;The Z-function itself is also ablte to be called direclty via RFC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently it seems that there are any side effects with this Z-Function. So we have some strange situations were the Z-function is not delivering any result and we don't know why...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like I already said the Z-function itslef is also configured as an RFC service and addtionally it is used inside a web service definition.&lt;/P&gt;&lt;P&gt;If an external program is using the web serice (single call) the problem with wrong result does not occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my opinion the problem is an internal problem of the Z-function. Something that the context is not initalisized after first loop or something like this. Because the problem with wrong result do just occur in a multiple call (this means: 1. Call, 2. Call,...) inside loop...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The questions is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Is there any possibility to initalize the context of an Z-function?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- Can I call a Z-function in a separate unit and wait for the result of it?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think about to call the service internaly with "IN BACKGROUND TASK AS SEPARATE UNIT" but then I will never get the result back. But something like this is necessary - if we have the right assumption.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I found the function TRANSACTION_BEGIN and TRANSACTION_END for BAPI implementation. So I saw that these functions will create/open a transaction as bracket for further function calls. But does it really help if I just call TRANSACTION_BEGIN, Z-FUNCTION, TRANSACTION_END?&lt;/P&gt;&lt;P&gt;Means new transaction = separate unti / new context?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 14:52:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732382#M1948920</guid>
      <dc:creator>christian_swonke</dc:creator>
      <dc:date>2016-07-13T14:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732383#M1948921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have an issue with your Z-function : global (or statics) variables not being cleared, which is the problem if the RFC connection was left alive between 2 calls. You may test the issue quickly by using RFC_CONNECTION_CLOSE between 2 calls.&lt;/P&gt;&lt;P&gt;I don't think you need to investigate the other "solutions" (i.e. tRFC or these TRANSACTION_* function modules)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 15:25:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732383#M1948921</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-07-13T15:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732384#M1948922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have 2 functions (it doesn't matter they are RFC): the first one calls the second one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second fm works fine if it's called alone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First question: these two fm belong to the same function group?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 15:36:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732384#M1948922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-07-13T15:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732385#M1948923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that's exactly correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No the two functions belong to different function groups.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 10:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732385#M1948923</guid>
      <dc:creator>christian_swonke</dc:creator>
      <dc:date>2016-07-14T10:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732386#M1948924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, as Sandra writes, &lt;SPAN style="font-size: 10pt;"&gt;try to check how the global data are managed or initialized: probably they have still some values set in the previous steps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;It needs to consider the global data are automatically cleared only where the whole session is finished and closed&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 10:54:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732386#M1948924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-07-14T10:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732387#M1948925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And, again, "You may test [whether] the issue [still occurs,] quickly by calling RFC_CONNECTION_CLOSE between 2 calls". If it doesn't happen anymore, then probably there's some global data somewhere which needs to be cleared...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 12:36:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732387#M1948925</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-07-14T12:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732388#M1948926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have changed the implementation now. During the loop in function A, I call now the second Z-function B with destination NONE and afterwards the function RFC_CONNECTION_CLOSE will be called. The result is similar than before. So no side effects in this point...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that I can not rebuild thev constellation from productive environment which I described before in test enviroment.&lt;/P&gt;&lt;P&gt;It seems that I have to send the changed objects to productive to see if it is helpful or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In productive environment we talk about 200000 calls from external systems per day. Have I anything to keep in mind depending on processes our system performance depending to this change?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2016 22:19:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732388#M1948926</guid>
      <dc:creator>christian_swonke</dc:creator>
      <dc:date>2016-07-14T22:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732389#M1948927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can't reproduce a problem, it's useless changing the code unless you want to transport it to do the test in another system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to make things clear, you have now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In system 1, there is a:&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'A' DESTINATION 'system 2'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In system 2, we have:&lt;/P&gt;&lt;P&gt;FUNCTION A.&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOOP AT itab...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'B' DESTINATION 'none'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'RFC_CONNECTION_CLOSE' DESTINATION 'none'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Okay for the workaround, to test whether it corrects the issue, but not good for performance.&lt;/P&gt;&lt;P&gt;You should define a way to activate or deactivate it externally, something like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF external condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'B' (as before)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'B' DESTINATION 'none'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'RFC_CONNECTION_CLOSE' DESTINATION 'none'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Personally, I would do everything I can to reproduce the error in another system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2016 10:27:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732389#M1948927</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-07-15T10:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Call function in unique context</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732390#M1948928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it seems to work on productive enviroment. Thank's for your support!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 14:28:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-function-in-unique-context/m-p/11732390#M1948928</guid>
      <dc:creator>christian_swonke</dc:creator>
      <dc:date>2016-07-26T14:28:44Z</dc:date>
    </item>
  </channel>
</rss>

