<?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: Capture error message in RFC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842749#M1684348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dawood,&lt;/P&gt;&lt;P&gt;After executing, CALL TRANSACTION stmt, depending upon the SY-SUBRC value dispaly the Error Message .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2012 11:48:49 GMT</pubDate>
    <dc:creator>former_member213851</dc:creator>
    <dc:date>2012-06-28T11:48:49Z</dc:date>
    <item>
      <title>Capture error message in RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842748#M1684347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a custom RFC which calls a standard transaction internally using SUBMIT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I face is that I am not able to capture the message when the standard transaction ends in error, as the control does not come back to the RFC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how can I capture error messages in such case. The RFC is called from another system and I need to pass the error message to the calling system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dawood&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 11:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842748#M1684347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-28T11:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Capture error message in RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842749#M1684348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dawood,&lt;/P&gt;&lt;P&gt;After executing, CALL TRANSACTION stmt, depending upon the SY-SUBRC value dispaly the Error Message .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 11:48:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842749#M1684348</guid>
      <dc:creator>former_member213851</dc:creator>
      <dc:date>2012-06-28T11:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Capture error message in RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842750#M1684349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to use SUBMIT pgm as I am also passing the selection criteria.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 12:23:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842750#M1684349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-28T12:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Capture error message in RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842751#M1684350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you getting correct data in SYST structure?&lt;/P&gt;&lt;P&gt;I think you should generally get the error message in sy-msgid and sy-msgno etc.&lt;/P&gt;&lt;P&gt;Populate those messages in structure BAPIRET2 and send it back to the system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 13:41:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842751#M1684350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-06-28T13:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Capture error message in RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842752#M1684351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dawood,&lt;/P&gt;&lt;P&gt;Please try using the FM &lt;STRONG&gt;FORMAT_MESSAGE&lt;/STRONG&gt; to get all the messages generated at Run-time.&lt;/P&gt;&lt;P&gt;Below is the&amp;nbsp; &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Demo&lt;/STRONG&gt;&lt;/SPAN&gt; code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION&amp;nbsp; 'MM01'&amp;nbsp; USING BDCDATA MODE&amp;nbsp; 'A'&amp;nbsp; UPDATE&amp;nbsp; 'S'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;CALL FUNCTION '&lt;STRONG&gt;FORMAT_MESSAGE'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;* ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SY-MSGID&lt;/P&gt;&lt;P&gt; LANG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 'EN'&lt;/P&gt;&lt;P&gt;* NO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SY-MSGNO&lt;/P&gt;&lt;P&gt;* V1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SY-MSGV1&lt;/P&gt;&lt;P&gt;* V2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SY-MSGV2&lt;/P&gt;&lt;P&gt;* V3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SY-MSGV3&lt;/P&gt;&lt;P&gt;* V4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = SY-MSGV4&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt; MSG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = TEXT&lt;/P&gt;&lt;P&gt;* EXCEPTIONS&lt;/P&gt;&lt;P&gt;* NOT_FOUND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1&lt;/P&gt;&lt;P&gt;* OTHERS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CONCATENATE INDEX TEXT INTO TEXT SEPARATED BY ' . ' .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus you can capture Message No and corresponding&amp;nbsp; Text&amp;nbsp; and use it as Exceptions as per requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 17:25:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842752#M1684351</guid>
      <dc:creator>former_member213851</dc:creator>
      <dc:date>2012-06-28T17:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Capture error message in RFC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842753#M1684352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This cannot be done using the SUBMIT statement, because the moment SUBMIT is called the control is transferred to the called program. If an error is raised in this program, the processing stops and the control does not return back to the main program (your RFC) for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of RFC it is always advised not to raise any error messages, instead pass the errors back as parameters to the RFCs (like most BAPI calls have the BAPIRETURN table to capture errors).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only option that I see is to encapsulate the logic of the program that you are calling in your RFC and instead of issuing error messages, capture them in a parameter table returned by the RFC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Puneet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 23:06:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/capture-error-message-in-rfc/m-p/8842753#M1684352</guid>
      <dc:creator>Puneet_Gupta</dc:creator>
      <dc:date>2012-06-28T23:06:16Z</dc:date>
    </item>
  </channel>
</rss>

