anchor.diff:  
     METHOD lif_object~has_changed_since.
   
  -    DATA: ls_last_changed TYPE thead.
  +    DATA: ls_last_changed    TYPE tys_form_header.
       DATA: lv_last_changed_ts TYPE timestamp.
   
       ls_last_changed = _get_last_changes( ms_item-obj_name ).
  
positive.code: 
    METHOD lif_object~delete.
  
      DATA: lv_name TYPE thead-tdname.
  
      lv_name = ms_item-obj_name.
  
      CALL FUNCTION 'DELETE_TEXT'
        EXPORTING
          id       = 'TXT'
          language = '*'
          name     = lv_name
          object   = c_objectname_form
        EXCEPTIONS
          OTHERS   = 1.
      IF sy-subrc <> 0.
        lcx_exception=>raise( 'error from DELETE_TEXT TXT, FORM' ) ##NO_TEXT.
      ENDIF.
  
      lv_name+16(3) = '*  '.
      CALL FUNCTION 'DELETE_TEXT'
        EXPORTING
          id       = c_tdid_default
          language = '*'
          name     = lv_name
          object   = c_objectname_form
        EXCEPTIONS
          OTHERS   = 1.
      IF sy-subrc <> 0.
        lcx_exception=>raise( 'error from DELETE_TEXT DEF, FORM' ) ##NO_TEXT.
      ENDIF.
  
    ENDMETHOD.
  
    METHOD lif_object~serialize.
  
      DATA: lt_form              TYPE tyt_header.
      DATA: ls_header            TYPE LINE OF tyt_header.
      DATA: lt_lines             TYPE tyt_lines.
      DATA: lv_name              TYPE thead-tdname.
      DATA: lt_header            TYPE tyt_header.
      DATA: lv_string            TYPE string.
      DATA: lo_xml               TYPE REF TO lcl_xml_output.
      FIELD-SYMBOLS: <ls_header> TYPE LINE OF tyt_header.
  
      lv_name = ms_item-obj_name.
  
      CALL FUNCTION 'SELECT_TEXT'
        EXPORTING
          database_only = abap_true
          id            = '*'
          language      = '*'
          name          = lv_name
          object        = c_objectname_form
        TABLES
          selections    = lt_header
        EXCEPTIONS
          OTHERS        = 1
          ##fm_subrc_ok.                                                   "#EC CI_SUBRC
  
      LOOP AT lt_header ASSIGNING <ls_header>.
        CLEAR ls_header.
        CLEAR lt_lines.
        FREE lo_xml.
  
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            id       = <ls_header>-tdid
            language = <ls_header>-tdspras
            name     = <ls_header>-tdname
            object   = <ls_header>-tdobject
          IMPORTING
            header   = ls_header
          TABLES
            lines    = lt_lines
          EXCEPTIONS
            OTHERS   = 1
            ##fm_subrc_ok.                                                   "#EC CI_SUBRC
  
        CLEAR: ls_header-tdfuser,
               ls_header-tdfdate,
               ls_header-tdftime,
               ls_header-tdfreles,
               ls_header-tdluser,
               ls_header-tdldate,
               ls_header-tdltime,
               ls_header-tdlreles.
  
        CREATE OBJECT lo_xml.
        lo_xml->add( iv_name = 'TLINES'
                     ig_data = lt_lines ).
        lv_string = lo_xml->render( ).
        IF lv_string IS NOT INITIAL.
          mo_files->add_string( iv_extra  = _build_extr_from_header( ls_header )
                                iv_ext    = c_extension_xml
                                iv_string = lv_string ).
        ENDIF.
  
        INSERT ls_header INTO TABLE lt_form.
  
      ENDLOOP.
  
      IF lt_form IS NOT INITIAL.
        io_xml->add( iv_name = c_objectname_form
                     ig_data = lt_form ).
      ENDIF.
  
    ENDMETHOD.
  
    METHOD lif_object~deserialize.
  
      DATA: lt_form              TYPE tyt_header.
      DATA: lt_lines             TYPE tyt_lines.
      DATA: lv_string            TYPE string.
      DATA: lo_xml               TYPE REF TO lcl_xml_input.
      FIELD-SYMBOLS: <ls_header> TYPE LINE OF tyt_header.
  
      io_xml->read( EXPORTING iv_name = c_objectname_form
                    CHANGING  cg_data = lt_form ).
  
      LOOP AT lt_form ASSIGNING <ls_header>.
  
        lv_string = mo_files->read_string( iv_extra = _build_extr_from_header( <ls_header> )
                                           iv_ext   = c_extension_xml ).
  
        CREATE OBJECT lo_xml EXPORTING iv_xml = lv_string.
        lo_xml->read( EXPORTING iv_name = 'TLINES'
                      CHANGING  cg_data = lt_lines ).
  
        IF <ls_header>-tdid = c_tdid_default.
  
          CALL FUNCTION 'SAPSCRIPT_CHANGE_OLANGUAGE'
            EXPORTING
              forced    = abap_true
              name      = <ls_header>-tdname
              object    = <ls_header>-tdobject
              olanguage = <ls_header>-tdspras
            EXCEPTIONS
              OTHERS    = 1
              ##fm_subrc_ok.                                                   "#EC CI_SUBRC
  
        ENDIF.
        CALL FUNCTION 'SAVE_TEXT'
          EXPORTING
            header          = <ls_header>
            savemode_direct = abap_true
          TABLES
            lines           = lt_lines
          EXCEPTIONS
            OTHERS          = 1.
        IF sy-subrc <> 0.
          lcx_exception=>raise( 'error from SAVE_TEXT, FORM' ) ##NO_TEXT.
        ENDIF.
  
      ENDLOOP.
  
  
negative.code:     ALIASES mo_files FOR lif_object~mo_files.
  
    PRIVATE SECTION.
      CONSTANTS: c_objectname_form    TYPE thead-tdobject VALUE 'FORM' ##NO_TEXT.
      CONSTANTS: c_objectname_tdlines TYPE thead-tdobject VALUE 'TDLINES' ##NO_TEXT.
      CONSTANTS: c_extension_xml      TYPE string         VALUE 'xml' ##NO_TEXT.
  
      TYPES: BEGIN OF tys_form_data,
               form_header   TYPE itcta,
               text_header   TYPE thead,
               orig_language TYPE sy-langu,
               pages         TYPE STANDARD TABLE OF itctg WITH DEFAULT KEY,
               page_windows  TYPE STANDARD TABLE OF itcth WITH DEFAULT KEY,
               paragraphs    TYPE STANDARD TABLE OF itcdp WITH DEFAULT KEY,
               strings       TYPE STANDARD TABLE OF itcds WITH DEFAULT KEY,
               tabs          TYPE STANDARD TABLE OF itcdq WITH DEFAULT KEY,
               windows       TYPE STANDARD TABLE OF itctw WITH DEFAULT KEY,
             END OF tys_form_data,
             tyt_form_data   TYPE STANDARD TABLE OF tys_form_data WITH DEFAULT KEY,
             tyt_form_header TYPE STANDARD TABLE OF itcta WITH DEFAULT KEY,
             tys_form_header TYPE LINE OF tyt_form_header,
             tyt_text_header TYPE STANDARD TABLE OF thead WITH DEFAULT KEY,
             tys_text_header TYPE LINE OF tyt_text_header,
             tyt_lines       TYPE tline_tab.
  
      METHODS _get_last_changes
        IMPORTING
          iv_form_name           TYPE ty_item-obj_name
        RETURNING
          VALUE(es_last_changed) TYPE tys_form_header.
  
      METHODS _build_extra_from_header
        IMPORTING
          ls_header       TYPE tys_form_header
        RETURNING
          VALUE(r_result) TYPE string.
  
      METHODS _save_form
        IMPORTING
          it_lines     TYPE lcl_object_form=>tyt_lines
        CHANGING
          cs_form_data TYPE lcl_object_form=>tys_form_data.
  
      METHODS _extract_tdlines
        IMPORTING
          is_form_data    TYPE lcl_object_form=>tys_form_data
        RETURNING
          VALUE(et_lines) TYPE lcl_object_form=>tyt_lines
        RAISING
          lcx_exception.
  
      METHODS _clear_changed_fields
        CHANGING
          cs_form_data TYPE lcl_object_form=>tys_form_data.
  
      METHODS _compress_lines
        IMPORTING
          is_form_data TYPE lcl_object_form=>tys_form_data
          it_lines     TYPE lcl_object_form=>tyt_lines
        RAISING
          lcx_exception.
  
      METHODS _find_form
        IMPORTING
          iv_object_name        TYPE ty_item-obj_name
        RETURNING
          VALUE(et_text_header) TYPE lcl_object_form=>tyt_text_header.
  
      METHODS _read_form
        IMPORTING
          is_text_header TYPE lcl_object_form=>tys_text_header
        EXPORTING
          ev_form_found  TYPE flag
          es_form_data   TYPE lcl_object_form=>tys_form_data
          et_lines       TYPE lcl_object_form=>tyt_lines.
  
  ENDCLASS.
  
  