SAP CD_OLD_READ_HEADERS Function Module for Change document: Read change document header
CD_OLD_READ_HEADERS is a standard cd old read headers SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Change document: Read change document header processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for cd old read headers FM, simply by entering the name CD_OLD_READ_HEADERS into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCD9
Program Name: SAPLSCD9
Main Program:
Appliation area: *
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CD_OLD_READ_HEADERS pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'CD_OLD_READ_HEADERS'"Change document: Read change document header.
EXPORTING
* DATE_OF_CHANGE = '00000000' "From-change date for search
OBJECTCLASS = "Object class for determining change document no.
* OBJECTID = ' ' "Object ID
* TIME_OF_CHANGE = '000000' "From-change time for search
* USERNAME = SY-UNAME "Chgd By
* LOCAL_TIME = ' ' "local or system time (re: time zone)
TABLES
I_CDHDR = "Table with determined header information
EXCEPTIONS
NO_POSITION_FOUND = 1 WRONG_ACCESS_TO_ARCHIVE = 2 TIME_ZONE_CONVERSION_ERROR = 3
IMPORTING Parameters details for CD_OLD_READ_HEADERS
DATE_OF_CHANGE - From-change date for search
Data type: CDHDR_OLD-UDATEDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECTCLASS - Object class for determining change document no.
Data type: CDHDR_OLD-OBJECTCLASOptional: No
Call by Reference: No ( called with pass by value option)
OBJECTID - Object ID
Data type: CDHDR_OLD-OBJECTIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TIME_OF_CHANGE - From-change time for search
Data type: CDHDR_OLD-UTIMEDefault: '000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
USERNAME - Chgd By
Data type: CDHDR_OLD-USERNAMEDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOCAL_TIME - local or system time (re: time zone)
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CD_OLD_READ_HEADERS
I_CDHDR - Table with determined header information
Data type: CDHDR_OLDOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_POSITION_FOUND - No items found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_ACCESS_TO_ARCHIVE - incorrect access to archive
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TIME_ZONE_CONVERSION_ERROR - Error converting local to system time
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CD_OLD_READ_HEADERS Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_i_cdhdr | TYPE STANDARD TABLE OF CDHDR_OLD, " | |||
| lv_date_of_change | TYPE CDHDR_OLD-UDATE, " '00000000' | |||
| lv_no_position_found | TYPE CDHDR_OLD, " | |||
| lv_objectclass | TYPE CDHDR_OLD-OBJECTCLAS, " | |||
| lv_wrong_access_to_archive | TYPE CDHDR_OLD, " | |||
| lv_objectid | TYPE CDHDR_OLD-OBJECTID, " SPACE | |||
| lv_time_zone_conversion_error | TYPE CDHDR_OLD, " | |||
| lv_time_of_change | TYPE CDHDR_OLD-UTIME, " '000000' | |||
| lv_username | TYPE CDHDR_OLD-USERNAME, " SY-UNAME | |||
| lv_local_time | TYPE CDHDR_OLD. " SPACE |
|   CALL FUNCTION 'CD_OLD_READ_HEADERS' "Change document: Read change document header |
| EXPORTING | ||
| DATE_OF_CHANGE | = lv_date_of_change | |
| OBJECTCLASS | = lv_objectclass | |
| OBJECTID | = lv_objectid | |
| TIME_OF_CHANGE | = lv_time_of_change | |
| USERNAME | = lv_username | |
| LOCAL_TIME | = lv_local_time | |
| TABLES | ||
| I_CDHDR | = lt_i_cdhdr | |
| EXCEPTIONS | ||
| NO_POSITION_FOUND = 1 | ||
| WRONG_ACCESS_TO_ARCHIVE = 2 | ||
| TIME_ZONE_CONVERSION_ERROR = 3 | ||
| . " CD_OLD_READ_HEADERS | ||
ABAP code using 7.40 inline data declarations to call FM CD_OLD_READ_HEADERS
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single UDATE FROM CDHDR_OLD INTO @DATA(ld_date_of_change). | ||||
| DATA(ld_date_of_change) | = '00000000'. | |||
| "SELECT single OBJECTCLAS FROM CDHDR_OLD INTO @DATA(ld_objectclass). | ||||
| "SELECT single OBJECTID FROM CDHDR_OLD INTO @DATA(ld_objectid). | ||||
| DATA(ld_objectid) | = ' '. | |||
| "SELECT single UTIME FROM CDHDR_OLD INTO @DATA(ld_time_of_change). | ||||
| DATA(ld_time_of_change) | = '000000'. | |||
| "SELECT single USERNAME FROM CDHDR_OLD INTO @DATA(ld_username). | ||||
| DATA(ld_username) | = SY-UNAME. | |||
| DATA(ld_local_time) | = ' '. | |||
Search for further information about these or an SAP related objects