## 4.2.15.2.5  Reading Change Documents
Use class CL\_CHDO\_READ\_TOOLS to read change documents.
Method CHANGEDOCUMENT\_READ reads the change documents for one change document object. You can restrict the search by various parameters (such as changed by, date, or time).
Import Parameters
| Parameter Name   | Field Name   | Value Help                                                                                                       |
|------------------|--------------|------------------------------------------------------------------------------------------------------------------|
| ET_CDREDADD_TAB  |              | Table type for structure CDREDADD , change documents return table                                                |
| I_OBJECTCLAS     |              | Nameof change document object                                                                                    |
| IT_OBJECTID      |              | Range table of application object IDs                                                                            |
| I_DATE_OF_CHANGE |              | From-change date for search. All change documents are selected written on the specified date or later are found. |
| I_TIME_OF_CHANGE |              | From-change time for search. If no change time is specified, a selection is made from the time '000000'.         |
| Parameter Name   | Field Name   | Value Help                                                                                                                                                                                                                                                                               |
|------------------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| I_DATE_UNTIL     |              | Change date up to which you want to search. All change documents are se- lected written up to and including this date.                                                                                                                                                                   |
| I_TIME_UNTIL     |              | Latest change time in search. Time to which change documents are read on the "To" change date. If no time is passed, all change documents on the "To" change date are read.                                                                                                              |
| IT_USERNAME      |              | Username of the person responsible in change document. Only those change documents are selected that document changes made by this user. If no user name is passed, change documents are read for all users.                                                                             |
| IS_READ_OPTIONS  |              |                                                                                                                                                                                                                                                                                          |
|                  | local_time   | If it is set, the date and time information in the formatted change documents is displayed in the local time of the user.                                                                                                                                                                |
|                  | time_zone    | It contains the time zone in which the change documents were written. If it's not set UTC applies. If it contains a time zone, this zone is used as the time zone in which the change documents were saved. If the change documents were saved in CET, the parameter must be set to CET. |
| Parameter Name   | Field Name      | Value Help                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|------------------|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|                  | it_changenr     | Range table for change document number. Change document numbers were created internally as part of key of change documents. The key of change document is represented by Object name, Object ID of the application object and a change number. During creation of change documents using the write method of class <name space>CL_<change document object name>_CHDO Change documents numbers were received by export paramter CHANGENUMBER . |
|                  | only_headers    | Only return the change document header information without the position                                                                                                                                                                                                                                                                                                                                                                       |
| IV_READ_ARCHIVE  | IV_READ_ARCHIVE | Control the interface to read change documents from the archive, too                                                                                                                                                                                                                                                                                                                                                                          |
| Export Parameter |                 |                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Parameter Name   | Field Name      | Value Help                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|                  | OBJECTCLAS      | Nameof Change Document Object                                                                                                                                                                                                                                                                                                                                                                                                                 |
|                  | OBJECTID        | Object ID of application object                                                                                                                                                                                                                                                                                                                                                                                                               |
|                  | OBJECTID_DB     | Object value                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                  | CHANGENR        | Change Number of Document                                                                                                                                                                                                                                                                                                                                                                                                                     |
|                  | OBJECTTXT       | Object Description                                                                                                                                                                                                                                                                                                                                                                                                                            |
|                  | USERNAME        | Username of the person responsible in change document                                                                                                                                                                                                                                                                                                                                                                                         |
|                  | USERNAME_DB     | Username of the person responsible in change document                                                                                                                                                                                                                                                                                                                                                                                         |
|                  | UDATE           | Creation date of the change document                                                                                                                                                                                                                                                                                                                                                                                                          |
|                  | UDATE_DB        | Creation date of the change document                                                                                                                                                                                                                                                                                                                                                                                                          |
|                  | UTIME           | Time changed                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|                  | UTIME_DB        | Time changed                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Parameter Name   | Field Name       | Value Help                                         |
|------------------|------------------|----------------------------------------------------|
|                  | TCODE            | Transaction in which a change was made             |
|                  | APPLNAME         | Application Object                                 |
|                  | APPLTYPE         | Application Type                                   |
|                  | TABNAME          | Change document creation: Table name               |
|                  | TABNAME_DB       | Change document creation: Table name               |
|                  | TABKEY           | Key of Changed Table Line                          |
|                  | TABKEY_DB        | Key of Changed Table Line                          |
|                  | KEYLEN           | Table key length                                   |
|                  | CHNGIND          | Type of Change                                     |
|                  | FNAME            | FieldName                                          |
|                  | FNAME_DB         | FieldName                                          |
|                  | FTEXT            | Explanatory Short Text                             |
|                  | TEXTART          | Create change document: Text type                  |
|                  | SPRACHE          | Language Key                                       |
|                  | TEXT_CASE        | Text change flag ('X')                             |
|                  | OUTLEN           | Output length of the old and new value             |
|                  | F_OLD            | Old contents of changed field                      |
|                  | F_NEW            | New contents of changed field                      |
|                  | F_NEW_DB         | New contents of changed field                      |
|                  | VALUE_OLD        | Old Extended Value (Long)                          |
|                  | VALUE_OLD_DB     | Old Extended Value (Long)                          |
|                  | VALUE_NEW        | New Extended Value (Long)                          |
|                  | VALUE_NEW_DB     | New Extended Value (Long)                          |
|                  | VALUE_RAWSTR_OLD | Old Change Document Value for RAW- STRING Variable |
| Parameter Name   | Field Name          | Value Help                                         |
|------------------|---------------------|----------------------------------------------------|
|                  | VALUE_RAWSTR_OLD_DB | Old Change Document Value for RAW- STRING Variable |
|                  | VALUE_RAWSTR_NEW    | New Change Document Value for RAW- STRING Variable |
|                  | VALUE_RAWSTR_NEW_DB | New Change Document Value for RAW- STRING Variable |
|                  | VALUE_SHSTR_OLD     | Old Extended Value (Short)                         |
|                  | VALUE_SHSTR_OLD_DB  | Old Extended Value (Short)                         |
|                  | VALUE_SHSTR_NEW     | New Extended Value (Short)                         |
|                  | VALUE_SHSTR_NEW_DB  | New Extended Value (Short)                         |
|                  | KEYGUID             | KEYGUID for Link to CDPOS_UID                      |
|                  | TABKEY254           | Key of Modified Table Row                          |
|                  | TABKEY254_DB        | Key of Modified Table Row                          |
|                  | EXT_KEYLEN          | Table key length                                   |
|                  | KEYGUID_STR         | KEYGUID for Link to CDPOS_STR                      |
|                  | VERSION             | 3-Byte field                                       |
##  Sample Code
Read all change documents for object class ZCHDO\_TEST
```
CLASS zcl_chdo_read DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES if_oo_adt_classrun. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_chdo_read IMPLEMENTATION. METHOD if_oo_adt_classrun~main. DATA: rt_cdredadd TYPE cl_chdo_read_tools=>TT_CDREDADD_TAB, lr_err      TYPE REF TO cx_chdo_read_error. TRY. cl_chdo_read_tools=>changedocument_read( EXPORTING i_objectclass    = 'ZCHDO_TEST'  " change document object name *          it_objectid      = *          i_date_of_change = *          i_time_of_change = *          i_date_until     = *          i_time_until     = *          it_username      =
```
```
*          it_read_options  = IMPORTING et_cdredadd_tab  = rt_cdredadd    " result returned in table ). CATCH cx_chdo_read_error into lr_err. out->write( |Exception occurred: { lr_err->get_text( ) }| ). ENDTRY. ENDMETHOD. ENDCLASS.
```
##  Sample Code
Read all change documents for object class ZCHDO\_TEST including the archive.
```
CLASS zcl_chdo_read DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES if_oo_adt_classrun. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_chdo_read IMPLEMENTATION. METHOD if_oo_adt_classrun~main. DATA: rt_cdredadd TYPE cl_chdo_read_tools=>tt_cdredadd_tab, lr_err      TYPE REF TO cx_chdo_read_error. DATA lt_cdredadd TYPE cl_chdo_read_tools=>tt_cdredadd_tab. TRY. DATA(lt_files) = cl_arch_read_api=>get_files_to_read( iv_archiving_object = 'ZAOBJ_TEST' ). SORT lt_files BY creation_date DESCENDING creation_time DESCENDING. READ TABLE lt_files ASSIGNING FIELD-SYMBOL(<ls_file>) INDEX 1. CHECK sy-subrc = 0. " no files DATA(lo_read) = cl_arch_read_api=>get_instance( iv_archiving_object = 'ZAOBJ_TEST' iv_archive_key = <ls_file>-archive_key ). DO. lo_read->get_next_data_object( IMPORTING ev_end_of_file = DATA(lv_end_of_file) ev_archive_key = DATA(lv_archive_key) ev_object_offset = DATA(lv_offset) ). IF lv_end_of_file = abap_true. EXIT. ENDIF. *          no application data *          lo_read->get_data_records( EXPORTING iv_record_structure = 'XXX' *                                     IMPORTING et_data_records = lt_data ). *          APPEND LINES OF lt_data TO lt_data_all. TRY. cl_chdo_read_tools=>changedocument_read( EXPORTING i_objectclass    = 'ZCHDO_TEST' iv_read_archive  = lo_read IMPORTING et_cdredadd_tab  = DATA(lt_cd) ). CATCH cx_chdo_read_error INTO DATA(ls_read_err). out->write( |Exception occurred: { ls_read_err->get_text( ) }| ). ENDTRY. APPEND LINES OF lt_cd TO lt_cdredadd. ENDDO.
```
```
lo_read->close( ). CATCH cx_arch_api INTO DATA(lx_error). out->write( |Exception occurred: { lx_error->get_text( ) }| ). ENDTRY. ENDMETHOD.
```