SAP DB2_LOG_READ Function Module for New DB13: Maps SDBAH to new structure DB6PMPROT
DB2_LOG_READ is a standard db2 log read SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for New DB13: Maps SDBAH to new structure DB6PMPROT 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 db2 log read FM, simply by entering the name DB2_LOG_READ into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDB2JOB
Program Name: SAPLSDB2JOB
Main Program: SAPLSDB2JOB
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DB2_LOG_READ 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 'DB2_LOG_READ'"New DB13: Maps SDBAH to new structure DB6PMPROT.
EXPORTING
FROM_DATE = "Date and Time, Current (Application Server) Date
FROM_TIME = "Date and Time, Current Application Server Time
* TO_DATE = "Date and Time, Current (Application Server) Date
* TO_TIME = "Date and Time, Current Application Server Time
* SYSTEM_ID = SY-SYSID "Name of the SAP System
* CONNECTION = "Logical name for a database connection
TABLES
LOGS = "DB6: Protocol Table for DBA Actions
* PLANNINGS = "DBA Planning Table
EXCEPTIONS
INVALID_PARAMETER_SET = 1 SYSTEM_ERROR = 2
IMPORTING Parameters details for DB2_LOG_READ
FROM_DATE - Date and Time, Current (Application Server) Date
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
FROM_TIME - Date and Time, Current Application Server Time
Data type: SY-UZEITOptional: No
Call by Reference: No ( called with pass by value option)
TO_DATE - Date and Time, Current (Application Server) Date
Data type: SY-DATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
TO_TIME - Date and Time, Current Application Server Time
Data type: SY-UZEITOptional: Yes
Call by Reference: No ( called with pass by value option)
SYSTEM_ID - Name of the SAP System
Data type: DB6NAVSYST-SYSIDDefault: SY-SYSID
Optional: Yes
Call by Reference: No ( called with pass by value option)
CONNECTION - Logical name for a database connection
Data type: DBCON-CON_NAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for DB2_LOG_READ
LOGS - DB6: Protocol Table for DBA Actions
Data type: DB6PMPROTOptional: No
Call by Reference: Yes
PLANNINGS - DBA Planning Table
Data type: SDBAPOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
INVALID_PARAMETER_SET -
Data type:Optional: No
Call by Reference: Yes
SYSTEM_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for DB2_LOG_READ 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_logs | TYPE STANDARD TABLE OF DB6PMPROT, " | |||
| lv_from_date | TYPE SY-DATUM, " | |||
| lv_invalid_parameter_set | TYPE SY, " | |||
| lv_from_time | TYPE SY-UZEIT, " | |||
| lt_plannings | TYPE STANDARD TABLE OF SDBAP, " | |||
| lv_system_error | TYPE SDBAP, " | |||
| lv_to_date | TYPE SY-DATUM, " | |||
| lv_to_time | TYPE SY-UZEIT, " | |||
| lv_system_id | TYPE DB6NAVSYST-SYSID, " SY-SYSID | |||
| lv_connection | TYPE DBCON-CON_NAME. " |
|   CALL FUNCTION 'DB2_LOG_READ' "New DB13: Maps SDBAH to new structure DB6PMPROT |
| EXPORTING | ||
| FROM_DATE | = lv_from_date | |
| FROM_TIME | = lv_from_time | |
| TO_DATE | = lv_to_date | |
| TO_TIME | = lv_to_time | |
| SYSTEM_ID | = lv_system_id | |
| CONNECTION | = lv_connection | |
| TABLES | ||
| LOGS | = lt_logs | |
| PLANNINGS | = lt_plannings | |
| EXCEPTIONS | ||
| INVALID_PARAMETER_SET = 1 | ||
| SYSTEM_ERROR = 2 | ||
| . " DB2_LOG_READ | ||
ABAP code using 7.40 inline data declarations to call FM DB2_LOG_READ
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 DATUM FROM SY INTO @DATA(ld_from_date). | ||||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_from_time). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_to_date). | ||||
| "SELECT single UZEIT FROM SY INTO @DATA(ld_to_time). | ||||
| "SELECT single SYSID FROM DB6NAVSYST INTO @DATA(ld_system_id). | ||||
| DATA(ld_system_id) | = SY-SYSID. | |||
| "SELECT single CON_NAME FROM DBCON INTO @DATA(ld_connection). | ||||
Search for further information about these or an SAP related objects