anchor.diff:  
       name = ms_item-obj_name.
   
  -    rv_bool = cl_cmp_template=>s_template_exists( i_name    = name
  -                                                  i_version = 'A' ).
  +    TRY.
  +        CALL METHOD ('CL_CMP_TEMPLATE')=>('S_TEMPLATE_EXISTS')
  +          EXPORTING
  +            i_name       = name
  +            i_version    = 'A'
  +          RECEIVING
  +            r_flg_exists = rv_bool.
  +
  +      CATCH cx_root.
  +        lcx_exception=>raise( 'CMPT not supported' ).
  +    ENDTRY.
   
     ENDMETHOD.
   
     METHOD lif_object~serialize.
   
  -    DATA(cmp_db) = cl_cmp_template=>s_get_db_access( ).
  -
  -    DATA(template) = cmp_db->read_template( i_name     = |{ ms_item-obj_name }|
  -                                            i_version  = 'A' ).
  -
  -    io_xml->add( iv_name = 'CMPT'
  -                 ig_data = template ).
  +    DATA: lr_template TYPE REF TO data.
  +    FIELD-SYMBOLS: <template> TYPE any.
  +
  +    TRY.
  +        CREATE DATA lr_template TYPE ('IF_CMP_TEMPLATE_DB=>TYP_TEMPLATE').
  +        ASSIGN lr_template->* TO <template>.
  +
  +        CALL METHOD mo_cmp_db->('IF_CMP_TEMPLATE_DB~READ_TEMPLATE')
  +          EXPORTING
  +            i_name     = |{ ms_item-obj_name }|
  +            i_version  = 'A'
  +          RECEIVING
  +            r_template = <template>.
  +
  +        io_xml->add( iv_name = 'CMPT'
  +                     ig_data = <template> ).
  +
  +      CATCH cx_root.
  +        lcx_exception=>raise( 'CMPT not supported' ).
  +    ENDTRY.
  +
   
     ENDMETHOD.
   
     METHOD lif_object~deserialize.
   
  -    DATA: template TYPE if_cmp_template_db=>typ_template.
  -
  -    io_xml->read(
  -      EXPORTING
  -        iv_name       = 'CMPT'
  -      CHANGING
  -        cg_data       = template ).
  -
  -    DATA(cmp_db) = cl_cmp_template=>s_get_db_access( ).
  -
  -    cmp_db->save_template( i_template_db = template
  -                           i_flg_header  = abap_true
  -                           i_flg_lines   = abap_true ).
  +    DATA: lr_template TYPE REF TO data.
  +    FIELD-SYMBOLS: <template> TYPE any.
  +
  +    TRY.
  +        CREATE DATA lr_template TYPE ('IF_CMP_TEMPLATE_DB=>TYP_TEMPLATE').
  +        ASSIGN lr_template->* TO <template>.
  +
  +        io_xml->read(
  +          EXPORTING
  +            iv_name = 'CMPT'
  +          CHANGING
  +            cg_data = <template> ).
  +
  +        DATA(cmp_db) = cl_cmp_template=>s_get_db_access( ).
  +
  +        CALL METHOD mo_cmp_db->('IF_CMP_TEMPLATE_DB~SAVE_TEMPLATE')
  +          EXPORTING
  +            i_template_db = <template>
  +            i_flg_header  = abap_true
  +            i_flg_lines   = abap_true.
  +
  +      CATCH cx_root.
  +        lcx_exception=>raise( 'CMPT not supported' ).
  +    ENDTRY.
   
       CALL FUNCTION 'RS_CORR_INSERT'
         EXPORTING
  
positive.code: 
    METHOD lif_object~changed_by.
  
      DATA(template) = CAST cl_cmp_template( cl_cmp_template=>s_create_from_db( i_name     = |{ ms_item-obj_name }|
                                                                                i_version  = 'A' ) ).
  
  
      rv_user = template->if_cmp_template_edit~get_change_user( ).
  
    ENDMETHOD.
  
  
negative.code: 
    METHOD lif_object~delete.
  
      DATA: deleted TYPE abap_bool.
  
      TRY.
          CALL METHOD mo_cmp_db->('IF_CMP_TEMPLATE_DB~DELETE_TEMPLATE')
            EXPORTING
              i_name        = |{ ms_item-obj_name }|
              i_version     = 'A'
              i_flg_header  = abap_true
              i_flg_lines   = abap_true
            RECEIVING
              r_flg_deleted = deleted.
  
        CATCH cx_root.
          lcx_exception=>raise( 'CMPT not supported' ).
      ENDTRY.
  
      IF deleted = abap_false.
        lcx_exception=>raise( |Error deleting CMPT { ms_item-obj_name }| ).
  