<?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: exceptions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997394#M406256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After calling the FM , tr this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.

  CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
       EXPORTING
            LANGU = SY-LANGU
            MSGID = SY_MSGID
            MSGNO = SY_MSGNO
            MSGV1 = SY_MSGV1
            MSGV2 = SY_MSGV2
            MSGV3 = SY_MSGV3
            MSGV4 = SY_MSGV4
       IMPORTING
            TEXT  = P_L_ERR_MSG.   "  declare this variable of length 100

  write : P_L_ERR_MSG..
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2007 03:54:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-09T03:54:24Z</dc:date>
    <item>
      <title>exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997392#M406254</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 run FM 'CONVERT_DATE_TO_EXTERNAL' to test the exceptions but no matter what i pass in, even an invalid date i still not able to go in exceptions.&lt;/P&gt;&lt;P&gt;i actually would like to see what is these 1 and 2. thx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) what is 1 and 2? are they sy-subrc? what if sy-subrc is 4?&lt;/P&gt;&lt;P&gt;2) what is this 'OTHERS' under the exceptions in the call function below? &lt;/P&gt;&lt;P&gt;3) why i simply enter an invalid date like '10022031' in yyyymmdd format, sy-subrc still 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in abap :&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              date_internal            = p_date&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              date_external            = p_outdate&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;              date_internal_is_invalid = 1&lt;/P&gt;&lt;P&gt;              OTHERS                   = 2.&lt;/P&gt;&lt;P&gt; in FM :&lt;/P&gt;&lt;P&gt; CASE SY-SUBRC.&lt;/P&gt;&lt;P&gt;   WHEN 0.&lt;/P&gt;&lt;P&gt;    DATE_EXTERNAL = H_DATE_EXTERNAL.&lt;/P&gt;&lt;P&gt;   WHEN OTHERS.&lt;/P&gt;&lt;P&gt;     MESSAGE E650 RAISING DATE_INTERNAL_IS_INVALID.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Bitte gültiges internes Datum angeben (JJJJMMTT)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 03:29:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997392#M406254</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T03:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997393#M406255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;whenever you use the FM, the exception numbers are actuallty the sy-subrc value.&lt;/P&gt;&lt;P&gt;You require to check the sy-subrc and display message accordingly.&lt;/P&gt;&lt;P&gt;Others is the default exception attach with all FM.&lt;/P&gt;&lt;P&gt;Since there are some uncounted errors may occur like OS failure to name.&lt;/P&gt;&lt;P&gt;Soeverytime u use a FM handle these sy-subrc or exceptions accordingly.&lt;/P&gt;&lt;P&gt;If sy-subrc is 0 means success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 03:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997393#M406255</guid>
      <dc:creator>amit_khare</dc:creator>
      <dc:date>2007-03-09T03:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997394#M406256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After calling the FM , tr this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.

  CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
       EXPORTING
            LANGU = SY-LANGU
            MSGID = SY_MSGID
            MSGNO = SY_MSGNO
            MSGV1 = SY_MSGV1
            MSGV2 = SY_MSGV2
            MSGV3 = SY_MSGV3
            MSGV4 = SY_MSGV4
       IMPORTING
            TEXT  = P_L_ERR_MSG.   "  declare this variable of length 100

  write : P_L_ERR_MSG..
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 03:54:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997394#M406256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T03:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997395#M406257</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;Have you checked this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/801f50454211d189710000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/801f50454211d189710000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 04:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997395#M406257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T04:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: exceptions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997396#M406258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1) in the FM, only 1 and 2, what if it returns other than 1 and 2? why OTHERS is 2? which means only can cater for 1 and 2 sy-subrc? what if other number then how to take care? or by this way, can restrict system to return only 1 and 2? i know when alright will return 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) why need to call 'tb_message_build_text'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) i just do not understand why 'CONVERT_DATE_TO_EXTERNAL' also can return 0 for sy-subrc even i input letter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please advise again.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 11:52:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions/m-p/1997396#M406258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T11:52:30Z</dc:date>
    </item>
  </channel>
</rss>

