<?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: Problem with Exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380793#M528345</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 think in the case statement u need to write the condition &lt;/P&gt;&lt;P&gt;when 'OTHERS'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jun 2007 05:46:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-06T05:46:30Z</dc:date>
    <item>
      <title>Problem with Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380791#M528343</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;The following is the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;REPORT  ZTX2007.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters parm_in default 'A'.&lt;/P&gt;&lt;P&gt;data vout(4) value 'INIT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'Z_TX_2008'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    exname        = parm_in&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    POUT          = vout&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    ERROR_A       = 1&lt;/P&gt;&lt;P&gt;    ERROR_B       = 4&lt;/P&gt;&lt;P&gt;    ERROR_C       = 4&lt;/P&gt;&lt;P&gt;    OTHERS        = 99.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: / 'sy-subrc =', sy-subrc,&lt;/P&gt;&lt;P&gt;       / 'vout =', vout.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;FUNCTION Z_TX_2008.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(EXNAME)&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(POUT)&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      ERROR_A&lt;/P&gt;&lt;P&gt;*"      ERROR_B&lt;/P&gt;&lt;P&gt;*"      ERROR_C&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pout = 'XXX'.&lt;/P&gt;&lt;P&gt;case exname.&lt;/P&gt;&lt;P&gt;when 'A'.&lt;/P&gt;&lt;P&gt;raise error_a.&lt;/P&gt;&lt;P&gt;when 'B'.&lt;/P&gt;&lt;P&gt;raise error_b.&lt;/P&gt;&lt;P&gt;when 'C'.&lt;/P&gt;&lt;P&gt;raise error_c.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;When parm_in = 'A' , sy-subrc value is 1.&lt;/P&gt;&lt;P&gt;When parm_in = 'B', sy-subrc value is 4.&lt;/P&gt;&lt;P&gt;When parm_in = 'C', sy-subrc value is 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the above 3 cases, i get the desired output.&lt;/P&gt;&lt;P&gt;I want the sy-subrc value to be 99 when i enter any other characters in Parm_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i have to make any changes in the function module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please explain...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2007 05:40:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380791#M528343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-06T05:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380792#M528344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi your FM ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when others.&lt;/P&gt;&lt;P&gt;raise error_OTHERS.&lt;/P&gt;&lt;P&gt;endcase&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also define an excpetion in se37 - exception tabs with the same name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2007 05:43:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380792#M528344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-06T05:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380793#M528345</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 think in the case statement u need to write the condition &lt;/P&gt;&lt;P&gt;when 'OTHERS'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2007 05:46:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-exception/m-p/2380793#M528345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-06T05:46:30Z</dc:date>
    </item>
  </channel>
</rss>

