*----------------------------------------------------------------------*
*       CLASS lcl_Test DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test DEFINITION FOR TESTING
  DURATION SHORT
  RISK LEVEL HARMLESS
  FINAL.

  PRIVATE SECTION.
* ================

    DATA: mt_code   TYPE string_table,
          ms_result TYPE scirest_ad,
          mo_check  TYPE REF TO zcl_aoc_check_23.

    METHODS:
      setup,
      export_import FOR TESTING,
      test001_01 FOR TESTING,
      test001_02 FOR TESTING,
      test001_03 FOR TESTING,
      test002_01 FOR TESTING,
      test002_02 FOR TESTING,
      test003_01 FOR TESTING.

ENDCLASS.       "lcl_Test

*----------------------------------------------------------------------*
*       CLASS lcl_Test IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test IMPLEMENTATION.
* ==============================

  DEFINE _code.
    APPEND &1 TO mt_code.
  END-OF-DEFINITION.

  METHOD setup.
    CREATE OBJECT mo_check.
    zcl_aoc_unit_test=>set_check( mo_check ).
  ENDMETHOD.                    "setup

  METHOD export_import.
    zcl_aoc_unit_test=>export_import( mo_check ).
  ENDMETHOD.

  METHOD test001_01.
* ===========

    _code 'IF: 1 = 2.      '.
    _code '  WRITE ''foo''.'.
    _code 'ENDIF.          '.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_equals( exp = '001'
                                        act = ms_result-code ).

  ENDMETHOD.                    "test1

  METHOD test001_02.
* ===========

    _code 'DATA: lv_char TYPE c LENGTH 10.'.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_initial( ms_result ).

  ENDMETHOD.                    "test001_02

  METHOD test001_03.
* ===========

    _code 'CATCH: cx_root.'.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_equals( exp = '001'
                                        act = ms_result-code ).

  ENDMETHOD.                    "test1

  METHOD test002_01.
* ===========

    _code 'DATA : lv_char TYPE c LENGTH 10.'.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_equals( exp = '002'
                                        act = ms_result-code ).

  ENDMETHOD.                    "test002_01

  METHOD test002_02.
* ===========

    _code 'DATA:'.
    _code '  lv_sel_rep_langu     TYPE sylangu,'.
    _code '  ls_t002              TYPE t002.'.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_initial( ms_result ).

  ENDMETHOD.                    "test002_02

  METHOD test003_01.
* ===========

    _code ' TYPE c LENGTH 10.'.

    ms_result = zcl_aoc_unit_test=>check( mt_code ).

    cl_abap_unit_assert=>assert_equals( exp = '003'
                                        act = ms_result-code ).

  ENDMETHOD.                    "test003_01

ENDCLASS.       "lcl_Test


CLASS zcl_aoc_check_35 DEFINITION
  PUBLIC
  INHERITING FROM zcl_aoc_super_root
  CREATE PUBLIC .

  PUBLIC SECTION.

    METHODS constructor .

    METHODS run
        REDEFINITION .
  PROTECTED SECTION.
  PRIVATE SECTION.

    TYPES:
      ty_t100_tt TYPE STANDARD TABLE OF t100 WITH DEFAULT KEY.

    METHODS analyze
      IMPORTING
        !it_t100       TYPE ty_t100_tt
      RETURNING
        VALUE(rv_code) TYPE sci_errc.
ENDCLASS.

CLASS ZCL_AOC_CHECK_35 IMPLEMENTATION.

  METHOD analyze.

    TYPES: BEGIN OF ty_cross,
             name TYPE cross-name,
           END OF ty_cross.

    DATA: lt_cross TYPE TABLE OF ty_cross,
          lt_name  TYPE TABLE OF cross-name,
          lv_name  LIKE LINE OF lt_name.

    FIELD-SYMBOLS: <ls_t100> LIKE LINE OF it_t100.

    LOOP AT it_t100 ASSIGNING <ls_t100>.
      CONCATENATE <ls_t100>-arbgb <ls_t100>-msgnr INTO lv_name RESPECTING BLANKS.
      APPEND lv_name TO lt_name.
    ENDLOOP.

    ASSERT lines( lt_name ) > 0.
    SELECT name FROM cross INTO TABLE lt_cross
      FOR ALL ENTRIES IN lt_name
      WHERE ( type = '3' OR type = 'N' )
      AND name = lt_name-table_line.                      "#EC CI_SUBRC
    SORT lt_cross BY name ASCENDING.

    LOOP AT it_t100 ASSIGNING <ls_t100>.

      CONCATENATE <ls_t100>-arbgb <ls_t100>-msgnr
        INTO lv_name RESPECTING BLANKS.
      READ TABLE lt_cross WITH KEY name = lv_name
        BINARY SEARCH TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        CONTINUE.
      ENDIF.

      SELECT COUNT( * ) FROM dd08l
        WHERE arbgb = <ls_t100>-arbgb
        AND msgnr = <ls_t100>-msgnr ##WARN_OK.
      IF sy-subrc = 0.
        CONTINUE.
      ENDIF.

      rv_code = '001'.
      inform( p_sub_obj_type = object_type
              p_sub_obj_name = object_name
              p_test         = myname
              p_kind         = mv_errty
              p_code         = rv_code
              p_param_1      = <ls_t100>-msgnr ).
    ENDLOOP.

  ENDMETHOD.

  METHOD constructor.

    super->constructor( ).

    version        = '001'.
    position       = '035'.

    has_documentation = abap_true.
    has_attributes = abap_true.
    attributes_ok  = abap_true.

    add_obj_type( 'MSAG' ).

    insert_scimessage(
        iv_code = '001'
        iv_text = 'Message not in use, &1'(m01) ).

  ENDMETHOD.

  METHOD run.

* abapOpenChecks
*
* MIT License

    DATA: lt_t100 TYPE ty_t100_tt.

    IF object_type <> 'MSAG'.
      RETURN.
    ENDIF.

    SELECT * FROM t100 INTO TABLE lt_t100
      WHERE sprsl = sy-langu
      AND arbgb = object_name.                          "#EC CI_GENBUFF
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.

    analyze( lt_t100 ).

  ENDMETHOD.
ENDCLASS.


*&---------------------------------------------------------------------*
*& Report  ZDEMO_EXCEL2
*& Test Styles for ABAP2XLSX
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT zdemo_excel35.

DATA: lo_excel           TYPE REF TO zcl_excel,
      lo_excel_writer    TYPE REF TO zif_excel_writer,
      lo_worksheet       TYPE REF TO zcl_excel_worksheet,
      lo_style_bold      TYPE REF TO zcl_excel_style,
      lo_style_underline TYPE REF TO zcl_excel_style,
      lo_style_filled    TYPE REF TO zcl_excel_style,
      lo_style_border    TYPE REF TO zcl_excel_style,
      lo_style_button    TYPE REF TO zcl_excel_style,
      lo_border_dark     TYPE REF TO zcl_excel_style_border,
      lo_border_light    TYPE REF TO zcl_excel_style_border.

DATA: lv_style_bold_guid             TYPE zexcel_cell_style,
      lv_style_underline_guid        TYPE zexcel_cell_style,
      lv_style_filled_guid           TYPE zexcel_cell_style,
      lv_style_filled_green_guid     TYPE zexcel_cell_style,
      lv_style_border_guid           TYPE zexcel_cell_style,
      lv_style_button_guid           TYPE zexcel_cell_style,
      lv_style_filled_turquoise_guid TYPE zexcel_cell_style.

DATA: lv_file      TYPE xstring,
      lv_bytecount TYPE i,
      lt_file_tab  TYPE solix_tab.

DATA: lv_full_path      TYPE string,
      lv_workdir        TYPE string,
      lv_file_separator TYPE c.

CONSTANTS: lv_default_file_name TYPE string VALUE '35_Static_Styles.xlsx'.

PARAMETERS: p_path TYPE zexcel_export_dir.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
  lv_workdir = p_path.
  cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder  = lv_workdir
                                              CHANGING  selected_folder = lv_workdir ).
  p_path = lv_workdir.

INITIALIZATION.
  cl_gui_frontend_services=>get_desktop_directory( CHANGING desktop_directory = lv_workdir ).
  cl_gui_cfw=>flush( ).
  p_path = lv_workdir.

START-OF-SELECTION.

  IF p_path IS INITIAL.
    p_path = lv_workdir.
  ENDIF.
  cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ).
  CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path.

  " Creates active sheet
  CREATE OBJECT lo_excel.

  " Create border object
  CREATE OBJECT lo_border_dark.
  lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black.
  lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin.
  CREATE OBJECT lo_border_light.
  lo_border_light->border_color-rgb = zcl_excel_style_color=>c_gray.
  lo_border_light->border_style = zcl_excel_style_border=>c_border_thin.
  " Create a bold / italic style
  lo_style_bold               = lo_excel->add_new_style( ).
  lo_style_bold->font->bold   = abap_true.
  lo_style_bold->font->italic = abap_true.
  lo_style_bold->font->name   = zcl_excel_style_font=>c_name_arial.
  lo_style_bold->font->scheme = zcl_excel_style_font=>c_scheme_none.
  lo_style_bold->font->color-rgb  = zcl_excel_style_color=>c_red.
  lv_style_bold_guid          = lo_style_bold->get_guid( ).
  " Create an underline double style
  lo_style_underline                        = lo_excel->add_new_style( ).
  lo_style_underline->font->underline       = abap_true.
  lo_style_underline->font->underline_mode  = zcl_excel_style_font=>c_underline_double.
  lo_style_underline->font->name            = zcl_excel_style_font=>c_name_roman.
  lo_style_underline->font->scheme          = zcl_excel_style_font=>c_scheme_none.
  lo_style_underline->font->family          = zcl_excel_style_font=>c_family_roman.
  lv_style_underline_guid                   = lo_style_underline->get_guid( ).
  " Create filled style yellow
  lo_style_filled                 = lo_excel->add_new_style( ).
  lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
  lo_style_filled->fill->fgcolor-theme  = zcl_excel_style_color=>c_theme_accent6.
  lv_style_filled_guid            = lo_style_filled->get_guid( ).
  " Create border with button effects
  lo_style_button                   = lo_excel->add_new_style( ).
  lo_style_button->borders->right   = lo_border_dark.
  lo_style_button->borders->down    = lo_border_dark.
  lo_style_button->borders->left    = lo_border_light.
  lo_style_button->borders->top     = lo_border_light.
  lv_style_button_guid              = lo_style_button->get_guid( ).
  "Create style with border
  lo_style_border                         = lo_excel->add_new_style( ).
  lo_style_border->borders->allborders    = lo_border_dark.
  lo_style_border->borders->diagonal      = lo_border_dark.
  lo_style_border->borders->diagonal_mode = zcl_excel_style_borders=>c_diagonal_both.
  lv_style_border_guid                    = lo_style_border->get_guid( ).
  " Create filled style green
  lo_style_filled                     = lo_excel->add_new_style( ).
  lo_style_filled->fill->filltype     = zcl_excel_style_fill=>c_fill_solid.
  lo_style_filled->fill->fgcolor-rgb  = zcl_excel_style_color=>c_green.
  lo_style_filled->font->name         = zcl_excel_style_font=>c_name_cambria.
  lo_style_filled->font->scheme       = zcl_excel_style_font=>c_scheme_major.
  lv_style_filled_green_guid          = lo_style_filled->get_guid( ).

  " Create filled style turquoise using legacy excel ver <= 2003 palette. ()
  lo_style_filled                 = lo_excel->add_new_style( ).
  lo_excel->legacy_palette->set_color( "replace built-in color from palette with out custom RGB turquoise
      ip_index =     16
      ip_color =     '0040E0D0' ).

  lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
  lo_style_filled->fill->fgcolor-indexed  = 16.
  lv_style_filled_turquoise_guid            = lo_style_filled->get_guid( ).

  " Get active sheet
  lo_worksheet = lo_excel->get_active_worksheet( ).
  lo_worksheet->set_title( ip_title = 'Styles' ).
  lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ).
  lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Bold text'            ip_style = lv_style_bold_guid ).
  lo_worksheet->set_cell( ip_column = 'D' ip_row = 4 ip_value = 'Underlined text'      ip_style = lv_style_underline_guid ).
  lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'Filled text'          ip_style = lv_style_filled_guid ).
  lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = 'Borders'              ip_style = lv_style_border_guid ).
  lo_worksheet->set_cell( ip_column = 'D' ip_row = 7 ip_value = 'I''m not a button :)' ip_style = lv_style_button_guid ).
  lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'Modified color for Excel 2003' ip_style = lv_style_filled_turquoise_guid ).
  " Fill the cell and apply one style
  lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = 'Filled text'          ip_style = lv_style_filled_guid ).
  " Change the style
  lo_worksheet->set_cell_style( ip_column = 'B' ip_row = 6 ip_style = lv_style_filled_green_guid ).
  " Add Style to an empty cell to test Fix for Issue
  "#44 Exception ZCX_EXCEL thrown when style is set for an empty cell
  "
  lo_worksheet->set_cell_style( ip_column = 'E' ip_row = 6 ip_style = lv_style_filled_green_guid ).

* Demonstrate how to retroactivly change the cellstyle
*Filled text and underlinded text
  lo_worksheet->change_cell_style(  ip_column                     = 'B'
                                    ip_row                        = 5
                                    ip_font_bold                 = abap_true
                                    ip_font_italic               = abap_true ).

  lo_worksheet->change_cell_style(  ip_column                     = 'D'
                                    ip_row                        = 4
                                    ip_font_bold                 = abap_true
                                    ip_font_italic               = abap_true ).

  CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
  lv_file = lo_excel_writer->write_file( lo_excel ).

  " Convert to binary
  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer        = lv_file
    IMPORTING
      output_length = lv_bytecount
    TABLES
      binary_tab    = lt_file_tab.
*  " This method is only available on AS ABAP > 6.40
*  lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring  = lv_file ).
*  lv_bytecount = xstrlen( lv_file ).

  " Save the file
  cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount
                                                    filename     = lv_full_path
                                                    filetype     = 'BIN'
                                           CHANGING data_tab     = lt_file_tab ).


CLASS zcl_abapgit_object_suso DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.

  PUBLIC SECTION.
    INTERFACES zif_abapgit_object.
    ALIASES mo_files FOR zif_abapgit_object~mo_files.

    METHODS:
      constructor
        IMPORTING
          is_item     TYPE zif_abapgit_definitions=>ty_item
          iv_language TYPE spras.

  PROTECTED SECTION.
  PRIVATE SECTION.
    DATA:
      mv_objectname TYPE tobj-objct.

    METHODS:
      delete_documentation
        RAISING
          zcx_abapgit_exception,

      pre_check
        RAISING
          zcx_abapgit_exception,

      regenerate_sap_all.

ENDCLASS.

CLASS zcl_abapgit_object_suso IMPLEMENTATION.

  METHOD constructor.

    super->constructor( is_item     = is_item
                        iv_language = iv_language ).

    mv_objectname = ms_item-obj_name.

  ENDMETHOD.

  METHOD delete_documentation.

    DATA:
      lv_docu_obj TYPE dokhl-object,
      lv_dummy    TYPE sy-langu.

    lv_docu_obj  = mv_objectname.

    SELECT SINGLE langu
           FROM dokil INTO lv_dummy
           WHERE id   = 'UO'                            "#EC CI_GENBUFF
           AND object = lv_docu_obj.

    IF sy-subrc = 0.

      CALL FUNCTION 'DOKU_DELETE_ALL'
        EXPORTING
          doku_id                        = 'UO'
          doku_object                    = lv_docu_obj
          suppress_transport             = space
        EXCEPTIONS
          header_without_text            = 1
          index_without_header           = 2
          no_authority_for_devclass_xxxx = 3
          no_docu_found                  = 4
          object_is_already_enqueued     = 5
          object_is_enqueued_by_corr     = 6
          techn_enqueue_problem          = 7
          user_break                     = 8
          OTHERS                         = 9.

      IF sy-subrc <> 0.
        zcx_abapgit_exception=>raise_t100( ).
      ENDIF.

    ENDIF.

  ENDMETHOD.

  METHOD pre_check.

    CONSTANTS:
      lc_act_delete TYPE activ_auth VALUE '06'.

    DATA:
      lv_act_head            TYPE activ_auth,
      lv_dummy               TYPE string,
      lo_suso                TYPE REF TO object,
      lv_failed              TYPE abap_bool,
      lv_suso_collect_in_cts TYPE i,
      ls_clskey              TYPE seoclskey.

    " Downport: CL_SUSO_GEN doesn't exist in 702
    ls_clskey-clsname = |CL_SUSO_GEN|.

    CALL FUNCTION 'SEO_CLASS_EXISTENCE_CHECK'
      EXPORTING
        clskey        = ls_clskey
      EXCEPTIONS
        not_specified = 1
        not_existing  = 2
        is_interface  = 3
        no_text       = 4
        inconsistent  = 5
        OTHERS        = 6.

    IF sy-subrc = 0.

      " so these check are not executed in 702

      CREATE OBJECT lo_suso
        TYPE
          ('CL_SUSO_GEN').

      CALL METHOD lo_suso->('SUSO_LOAD_FROM_DB')
        EXPORTING
          id_object = mv_objectname
        RECEIVING
          ed_failed = lv_failed.

      IF lv_failed = abap_true.
        " Object & does not exist; choose an existing object
        MESSAGE s111(01) WITH mv_objectname INTO lv_dummy.
        zcx_abapgit_exception=>raise_t100( ).
      ENDIF.

      CALL METHOD lo_suso->('GET_SUSO_EDIT_MODE')
        EXPORTING
          id_object     = mv_objectname
          id_planed_act = lc_act_delete
        IMPORTING
          ed_mode_head  = lv_act_head.

      IF lv_act_head <> lc_act_delete.
        zcx_abapgit_exception=>raise( |SUSO { mv_objectname }: Delete not allowed. Check where-used in SU21| ).
      ENDIF.

      CALL METHOD lo_suso->('SUSO_COLLECT_IN_CTS')
        EXPORTING
          id_object = mv_objectname
        RECEIVING
          ed_result = lv_suso_collect_in_cts.

      IF lv_suso_collect_in_cts IS NOT INITIAL.
        zcx_abapgit_exception=>raise( |SUSO { mv_objectname }: Cannot delete| ).
      ENDIF.

    ENDIF.

  ENDMETHOD.

  METHOD regenerate_sap_all.

    DATA: ls_e071  TYPE e071,
          lt_e071  TYPE STANDARD TABLE OF e071,
          lt_e071k TYPE STANDARD TABLE OF e071k.

    ls_e071-pgmid = 'R3TR'.
    ls_e071-object = ms_item-obj_type.
    ls_e071-obj_name = ms_item-obj_name.
    INSERT ls_e071 INTO TABLE lt_e071.

    CALL FUNCTION 'PRGN_AFTER_IMP_SUSO_SAP_ALL'
      EXPORTING
        iv_tarclient  = '000'
        iv_is_upgrade = space
      TABLES
        tt_e071       = lt_e071
        tt_e071k      = lt_e071k.

  ENDMETHOD.

  METHOD zif_abapgit_object~changed_by.
    rv_user = c_user_unknown. " todo
  ENDMETHOD.

  METHOD zif_abapgit_object~delete.

    " FM SUSR_DELETE_OBJECT calls the UI. Therefore we reimplement it here.
    " As the class CL_SUSO_GEN isn't present in 702, we call dynamically and
    " skip the pre checks on 702 system. That seems ok.

    pre_check( ).

    delete_documentation( ).

    DELETE FROM tobj  WHERE objct  = mv_objectname.
    DELETE FROM tobjt WHERE object = mv_objectname.
    DELETE FROM tactz WHERE brobj  = mv_objectname.

    CALL FUNCTION 'SUPV_DELETE_OBJECT_ASSIGNMENTS'
      EXPORTING
        object_name  = mv_objectname
        all_releases = abap_true.

    CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
      EXPORTING
        object    = mv_objectname
        type      = 'SUSO'
        operation = 'DELETE'.

    regenerate_sap_all( ).

  ENDMETHOD.

  METHOD zif_abapgit_object~deserialize.
* see function group SUSA

    DATA: lv_objectname TYPE trobj_name,
          ls_tobj       TYPE tobj,
          ls_tobjt      TYPE tobjt,
          ls_tobjvorflg TYPE tobjvorflg,
          lt_tactz      TYPE TABLE OF tactz,
          lt_tobjvordat TYPE TABLE OF tobjvordat,
          lt_tobjvor    TYPE TABLE OF tobjvor.

    ASSERT NOT ms_item-obj_name IS INITIAL.

    io_xml->read( EXPORTING iv_name = 'TOBJ'
                  CHANGING cg_data = ls_tobj ).
    ls_tobj-bname = sy-uname.
    io_xml->read( EXPORTING iv_name = 'TOBJT'
                  CHANGING cg_data = ls_tobjt ).
    io_xml->read( EXPORTING iv_name = 'TOBJVORFLG'
                  CHANGING cg_data = ls_tobjvorflg ).
    io_xml->read( EXPORTING iv_name = 'TACTZ'
                  CHANGING  cg_data = lt_tactz ).
    io_xml->read( EXPORTING iv_name = 'TOBJVORDAT'
                  CHANGING  cg_data = lt_tobjvordat ).
    io_xml->read( EXPORTING iv_name = 'TOBJVOR'
                  CHANGING  cg_data = lt_tobjvor ).

    tadir_insert( iv_package ).

    lv_objectname = mv_objectname.

    CALL FUNCTION 'SUSR_COMMEDITCHECK'
      EXPORTING
        objectname      = lv_objectname
        transobjecttype = 'O'.

    MODIFY tobj FROM ls_tobj.                             "#EC CI_SUBRC
    MODIFY tobjt FROM ls_tobjt.                           "#EC CI_SUBRC
    MODIFY tobjvorflg FROM ls_tobjvorflg.                 "#EC CI_SUBRC
    DELETE FROM tactz WHERE brobj = ms_item-obj_name.     "#EC CI_SUBRC
    INSERT tactz FROM TABLE lt_tactz.                     "#EC CI_SUBRC
    DELETE FROM tobjvordat WHERE objct = ms_item-obj_name. "#EC CI_SUBRC
    INSERT tobjvordat FROM TABLE lt_tobjvordat.           "#EC CI_SUBRC
    DELETE FROM tobjvor WHERE objct = ms_item-obj_name.   "#EC CI_SUBRC
    INSERT tobjvor FROM TABLE lt_tobjvor.                 "#EC CI_SUBRC

    regenerate_sap_all( ).

  ENDMETHOD.

  METHOD zif_abapgit_object~exists.

    DATA: lv_objct TYPE tobj-objct.

    SELECT SINGLE objct FROM tobj INTO lv_objct
      WHERE objct = ms_item-obj_name.
    rv_bool = boolc( sy-subrc = 0 ).

  ENDMETHOD.

  METHOD zif_abapgit_object~get_comparator.
    RETURN.
  ENDMETHOD.

  METHOD zif_abapgit_object~get_deserialize_steps.
    APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
  ENDMETHOD.

  METHOD zif_abapgit_object~get_metadata.
    rs_metadata = get_metadata( ).
  ENDMETHOD.

  METHOD zif_abapgit_object~is_active.
    rv_active = is_active( ).
  ENDMETHOD.

  METHOD zif_abapgit_object~is_locked.

    rv_is_locked = abap_false.

  ENDMETHOD.

  METHOD zif_abapgit_object~jump.

    CALL FUNCTION 'SUSR_SHOW_OBJECT'
      EXPORTING
        object = mv_objectname.

    rv_exit = abap_true.

  ENDMETHOD.

  METHOD zif_abapgit_object~serialize.

    DATA: ls_tobj       TYPE tobj,
          ls_tobjt      TYPE tobjt,
          ls_tobjvorflg TYPE tobjvorflg,
          lt_tactz      TYPE TABLE OF tactz,
          lt_tobjvordat TYPE TABLE OF tobjvordat,
          lt_tobjvor    TYPE TABLE OF tobjvor.

    SELECT SINGLE * FROM tobj INTO ls_tobj
      WHERE objct = ms_item-obj_name.
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.
    CLEAR ls_tobj-bname.

    SELECT SINGLE * FROM tobjt INTO ls_tobjt
      WHERE object = ms_item-obj_name
      AND langu = mv_language.                          "#EC CI_GENBUFF
    IF sy-subrc <> 0.
      zcx_abapgit_exception=>raise( 'TOBJT no english description'
        && ' for object (' && ms_item-obj_name && ')' ).
    ENDIF.

    SELECT SINGLE * FROM tobjvorflg INTO ls_tobjvorflg
      WHERE objct = ms_item-obj_name.                     "#EC CI_SUBRC

    SELECT * FROM tactz INTO TABLE lt_tactz
      WHERE brobj = ms_item-obj_name
      ORDER BY PRIMARY KEY.               "#EC CI_SUBRC "#EC CI_GENBUFF

    SELECT * FROM tobjvordat INTO TABLE lt_tobjvordat
      WHERE objct = ms_item-obj_name
      ORDER BY PRIMARY KEY.               "#EC CI_SUBRC "#EC CI_GENBUFF

    SELECT * FROM tobjvor INTO TABLE lt_tobjvor
      WHERE objct = ms_item-obj_name
      ORDER BY PRIMARY KEY.                               "#EC CI_SUBRC

    io_xml->add( iv_name = 'TOBJ'
                 ig_data = ls_tobj ).
    io_xml->add( iv_name = 'TOBJT'
                 ig_data = ls_tobjt ).
    io_xml->add( iv_name = 'TOBJVORFLG'
                 ig_data = ls_tobjvorflg ).
    io_xml->add( ig_data = lt_tactz
                 iv_name = 'TACTZ' ).
    io_xml->add( ig_data = lt_tobjvordat
                 iv_name = 'TOBJVORDAT' ).
    io_xml->add( ig_data = lt_tobjvor
                 iv_name = 'TOBJVOR' ).

  ENDMETHOD.
ENDCLASS.