<?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: Exception class with more than one exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311925#M1990856</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What you're creating is a separate text id. You can trigger the same exception with different underlying messages based on the reason why the exception is triggered.&lt;/P&gt;&lt;P&gt;Have a look at the documentation here (in your case the textid will be zcx_try=&amp;gt;cx_new to assign the message of cx_new to the exception triggered):&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenexception_texts_guidl.htm"&gt;Exception Texts - ABAP Keyword Documentation (sap.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you really need separate exceptions instead of messages (e.g. if you want to be able to handle the exceptions in a different way in your calling program), you'll need to create separate exception classes.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Geert-Jan Klaps&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 17:57:37 GMT</pubDate>
    <dc:creator>geert-janklaps</dc:creator>
    <dc:date>2021-01-27T17:57:37Z</dc:date>
    <item>
      <title>Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311923#M1990854</link>
      <description>&lt;P&gt;Hello expert,&lt;/P&gt;
  &lt;P&gt;When creating an exception class , the system inserts an Exception Id with the same name as the name of the class (eg ZCX_TRY) .&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1875964-auto-exceptionid.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I can add an Exception Id (eg CX_NEW). Moreover, the activate is successful.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1875965-more-exceptionid.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I want to raise those exception IDs in a method in another class. Therefore, I tried to add them to the exception tab of the method. &lt;/P&gt;
  &lt;P&gt;1. The exception Id with the same name as the name of the class (eg ZCX_TRY) was add successfully.&lt;/P&gt;
  &lt;P&gt;2. The addition of second exception id raised an error.&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/1875966-err.png"&gt;err.png&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;How can I create one exception class with many exceptions?&lt;/P&gt;
  &lt;P&gt;It does not make sense to create a new class for every exception.&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;
  &lt;P&gt;Hagit&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 16:19:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311923#M1990854</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2021-01-27T16:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311924#M1990855</link>
      <description>&lt;P&gt;To be more accurate : The
addition of second exception id raised a request to create a new exception class&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 16:23:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311924#M1990855</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2021-01-27T16:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311925#M1990856</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What you're creating is a separate text id. You can trigger the same exception with different underlying messages based on the reason why the exception is triggered.&lt;/P&gt;&lt;P&gt;Have a look at the documentation here (in your case the textid will be zcx_try=&amp;gt;cx_new to assign the message of cx_new to the exception triggered):&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenexception_texts_guidl.htm"&gt;Exception Texts - ABAP Keyword Documentation (sap.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you really need separate exceptions instead of messages (e.g. if you want to be able to handle the exceptions in a different way in your calling program), you'll need to create separate exception classes.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Geert-Jan Klaps&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 17:57:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311925#M1990856</guid>
      <dc:creator>geert-janklaps</dc:creator>
      <dc:date>2021-01-27T17:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311926#M1990857</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;8d8214c7f9734f45be69f95cc0d5aeee&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;Your answer helps a lot when I just want a different
message.&lt;/P&gt;&lt;P&gt;It is pity that when I
want to handle the exceptions in a different way in the calling program, I have
to create separate exception classes.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Hagit&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 21:27:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311926#M1990857</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2021-01-27T21:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311927#M1990858</link>
      <description>&lt;P&gt;According to  &lt;SPAN class="mention-scrubbed"&gt;8d8214c7f9734f45be69f95cc0d5aeee&lt;/SPAN&gt; 's answer- Do you think that it is a good design to:&lt;/P&gt;&lt;P&gt; 1.Create an exception class for every kind of handing an exception.&lt;/P&gt;&lt;P&gt;
2.The exception class will contain many text ids.&lt;/P&gt;&lt;P&gt;
For example: Create exception clas:&lt;/P&gt;&lt;P&gt;1..ZCX_BLOCKING_MSG – When the calling program needs to display a blocking message, following the catching of the exceptions, the exceptions will be included in this class.&lt;/P&gt;&lt;P&gt;       1.1.Add text id for case number 1.&lt;/P&gt;&lt;P&gt;       1.2.Add text id for case number 2.&lt;/P&gt;&lt;P&gt;       1.3.etc.&lt;/P&gt;&lt;P&gt;
2.ZCX_INFORMATION_MSG- When the calling program needs to display an information message, following the catching of the exceptions, the exceptions will be included in this class.&lt;/P&gt;&lt;P&gt;       2.1.Add text id for case number 1.&lt;/P&gt;&lt;P&gt;       2.2.Add text id for case number 2.&lt;/P&gt;&lt;P&gt;       2.3.etc.
3.etc.&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Hagit&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 08:39:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311927#M1990858</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2021-01-28T08:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311928#M1990859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Design-wise it's hard to determine without knowing the full requirement. Although the use of exception classes for information messages seems a little bit strange. An exception is a blocking issue, while an information message shouldn't be something that's blocking your process.&lt;/P&gt;&lt;P&gt;Personally I use some kind of message table (e.g. using table type BAPIRET2_T) for logging (information, success messages) and exceptions for blocking errors.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Geert-Jan Klaps&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 08:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311928#M1990859</guid>
      <dc:creator>geert-janklaps</dc:creator>
      <dc:date>2021-01-28T08:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311929#M1990860</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;8d8214c7f9734f45be69f95cc0d5aeee&lt;/SPAN&gt;  Thanks
for your answer.&lt;/P&gt;&lt;P&gt;Do
you have only one exception class or more than one. If you have more than one,
could you please give examples of the need for more than one?&lt;/P&gt;&lt;P&gt;Thanks,
in advance&lt;/P&gt;&lt;P&gt;Hagit&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 11:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311929#M1990860</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2021-01-29T11:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: Exception class with more than one exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311930#M1990861</link>
      <description>&lt;P&gt;I am closing this question as the original
question was answered. &lt;/P&gt;&lt;P&gt;Thank you   &lt;SPAN class="mention-scrubbed"&gt;8d8214c7f9734f45be69f95cc0d5aeee&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;I will open a new question regarding
the design.&lt;/P&gt;&lt;P&gt;Hagit&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 13:49:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-class-with-more-than-one-exception/m-p/12311930#M1990861</guid>
      <dc:creator>hagit</dc:creator>
      <dc:date>2021-02-04T13:49:36Z</dc:date>
    </item>
  </channel>
</rss>

