<?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 generated constructor in exception classes - ommitted textid in superclass in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/generated-constructor-in-exception-classes-ommitted-textid-in-superclass/m-p/6187587#M1374129</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;debugging another program i stopped in the constructor of one of my own exception classes. Starring at the code one questoion arised&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method constructor.
call method super-&amp;gt;constructor
exporting
textid = textid
previous = previous
.
 if textid is initial.
   me-&amp;gt;textid = zcx_xi .
 endif.
me-&amp;gt;errortext = errortext .
me-&amp;gt;sysid = sysid .
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all i would use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if textid is *supplied*.
   me-&amp;gt;textid = zcx_xi .
 endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not my question. If i'm raising this exception without supplying the textid the superclass is call with an initial textid, which is filled later pn with the predefined class named textid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i'm raising this exception specifying the textid as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;raise exception type zcx_xi exporting textid = zcx_xi=&amp;gt;zcx_xi errortext = message.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the super class will not get an intial textid but the predefined one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both versions are working well delivering the errortext by the get_text( ) method in the catch branch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But... is there really no difference calling the super class with initial value or given value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Oct 2009 10:12:41 GMT</pubDate>
    <dc:creator>rainer_hbenthal</dc:creator>
    <dc:date>2009-10-01T10:12:41Z</dc:date>
    <item>
      <title>generated constructor in exception classes - ommitted textid in superclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generated-constructor-in-exception-classes-ommitted-textid-in-superclass/m-p/6187587#M1374129</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;debugging another program i stopped in the constructor of one of my own exception classes. Starring at the code one questoion arised&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;method constructor.
call method super-&amp;gt;constructor
exporting
textid = textid
previous = previous
.
 if textid is initial.
   me-&amp;gt;textid = zcx_xi .
 endif.
me-&amp;gt;errortext = errortext .
me-&amp;gt;sysid = sysid .
endmethod.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all i would use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if textid is *supplied*.
   me-&amp;gt;textid = zcx_xi .
 endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not my question. If i'm raising this exception without supplying the textid the superclass is call with an initial textid, which is filled later pn with the predefined class named textid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i'm raising this exception specifying the textid as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;raise exception type zcx_xi exporting textid = zcx_xi=&amp;gt;zcx_xi errortext = message.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the super class will not get an intial textid but the predefined one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both versions are working well delivering the errortext by the get_text( ) method in the catch branch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But... is there really no difference calling the super class with initial value or given value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 10:12:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generated-constructor-in-exception-classes-ommitted-textid-in-superclass/m-p/6187587#M1374129</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-10-01T10:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: generated constructor in exception classes - ommitted textid in superclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generated-constructor-in-exception-classes-ommitted-textid-in-superclass/m-p/6187588#M1374130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like there is no difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code replaces any existing TEXTID set by Super class when we don't pass any TEXTID.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 IF textid IS INITIAL.
   me-&amp;gt;textid = CX_SY_ZERODIVIDE .
 ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the code uses the attribute TEXTID (me-&amp;gt;textid) instead of the importing parameter TEXTID, than it would make a lot difference.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 IF ME-&amp;gt;textid IS INITIAL.   " Attribute TEXTID 
   me-&amp;gt;textid = CX_SY_ZERODIVIDE .
 ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess, we need some SAP Official response before going ahead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2009 14:29:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generated-constructor-in-exception-classes-ommitted-textid-in-superclass/m-p/6187588#M1374130</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-10-01T14:29:30Z</dc:date>
    </item>
  </channel>
</rss>

