anchor.diff:  
     METHOD lif_object~exists.
   
  -    DATA: ls_tadir TYPE tadir.
  -
  -* todo, it should look up in the ENHO database tables or call some methods
  -* to see if the object exists, looking in TADIR will not work
  -    ls_tadir = lcl_tadir=>read_single(
  -      iv_object   = ms_item-obj_type
  -      iv_obj_name = ms_item-obj_name ).
  -    IF ls_tadir IS NOT INITIAL.
  -      rv_bool = abap_true.
  -    ENDIF.
  +    DATA: lv_enh_id TYPE enhname.
  +
  +
  +    lv_enh_id = ms_item-obj_name.
  +    TRY.
  +        cl_enh_factory=>get_enhancement(
  +          enhancement_id   = lv_enh_id
  +          bypassing_buffer = abap_true ).
  +        rv_bool = abap_true.
  +      CATCH cx_enh_root.
  +        rv_bool = abap_false.
  +    ENDTRY.
  +
     ENDMETHOD.                    "lif_object~exists
   
     METHOD lif_object~serialize.
  
positive.code: 
  
      io_xml->read( EXPORTING iv_name = 'SHORTTEXT'
                    CHANGING cg_data = lv_shorttext ).
      io_xml->read( EXPORTING iv_name = 'ORIGINAL_OBJECT'
                    CHANGING cg_data = ls_original_object ).
      io_xml->read( EXPORTING iv_name = 'ENHANCEMENTS'
                    CHANGING cg_data = lt_enhancements ).
      io_xml->read( EXPORTING iv_name = 'SPACES'
                    CHANGING cg_data = lt_spaces ).
  
      hook_impl_deserialize( EXPORTING it_spaces = lt_spaces
                             CHANGING ct_impl = lt_enhancements ).
  
      lv_enhname = ms_item-obj_name.
      lv_package = iv_package.
      TRY.
          cl_enh_factory=>create_enhancement(
            EXPORTING
              enhname       = lv_enhname
              enhtype       = cl_abstract_enh_tool_redef=>credefinition
              enhtooltype   = cl_enh_tool_hook_impl=>tooltype
            IMPORTING
              enhancement   = li_tool
            CHANGING
              devclass      = lv_package ).
          lo_hook_impl ?= li_tool.
  
          lo_hook_impl->if_enh_object_docu~set_shorttext( lv_shorttext ).
  
negative.code:     TRY.
          cl_enh_factory=>create_enhancement(
            EXPORTING
              enhname     = lv_enhname
              enhtype     = ''
              enhtooltype = cl_enh_tool_class=>tooltype
            IMPORTING
              enhancement = li_tool
            CHANGING
              devclass    = lv_package ).
          lo_enh_class ?= li_tool.
  
          lo_enh_class->if_enh_object_docu~set_shorttext( lv_shorttext ).
          lo_enh_class->set_class( lv_class ).
          lo_enh_class->set_owr_methods( version     = 'I'
                                         owr_methods = lt_owr ).
          lo_enh_class->set_pre_methods( version     = 'I'
                                         pre_methods = lt_pre ).
          lo_enh_class->set_post_methods( version      = 'I'
                                          post_methods = lt_post ).
          lo_enh_class->set_eimp_include( version     = 'I'
                                          eimp_source = lt_source ).
  
          lo_enh_class->if_enh_object~save( ).
  