Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8372

Re: CLEANUP issue

$
0
0

Can I recommend using functional syntax - it's much less verbose. Or are you on a very old version of ABAP?

 

At line 90 method pm_load_and_set_attributes is called which is implemented in Super class CB_PT_ARQ_DEDUCTION.

 

TRY.
  pm_load_and_set_attributes( business_key ).

CLEANUP.
  os_internal_undo( ).
  os_clear_current( ).
  CLEAR current_special_object_info.
ENDTRY.


In method - pm_load_and_set_attributes, an exception
cx_os_object_not_found is raised at line 60

* * 2. Load from Database
try.
  append BUSINESS_KEY to BUSINESS_KEY_TAB.
  OBJECT_DATA_TAB = MAP_LOAD_FROM_DATABASE_KEY( BUSINESS_KEY_TAB ).
catch cx_os_db_select into ex_os_db_select.
  class cx_os_object_not_found definition load. "<----- Do you really need this?
  raise exception type cx_os_object_not_found
      exporting
       bkey = ex_os_db_select->bkey
       textid = cx_os_object_not_found=>by_bkey.
endtry.


Cleanup doesn't work in the way you seem to be trying to use it.   The cleanup works in nested trys. If an exception occurs in the inner try that's not caught by in the inner catch, but is caught by the outer catch, then the cleanup will execute.

 

TRY.

  TRY.

    do something that raises A.

  CATCH B.

    process exception B.

  CLEANUP.

   this will be executed for A.

ENDTRY.

 

CATCH A.

    process exception A.

ENDTRY:

 

Example here: http://help.sap.com/saphelp_470/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm




Viewing all articles
Browse latest Browse all 8372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>