<?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: pass on the exception when i use class methods in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713939#M33007</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If the method has any exception, you can catch the exception by below format.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ro_struc_descr ?= cl_abap_typedescr=&amp;gt;describe_by_name( lv_vname ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Replace above one with below one,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    cl_abap_typedescr=&amp;gt;describe_by_name( exporting p_name           = lv_vname
                                         receiving p_descr_ref      = ro_struc_descr
                                         exceptions type_not_found  = 1
                                                    others          = 2              ).
    if ( sy-subrc &amp;lt;&amp;gt; 0 ).
        " process your exception
    else.
        " main logic when subrc eq 0
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks..&lt;/P&gt;</description>
    <pubDate>Tue, 18 Dec 2018 12:33:54 GMT</pubDate>
    <dc:creator>Muthu_raja</dc:creator>
    <dc:date>2018-12-18T12:33:54Z</dc:date>
    <item>
      <title>pass on the exception when i use class methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713938#M33006</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;
  &lt;P&gt;Here i have a table with single column which contains "views name". Based on the view name I tried to create a table.&lt;/P&gt;
  &lt;P&gt;Code:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;
loop itab into wa.
lv_vname = wa-view_name.
* Get a structure of view name 

    ro_struc_descr ?= cl_abap_typedescr=&amp;gt;describe_by_name( lv_vname ).
    lt_comp = ro_struc_descr-&amp;gt;get_components( ).
    APPEND LINES OF lt_comp TO lt_tot_comp.

* Create new type from component table
    lo_new_type = cl_abap_structdescr=&amp;gt;create( lt_tot_comp ).

* Create new table type
    lo_table_type = cl_abap_tabledescr=&amp;gt;create( lo_new_type ).

* Create dynamic internal table and assign to Field Symbol
    CREATE DATA w_tref TYPE HANDLE lo_table_type.

&amp;lt;---some logic----------&amp;gt;
endloop.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;from the above code, &lt;STRONG&gt;"lv_vname"&lt;/STRONG&gt; is a view name. &lt;/P&gt;
  &lt;P&gt;suppose if my table has a invalid view name means my program through the dump error.&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;error:&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;EXCEPTION CONDITION " Type_NOT_Found"&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;it won't process other values.&lt;/P&gt;
  &lt;P&gt;i want to capture that error and except that i want to process all the data to create dynamic table.&lt;/P&gt;
  &lt;P&gt;Any suggestions please...&lt;/P&gt;
  &lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 11:58:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713938#M33006</guid>
      <dc:creator>former_member383962</dc:creator>
      <dc:date>2018-12-18T11:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: pass on the exception when i use class methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713939#M33007</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If the method has any exception, you can catch the exception by below format.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ro_struc_descr ?= cl_abap_typedescr=&amp;gt;describe_by_name( lv_vname ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Replace above one with below one,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    cl_abap_typedescr=&amp;gt;describe_by_name( exporting p_name           = lv_vname
                                         receiving p_descr_ref      = ro_struc_descr
                                         exceptions type_not_found  = 1
                                                    others          = 2              ).
    if ( sy-subrc &amp;lt;&amp;gt; 0 ).
        " process your exception
    else.
        " main logic when subrc eq 0
    endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks..&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713939#M33007</guid>
      <dc:creator>Muthu_raja</dc:creator>
      <dc:date>2018-12-18T12:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: pass on the exception when i use class methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713940#M33008</link>
      <description>&lt;P&gt;What did you try, from &lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/abaptry.htm"&gt;try/catch/endtry&lt;/A&gt; wrapping the call to use of addition &lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/abapcall_method_parameters.htm#!ABAP_ADDITION_5@5@"&gt;exceptions&lt;/A&gt; in the method call?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:05:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pass-on-the-exception-when-i-use-class-methods/m-p/713940#M33008</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2018-12-18T13:05:54Z</dc:date>
    </item>
  </channel>
</rss>

