<?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: Connection between Two servers : FM Required in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661773#M614070</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neeraj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For every RFC function call you need handle two additional exceptions apart from what is being used in that FM. These exceptions are,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) SYSTEM_FAILURE&lt;/P&gt;&lt;P&gt;2) COMMUNICATION_FAILURE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But these exceptions should not be mentioned in the Exception tab while creating this RFC enabled FM. So, if the other logical system is down or some problem in connecting to this logical system, these exceptions shall be raised. And you can check by the return variable SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points for all useful answers !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2007 09:10:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-23T09:10:09Z</dc:date>
    <item>
      <title>Connection between Two servers : FM Required</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661772#M614069</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;I'm doing one report which calls RFC enabled Z function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module is connecting to another SAP system through Logical system name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the connection fails, then I need to pass an error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please tell me the FM name or way to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will be rewarded for the correct solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Neeraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 08:47:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661772#M614069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T08:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Connection between Two servers : FM Required</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661773#M614070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neeraj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For every RFC function call you need handle two additional exceptions apart from what is being used in that FM. These exceptions are,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) SYSTEM_FAILURE&lt;/P&gt;&lt;P&gt;2) COMMUNICATION_FAILURE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But these exceptions should not be mentioned in the Exception tab while creating this RFC enabled FM. So, if the other logical system is down or some problem in connecting to this logical system, these exceptions shall be raised. And you can check by the return variable SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards points for all useful answers !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Ranganath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 09:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661773#M614070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T09:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Connection between Two servers : FM Required</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661774#M614071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Neeraj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RFC-enabled function modules should not raise exception within their coding because otherwise the RFC connection will break down. Therefore, your z-function module should not have any exceptions. Instead collect A/E/X messages and return them - like BAPIs do - in an TABLES or EXPORTING parameter of type BAPIRET2 (or BAPIRETTAB).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call your function module like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA:
    ld_rfc_failure   TYPE bapi_msg,
    lt_return         TYPE bapirettab.

  CALL FUNCTION 'Z_MY_RFC_FUNC'
    DESTINATION 'rfc destination'
    EXPORTING
      ...
    IMPORTING
     ...
      et_return = lt_return  " collected messages
   TABLES
     ...
   EXCEPTIONS
     system_failure = 1 MESSAGE ld_rfc_failure
     communication_failure = 2 MESSAGE ld_rfc_failure.

  LOOP AT lt_return TRANSPORTING NO FIELDS
                 WHERE ( type CA 'AEX' ).  " A/E/X message
    EXIT.
  ENDLOOP.
  IF ( syst-subrc = 0 ).
"    error occured -&amp;gt; error handling
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The longtext of the RFC failure can be captured using the MESSAGE option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 09:19:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/connection-between-two-servers-fm-required/m-p/2661774#M614071</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-08-23T09:19:28Z</dc:date>
    </item>
  </channel>
</rss>

