<?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: Catching Error Message in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229505#M1629034</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know - maybe the first thing to do here is to correct the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2011 18:37:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-12T18:37:46Z</dc:date>
    <item>
      <title>Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229500#M1629029</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;Question : could you please tell me how to catch footer error message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Background : &lt;/P&gt;&lt;P&gt;I am working with FM &lt;STRONG&gt;L_TO_CREATE_SINGLE&lt;/STRONG&gt; . &lt;/P&gt;&lt;P&gt;This FM has so many exceptions and I am catching those in my custom program. &lt;/P&gt;&lt;P&gt;the problem is FM is throwing error message while it executes and simply coming out of my custom program and displaying error message at footer so I am not able to catch error message. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me how to catch this error and see my code below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'L_TO_CREATE_SINGLE'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            I_LGNUM                     = '620'&lt;/P&gt;&lt;P&gt;            I_BWLVS                     = '999'&lt;/P&gt;&lt;P&gt;            I_MATNR                     = WA_RECORD_OUT-MATNR&lt;/P&gt;&lt;P&gt;            I_WERKS                     = WA_RECORD_OUT-WERKS&lt;/P&gt;&lt;P&gt;            I_ANFME                     = WA_PHY_INV_HIS-QUANTITY&lt;/P&gt;&lt;P&gt;            I_ALTME                     = WA_PHY_INV_HIS-UNIT_OF_MEASURE&lt;/P&gt;&lt;P&gt;           I_SQUIT                     = 'X'&lt;/P&gt;&lt;P&gt;           I_VLTYP                     = WA_RECORD_OUT-LGTYP&lt;/P&gt;&lt;P&gt;           I_VLPLA                     = WA_RECORD_OUT-LGPLA&lt;/P&gt;&lt;P&gt;           I_VLENR                     = WA_PHY_INV_HIS-STO_UNIT&lt;/P&gt;&lt;P&gt;           I_NLTYP                     = WA_PHY_INV_HIS-STO_TYPE&lt;/P&gt;&lt;P&gt;           I_NLPLA                     = WA_PHY_INV_HIS-STO_BIN&lt;/P&gt;&lt;P&gt;           I_COMMIT_WORK               = 'X'&lt;/P&gt;&lt;P&gt;           I_BNAME                     = SY-UNAME&lt;/P&gt;&lt;P&gt;           I_KOMPL                     = 'X'&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;           E_TANUM                     = I_TANUM&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;           NO_TO_CREATED               = 1&lt;/P&gt;&lt;P&gt;           BWLVS_WRONG                 = 2&lt;/P&gt;&lt;P&gt;           BETYP_WRONG                 = 3&lt;/P&gt;&lt;P&gt;           BENUM_MISSING               = 4&lt;/P&gt;&lt;P&gt;           BETYP_MISSING               = 5&lt;/P&gt;&lt;P&gt;           FOREIGN_LOCK                = 6&lt;/P&gt;&lt;P&gt;           VLTYP_WRONG                 = 7&lt;/P&gt;&lt;P&gt;           VLPLA_WRONG                 = 8&lt;/P&gt;&lt;P&gt;           VLTYP_MISSING               = 9&lt;/P&gt;&lt;P&gt;           NLTYP_WRONG                 = 10&lt;/P&gt;&lt;P&gt;           NLPLA_WRONG                 = 11&lt;/P&gt;&lt;P&gt;           NLTYP_MISSING               = 12&lt;/P&gt;&lt;P&gt;           RLTYP_WRONG                 = 13&lt;/P&gt;&lt;P&gt;           RLPLA_WRONG                 = 14&lt;/P&gt;&lt;P&gt;           RLTYP_MISSING               = 15&lt;/P&gt;&lt;P&gt;           SQUIT_FORBIDDEN             = 16&lt;/P&gt;&lt;P&gt;           MANUAL_TO_FORBIDDEN         = 17&lt;/P&gt;&lt;P&gt;           LETYP_WRONG                 = 18&lt;/P&gt;&lt;P&gt;           VLPLA_MISSING               = 19&lt;/P&gt;&lt;P&gt;           NLPLA_MISSING               = 20&lt;/P&gt;&lt;P&gt;           SOBKZ_WRONG                 = 21&lt;/P&gt;&lt;P&gt;           SOBKZ_MISSING               = 22&lt;/P&gt;&lt;P&gt;           SONUM_MISSING               = 23&lt;/P&gt;&lt;P&gt;           BESTQ_WRONG                 = 24&lt;/P&gt;&lt;P&gt;           LGBER_WRONG                 = 25&lt;/P&gt;&lt;P&gt;           XFELD_WRONG                 = 26&lt;/P&gt;&lt;P&gt;           DATE_WRONG                  = 27&lt;/P&gt;&lt;P&gt;           DRUKZ_WRONG                 = 28&lt;/P&gt;&lt;P&gt;           LDEST_WRONG                 = 29&lt;/P&gt;&lt;P&gt;           UPDATE_WITHOUT_COMMIT       = 30&lt;/P&gt;&lt;P&gt;           NO_AUTHORITY                = 31&lt;/P&gt;&lt;P&gt;           MATERIAL_NOT_FOUND          = 32&lt;/P&gt;&lt;P&gt;           LENUM_WRONG                 = 33&lt;/P&gt;&lt;P&gt;           OTHERS                      = 34       .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;          CASE sy-subrc.&lt;/P&gt;&lt;P&gt;            WHEN 1.  MESSAGE = 'no_to_created'.&lt;/P&gt;&lt;P&gt;            WHEN 2.  MESSAGE = 'bwlvs_wrong' .&lt;/P&gt;&lt;P&gt;            WHEN 3.  MESSAGE = 'betyp_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 4.  MESSAGE = 'benum_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 5.  MESSAGE = 'betyp_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 6.  MESSAGE = 'foreign_lock'.&lt;/P&gt;&lt;P&gt;            WHEN 7.  MESSAGE = 'vltyp_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 8.  MESSAGE = 'vlpla_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 9.  MESSAGE = 'vltyp_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 10. MESSAGE = 'nltyp_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 11. MESSAGE = 'nlpla_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 12. MESSAGE = 'nltyp_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 13. MESSAGE = 'rltyp_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 14. MESSAGE = 'rlpla_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 15. MESSAGE = 'rltyp_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 16. MESSAGE = 'squit_forbidden'.&lt;/P&gt;&lt;P&gt;            WHEN 17. MESSAGE = 'manual_to_forbidden'.&lt;/P&gt;&lt;P&gt;            WHEN 18. MESSAGE = 'letyp_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 19. MESSAGE = 'vlpla_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 20. MESSAGE = 'nlpla_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 21. MESSAGE = 'sobkz_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 22. MESSAGE = 'sobkz_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 23. MESSAGE = 'sonum_missing'.&lt;/P&gt;&lt;P&gt;            WHEN 24. MESSAGE = 'bestq_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 25. MESSAGE = 'lgber_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 26. MESSAGE = 'xfeld_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 27. MESSAGE = 'date_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 28. MESSAGE = 'drukz_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 29. MESSAGE = 'ldest_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 30. MESSAGE = 'update_without_commit'.&lt;/P&gt;&lt;P&gt;            WHEN 31. MESSAGE = 'no_authority'.&lt;/P&gt;&lt;P&gt;            WHEN 32. MESSAGE = 'material_not_found'.&lt;/P&gt;&lt;P&gt;            WHEN 33. MESSAGE = 'lenum_wrong'.&lt;/P&gt;&lt;P&gt;            WHEN 34. MESSAGE = 'ERROR_MESSAGE'.&lt;/P&gt;&lt;P&gt;            WHEN OTHERS.&lt;/P&gt;&lt;P&gt;              message id sy-msgid type sy-msgty number sy-msgno with&lt;/P&gt;&lt;P&gt;                      sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;          ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 17:42:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229500#M1629029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229501#M1629030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, what error is ist showing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 17:44:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229501#M1629030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T17:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229502#M1629031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob here is the error message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Storage bin A-002 in storage type EWG does not exist (check your entry)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;Message no. L3004&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SB&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 17:49:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229502#M1629031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T17:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229503#M1629032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are notes for this message. Have you looked for them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 17:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229503#M1629032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T17:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229504#M1629033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I didn't look for notes, But i can do that. &lt;/P&gt;&lt;P&gt;are the notes you are talking about to through errors so that we can capture in our custom programs? if that is not correct we may get other errors too correct...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 18:00:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229504#M1629033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T18:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229505#M1629034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know - maybe the first thing to do here is to correct the error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 18:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229505#M1629034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T18:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229506#M1629035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sarath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is something you can do to catch unexpected error messages: use the error_message addition of the CALL FUNCTION statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read this: [http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_PARAMETER.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your particular case just add this to the list of exceptions &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ERROR_MESSAGE = 99&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and then&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CASE sy-subrc.
 ....
   WHEN 99 . MESSAGE = 'unexpected error message'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Arseni Gallardo on Oct 12, 2011 8:46 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 18:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229506#M1629035</guid>
      <dc:creator>arseni_gallardo</dc:creator>
      <dc:date>2011-10-12T18:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Error Message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229507#M1629036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have resloved it myself. here is the working code, thanks for all your help&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_SINGLE'
          EXPORTING
            I_LGNUM                     = '620'
            I_BWLVS                     = '999'
            I_MATNR                     = WA_RECORD_OUT-MATNR
            I_WERKS                     = WA_RECORD_OUT-WERKS
            I_ANFME                     = WA_PHY_INV_HIS-QUANTITY
            I_ALTME                     = WA_PHY_INV_HIS-UNIT_OF_MEASURE
           I_SQUIT                     = 'X'
           I_VLTYP                     = WA_RECORD_OUT-LGTYP
           I_VLPLA                     = WA_RECORD_OUT-LGPLA
           I_VLENR                     = WA_PHY_INV_HIS-STO_UNIT
           I_NLTYP                     = WA_PHY_INV_HIS-STO_TYPE
           I_NLPLA                     = WA_PHY_INV_HIS-STO_BIN
           I_COMMIT_WORK               = 'X'
           I_BNAME                     = SY-UNAME
           I_KOMPL                     = 'X'
         IMPORTING
           E_TANUM                     = I_TANUM
         EXCEPTIONS
           NO_TO_CREATED               = 1
           BWLVS_WRONG                 = 2
           BETYP_WRONG                 = 3
           BENUM_MISSING               = 4
           BETYP_MISSING               = 5
           FOREIGN_LOCK                = 6
           VLTYP_WRONG                 = 7
           VLPLA_WRONG                 = 8
           VLTYP_MISSING               = 9
           NLTYP_WRONG                 = 10
           NLPLA_WRONG                 = 11
           NLTYP_MISSING               = 12
           RLTYP_WRONG                 = 13
           RLPLA_WRONG                 = 14
           RLTYP_MISSING               = 15
           SQUIT_FORBIDDEN             = 16
           MANUAL_TO_FORBIDDEN         = 17
           LETYP_WRONG                 = 18
           VLPLA_MISSING               = 19
           NLPLA_MISSING               = 20
           SOBKZ_WRONG                 = 21
           SOBKZ_MISSING               = 22
           SONUM_MISSING               = 23
           BESTQ_WRONG                 = 24
           LGBER_WRONG                 = 25
           XFELD_WRONG                 = 26
           DATE_WRONG                  = 27
           DRUKZ_WRONG                 = 28
           LDEST_WRONG                 = 29
           UPDATE_WITHOUT_COMMIT       = 30
           NO_AUTHORITY                = 31
           MATERIAL_NOT_FOUND          = 32
           LENUM_WRONG                 = 33
           ERROR_MESSAGE               = 99
           OTHERS                      = 34.

        IF SY-SUBRC NE 0.
          CALL FUNCTION 'FORMAT_MESSAGE'
            EXPORTING
              ID        = SY-MSGID
              LANG      = '-D'
              NO        = SY-MSGNO
              V1        = SY-MSGV1
              V2        = SY-MSGV2
              V3        = SY-MSGV3
              V4        = SY-MSGV4
            IMPORTING
              MSG       = MESSAGE
            EXCEPTIONS
              NOT_FOUND = 1
              OTHERS    = 2.
       ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Oct 12, 2011 3:44 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 19:40:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-error-message/m-p/8229507#M1629036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T19:40:43Z</dc:date>
    </item>
  </channel>
</rss>

