<?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: Catch an error message in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605685#M1438066</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh...try  as below where this bapi does&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      IMPORTING
        e_mt61d       = ls_mt61d
        e_mdkp        = ls_mdkp
        e_cm61m       = ls_cm61m
        e_mdsta       = ls_mdsta
      TABLES
        mdpsx         = lt_mdpsx
        mdezx         = lt_mdezx
        mdsux         = lt_mdsux
      EXCEPTIONS
        error_message = 1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jan 2010 11:57:39 GMT</pubDate>
    <dc:creator>Manohar2u</dc:creator>
    <dc:date>2010-01-25T11:57:39Z</dc:date>
    <item>
      <title>Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605682#M1438063</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;I'm using the standard function 'MD_STOCK_REQUIREMENTS_LIST_API' to get data like transaction MD04. In some conditions, that function shows an error message that isn't raised throught the function module to my report, the error it's just displayed and then the program is stopped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to use TRY-CATCH or something like this to catch the error message and then continue my report flow? I tried this, but the error isn't being catched:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TRY.

  CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
    EXPORTING
      matnr  = ls_replacement-matnr
      werks  = ls_replacement-werks
    TABLES
      mdpsx  = lt_mdpsx
*      MDEZX =
    EXCEPTIONS
      OTHERS = 1.

CATCH cx_root INTO go_cx_root.

* Read the error....

ENDTRY.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 11:46:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605682#M1438063</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2010-01-25T11:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605683#M1438064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why not we try with 'BAPI_MATERIAL_STOCK_REQ_LIST' BAPI - which is calling this function module anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 11:53:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605683#M1438064</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2010-01-25T11:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605684#M1438065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because it isn't available in the SAP system that I'm working with &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 11:54:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605684#M1438065</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2010-01-25T11:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605685#M1438066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh...try  as below where this bapi does&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      IMPORTING
        e_mt61d       = ls_mt61d
        e_mdkp        = ls_mdkp
        e_cm61m       = ls_cm61m
        e_mdsta       = ls_mdsta
      TABLES
        mdpsx         = lt_mdpsx
        mdezx         = lt_mdezx
        mdsux         = lt_mdsux
      EXCEPTIONS
        error_message = 1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 11:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605685#M1438066</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2010-01-25T11:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605686#M1438067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use 'message into(see f1 help)' or fm &lt;STRONG&gt;BALW_BAPIRETURN_GET2&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Pass the system variables you will get the message in export parameter of the fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:gt_return type table of bapireturn.
data:ls_return type bapireturn.

if sy-subrc &amp;lt;&amp;gt; 0.
clear ls_return.
  MESSAGE ID     sy-msgid
          TYPE   sy-msgtyp
          NUMBER sy-msgno
          WITH   sy-msgv1
                 sy-msgv2
                 sy-msgv3
                 sy-msgv4
          INTO   ls_return-message.

append ls_return to gt_return.

endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Keshav.T on Jan 25, 2010 5:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 12:14:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605686#M1438067</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-25T12:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605687#M1438068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the problem that I'm having. The problem is that in the standard code of the funcion module there is an error MESSAGE statement that stops the process flow of my report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm only looking for some way to "CATCH" the error message, in order to continue my report execution without showing the message to the user.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 12:48:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605687#M1438068</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2010-01-25T12:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605688#M1438069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you try with exception as error_message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;.    
      EXCEPTIONS
         *error_message = 1.*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 13:16:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605688#M1438069</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2010-01-25T13:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605689#M1438070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As manohar as suggested, use the bapi and catch the exception using the fm or message into.&lt;/P&gt;&lt;P&gt;It will be solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 14:07:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605689#M1438070</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-25T14:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605690#M1438071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Keshav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said before, In my system release the BAPI isn'tl available yet... The system is really "outdatet..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And there is no way to catch the error message via EXCEPTIONS parameter in the function module, because the error isn't being RAISED by the function (That's the source of my problem!). The function module shows the message instead of raising it to my report... And I'm trying to find some way to manage the error message to prevent my program to be stopped by the FM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 18:15:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605690#M1438071</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2010-01-25T18:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605691#M1438072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to find the reason why the exception is raised, you can correct the error .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check link:[http://help.sap.com/saphelp_47x200/helpdata/en/9f/db96ef35c111d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Keshav.T on Jan 26, 2010 12:20 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 18:48:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605691#M1438072</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-25T18:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605692#M1438073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marshal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LISTEN and do what Manohar suggested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
      EXCEPTIONS
         error_message = 1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This exception is internal to ABAP engine. It will not be defined in the exceptions of the FM. Whenever an FM calls 'E' message, the ABAP engine generates ERROR_MESSAGE exception and passes it to the calling program. If the calling program doesn't have a line for that exception, then the program will be terminated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just try it out instead of resisting &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 21:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605692#M1438073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-25T21:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605693#M1438074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'MD_STOCK_REQUIREMENTS_LIST_API'
  EXPORTING
    matnr  = ls_replacement-matnr
    werks  = ls_replacement-werks
  TABLES
    mdpsx  = lt_mdpsx
*      MDEZX =
  EXCEPTIONS
    material_plant_not_found       = 1
    plant_not_found                = 2
    OTHERS                         = 3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jan 2010 22:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605693#M1438074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-25T22:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Catch an error message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605694#M1438075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Manohar and thank you  Sudhi Karkada, you "opened" my mind at last &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I read the Manohar answers I thought he was missing something or he was talking about the BAPI and I didn't understood it. Sorry for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again for that knowledge, it's not the first time that I found an standard function module with that kind of problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jan 2010 08:16:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-an-error-message/m-p/6605694#M1438075</guid>
      <dc:creator>Marcal_Oliveras</dc:creator>
      <dc:date>2010-01-26T08:16:07Z</dc:date>
    </item>
  </channel>
</rss>

