SAP Function Modules

CHANGEDOCUMENT_READ_HEADERS_N SAP Function module







CHANGEDOCUMENT_READ_HEADERS_N is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CHANGEDOCUMENT_READ_HEADERS_N into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SCD1
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CHANGEDOCUMENT_READ_HEADERS_N - CHANGEDOCUMENT READ HEADERS N





CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS_N' "
  EXPORTING
*   archive_handle = 0          " sy-tabix
*   date_of_change = '00000000'  " cdhdr-udate
    objectclass =               " cdhdr-objectclas
*   objectid = SPACE            " cdhdr-objectid
*   time_of_change = '000000'   " cdhdr-utime
*   username = SY-UNAME         " cdhdr-username
*   local_time = SPACE          "
*   time_zone = 'UTC'           " ttzz-tzone
*   date_until = '99991231'     " cdhdr-udate
*   time_until = '235959'       " cdhdr-utime
*   noplus_aswildcard_inobjid = SPACE  " c
  TABLES
    i_cdhdr =                   " cdhdr
  EXCEPTIONS
    NO_POSITION_FOUND = 1       "
    WRONG_ACCESS_TO_ARCHIVE = 2  "
    TIME_ZONE_CONVERSION_ERROR = 3  "
    .  "  CHANGEDOCUMENT_READ_HEADERS_N

ABAP code example for Function Module CHANGEDOCUMENT_READ_HEADERS_N





The ABAP code below is a full code listing to execute function module CHANGEDOCUMENT_READ_HEADERS_N including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_i_cdhdr  TYPE STANDARD TABLE OF CDHDR,"TABLES PARAM
wa_i_cdhdr  LIKE LINE OF it_i_cdhdr .

DATA(ld_archive_handle) = '123 '.

SELECT single UDATE
FROM CDHDR
INTO @DATA(ld_date_of_change).


SELECT single OBJECTCLAS
FROM CDHDR
INTO @DATA(ld_objectclass).


SELECT single OBJECTID
FROM CDHDR
INTO @DATA(ld_objectid).


SELECT single UTIME
FROM CDHDR
INTO @DATA(ld_time_of_change).


SELECT single USERNAME
FROM CDHDR
INTO @DATA(ld_username).

DATA(ld_local_time) = 'some text here'.

SELECT single TZONE
FROM TTZZ
INTO @DATA(ld_time_zone).


SELECT single UDATE
FROM CDHDR
INTO @DATA(ld_date_until).


SELECT single UTIME
FROM CDHDR
INTO @DATA(ld_time_until).

DATA(ld_noplus_aswildcard_inobjid) = '123 '.

"populate fields of struture and append to itab
append wa_i_cdhdr to it_i_cdhdr. . CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS_N' EXPORTING * archive_handle = ld_archive_handle * date_of_change = ld_date_of_change objectclass = ld_objectclass * objectid = ld_objectid * time_of_change = ld_time_of_change * username = ld_username * local_time = ld_local_time * time_zone = ld_time_zone * date_until = ld_date_until * time_until = ld_time_until * noplus_aswildcard_inobjid = ld_noplus_aswildcard_inobjid TABLES i_cdhdr = it_i_cdhdr EXCEPTIONS NO_POSITION_FOUND = 1 WRONG_ACCESS_TO_ARCHIVE = 2 TIME_ZONE_CONVERSION_ERROR = 3 . " CHANGEDOCUMENT_READ_HEADERS_N
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_archive_handle  TYPE SY-TABIX ,
it_i_cdhdr  TYPE STANDARD TABLE OF CDHDR ,
wa_i_cdhdr  LIKE LINE OF it_i_cdhdr,
ld_date_of_change  TYPE CDHDR-UDATE ,
ld_objectclass  TYPE CDHDR-OBJECTCLAS ,
ld_objectid  TYPE CDHDR-OBJECTID ,
ld_time_of_change  TYPE CDHDR-UTIME ,
ld_username  TYPE CDHDR-USERNAME ,
ld_local_time  TYPE STRING ,
ld_time_zone  TYPE TTZZ-TZONE ,
ld_date_until  TYPE CDHDR-UDATE ,
ld_time_until  TYPE CDHDR-UTIME ,
ld_noplus_aswildcard_inobjid  TYPE C .

ld_archive_handle = '123 '.

"populate fields of struture and append to itab
append wa_i_cdhdr to it_i_cdhdr.

SELECT single UDATE
FROM CDHDR
INTO ld_date_of_change.


SELECT single OBJECTCLAS
FROM CDHDR
INTO ld_objectclass.


SELECT single OBJECTID
FROM CDHDR
INTO ld_objectid.


SELECT single UTIME
FROM CDHDR
INTO ld_time_of_change.


SELECT single USERNAME
FROM CDHDR
INTO ld_username.

ld_local_time = 'some text here'.

SELECT single TZONE
FROM TTZZ
INTO ld_time_zone.


SELECT single UDATE
FROM CDHDR
INTO ld_date_until.


SELECT single UTIME
FROM CDHDR
INTO ld_time_until.

ld_noplus_aswildcard_inobjid = '123 '.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CHANGEDOCUMENT_READ_HEADERS_N or its description.