<?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 Catching an error message. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811036#M1313288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a FM 'L_TO_CREATE_DN' which is used in inbound idoc creation program .&lt;/P&gt;&lt;P&gt;Just after running this FM in the code , the idoc gives an error message.&lt;/P&gt;&lt;P&gt;I am checking through WE19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to change the error message ,so I need to catch this message .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as soon as I do a F6 on the FM the program gets executed and the output error message popsup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I catch this message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suchi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Jun 2009 09:05:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-16T09:05:01Z</dc:date>
    <item>
      <title>Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811036#M1313288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi abapers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a FM 'L_TO_CREATE_DN' which is used in inbound idoc creation program .&lt;/P&gt;&lt;P&gt;Just after running this FM in the code , the idoc gives an error message.&lt;/P&gt;&lt;P&gt;I am checking through WE19.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to change the error message ,so I need to catch this message .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as soon as I do a F6 on the FM the program gets executed and the output error message popsup.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I catch this message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suchi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 09:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811036#M1313288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T09:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811037#M1313289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check the Tables parameter of the FM.you'll find a parameter named T_WMGRP_MSG.&lt;/P&gt;&lt;P&gt;Check the Associated Type and you will find that the corresponding messages returned by this BAPI are getting stored here :&lt;/P&gt;&lt;P&gt;MSGNO&lt;/P&gt;&lt;P&gt;MSGID&lt;/P&gt;&lt;P&gt;MSGTY&lt;/P&gt;&lt;P&gt;MSGTX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From here you can catch the required message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply back if need any further help on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 09:11:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811037#M1313289</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T09:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811038#M1313290</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;Fill the below fields and pass the values to T_WMGRP_MSG table of parameter :&lt;/P&gt;&lt;P&gt;MATNR  : &lt;/P&gt;&lt;P&gt;MSGNO : &lt;/P&gt;&lt;P&gt;MSGID  :  &lt;/P&gt;&lt;P&gt;MSGTY :&lt;/P&gt;&lt;P&gt;MSGTX : &lt;/P&gt;&lt;P&gt; This way you can capture the message and pass your message .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 09:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811038#M1313290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811039#M1313291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is as soon as I give F6 on the function module , the program gets executed giving the message.&lt;/P&gt;&lt;P&gt;So I am not able to see what does the table T_WMGRP_MSG return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 09:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811039#M1313291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T09:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811040#M1313292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;put a break point at the FM source code and then debug to see what it returns.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 09:48:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811040#M1313292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T09:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811041#M1313293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please put some sy-subrc check after FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have checked and break-point is stopping after execution(F6) of FM.&lt;/P&gt;&lt;P&gt;Below is the code for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA lt_msg TYPE TABLE OF wmgrp_msg.

CALL FUNCTION 'L_TO_CREATE_DN'
  EXPORTING
    i_lgnum                          = 'EX1'
    i_vbeln                          = '80109392'
*   I_REFNR                          = ' '
*   I_SQUIT                          = ' '
*   I_NIDRU                          = ' '
*   I_DRUKZ                          = ' '
*   I_LDEST                          = ' '
*   I_KOMIM                          = ' '
*   I_EINLM                          = ' '
*   I_EINTA                          = ' '
*   I_NOSPL                          = ' '
*   I_UPDATE_TASK                    = ' '
*   I_COMMIT_WORK                    = 'X'
*   I_BNAME                          = SY-UNAME
*   I_TEILK                          = ' '
*   I_SOLEX                          = 0
*   I_PERNR                          = 0
*   IT_DELIT                         =
* IMPORTING
*   E_TANUM                          =
*   E_TEILK                          =
 TABLES
*   T_LTAK                           =
*   T_LTAP_VB                        =
   T_WMGRP_MSG                      = lt_msg
 EXCEPTIONS
   FOREIGN_LOCK                     = 1
   DN_COMPLETED                     = 2
   PARTIAL_DELIVERY_FORBIDDEN       = 3
   XFELD_WRONG                      = 4
   LDEST_WRONG                      = 5
   DRUKZ_WRONG                      = 6
   DN_WRONG                         = 7
   SQUIT_FORBIDDEN                  = 8
   NO_TO_CREATED                    = 9
   TEILK_WRONG                      = 10
   UPDATE_WITHOUT_COMMIT            = 11
   NO_AUTHORITY                     = 12
   NO_PICKING_ALLOWED               = 13
   DN_HU_NOT_CHOOSABLE              = 14
   INPUT_ERROR                      = 15
   OTHERS                           = 16
          .
IF sy-subrc &amp;lt;&amp;gt; 0.    &amp;lt;- Cursor is stopped at this position After F6 at FM.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


WRITE  'A'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 09:50:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811041#M1313293</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T09:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811042#M1313294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Call the RFC FM as follows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'L_TO_CREATE_DN' destination 'NONE'
  EXPORTING
    i_lgnum                          =
    i_vbeln                          =
 IMPORTING
   E_TANUM                          =
   E_TEILK                          =
 TABLES
   T_LTAK                           =
   T_LTAP_VB                        =
   T_WMGRP_MSG                      =
 EXCEPTIONS
system_failure = 35
communication_failure = 36
error_message = 99

          .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the exceptions as called.&lt;/P&gt;&lt;P&gt;In this case you will not get the error message directly but it will be trapped and passed as an exception as in a normal FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 10:01:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811042#M1313294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T10:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811043#M1313295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The error message that comes up is actually a standard message coming from a standard program SAPMV50A when the FM L_TO_CREATE_DN is triggered.(message class VL message no:198 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also X is passed to the I_COMMIT_WORK   export parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this the reason that by doing F6 the report directly executes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 11:53:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811043#M1313295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T11:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Catching an error message.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811044#M1313296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The error comes directly becuase the exception has not been handled by using the RAISE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jun 2009 18:15:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-an-error-message/m-p/5811044#M1313296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-16T18:15:10Z</dc:date>
    </item>
  </channel>
</rss>

