Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

when declaring class fo you refresh or clear it.

Former Member
0 Likes
431

Hiii

i have a code as below


DATA:
      lc_oref         TYPE REF TO cx_root.

LOOP AT ITAB.
  
  
     TRY .
       
       DELETE FROM DATABASE " Try catch if delete from database fail
       
       CATCH cx_sy_open_sql_db INTO lc_oref.
         lv_text_change = lc_oref->get_text( ).
     ENDTRY.  
  
ENDLOOP.

My question is do we need to clear or refresh lc_oref? since this is a local class. how do we do it?

Hiii

i have a code as below


DATA:
      lc_oref         TYPE REF TO cx_root.

LOOP AT ITAB.
  
  
     TRY .
       
       DELETE FROM DATABASE " Try catch if delete from database fail
       
       CATCH cx_sy_open_sql_db INTO lc_oref.
         lv_text_change = lc_oref->get_text( ).
     ENDTRY.  
  
ENDLOOP.

My question is do we need to clear or refresh lc_oref? since this is a local class. how do we do it?

1 REPLY 1
Read only

franois_henrotte
Active Contributor
0 Likes
371

no, you don't need to do it as it is local

even if global, you would not need it as catching exception would overwrite it anyway

but if you needed, you should use CLEAR or FREE.