User Tools

Site Tools


abap:objet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
abap:objet [2014/11/06 16:09] ginkoabap:objet [2016/05/02 16:53] – [Exceptions] ginko
Line 8: Line 8:
 DATA(lv_ret) = me->method( arg ). " From within</code> DATA(lv_ret) = me->method( arg ). " From within</code>
 ===== Exceptions ===== ===== Exceptions =====
 +**__NB__** : L'instruction ''TRY. ... CATCH ...'' ne peut catcher que les class-exceptions !! (Donc bien cocher ''Class exceptions'' dans la définition des méthodes.
 +
 <code abap>DATA lx_error TYPE REF TO cx_root. <code abap>DATA lx_error TYPE REF TO cx_root.
 RAISE EXCEPTION lx_error.</code> RAISE EXCEPTION lx_error.</code>
 +
 +[[http://help.sap.com/saphelp_470/helpdata/en/cf/f2bbc8142c11d3b93a0000e8353423/content.htm?frameset=/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/frameset.htm&current_toc=/en/d3/2e974d35c511d1829f0000e829fbfe/plain.htm&node_id=214&show_children=false|handling exceptions]]
 +
 +<code abap>TRY.
 +
 + ...
 +  " TRY block (application coding)
 +
 +CATCH cx_... cx_... ...
 +
 + ... 
 +" CATCH block (exception handler)
 +
 +CATCH cx_... cx_... ...
 +
 + ... 
 +" CATCH block (exception handler)
 +
 + ...
 +
 + CLEANUP.
 +
 + ... 
 +" CLEANUP block (cleanup context)
 +
 +ENDTRY.</code>
abap/objet.txt · Last modified: 2016/09/08 12:11 by ginko