SAP APPL_LOG_READ_DB Function Module for Application log: Read log from database
APPL_LOG_READ_DB is a standard appl log read db SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Application log: Read log from database 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 appl log read db FM, simply by entering the name APPL_LOG_READ_DB into the relevant SAP transaction such as SE37 or SE38.
Function Group: SLG1
Program Name: SAPLSLG1
Main Program:
Appliation area:
Release date: 22-Dec-1994
Mode(Normal, Remote etc): Normal Function Module
Update:

Function APPL_LOG_READ_DB 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 'APPL_LOG_READ_DB'"Application log: Read log from database.
EXPORTING
* OBJECT = '*' "Object name
* TRANSACTION_CODE = '*' "Transaction name
* USER_ID = ' ' "User name
* MODE = '+' "Operating mode
* PUT_INTO_MEMORY = ' ' "
* SUBOBJECT = '*' "Subobject name
* EXTERNAL_NUMBER = ' ' "external number
* DATE_FROM = '00000000' "Read-from date
* DATE_TO = SY-DATUM "Read-by date
* TIME_FROM = '000000' "Read-from time
* TIME_TO = SY-UZEIT "Read-by time
* LOG_CLASS = '4' "Problem class
* PROGRAM_NAME = '*' "Program name
IMPORTING
NUMBER_OF_LOGS = "Number of logs read
TABLES
* HEADER_DATA = "Log header data
* HEADER_PARAMETERS = "Log parameters
* MESSAGES = "Log messages
* MESSAGE_PARAMETERS = "Message parameters
* CONTEXTS = "
* T_EXCEPTIONS = "Application Log: Exceptions in Log
IMPORTING Parameters details for APPL_LOG_READ_DB
OBJECT - Object name
Data type: BALHDR-OBJECTDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TRANSACTION_CODE - Transaction name
Data type: BALHDR-ALTCODEDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
USER_ID - User name
Data type: BALHDR-ALUSERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MODE - Operating mode
Data type: BALHDR-ALMODEDefault: '+'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PUT_INTO_MEMORY -
Data type: BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SUBOBJECT - Subobject name
Data type: BALHDR-SUBOBJECTDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXTERNAL_NUMBER - external number
Data type: BALHDR-EXTNUMBERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DATE_FROM - Read-from date
Data type: BALHDR-ALDATEDefault: '00000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DATE_TO - Read-by date
Data type: BALHDR-ALDATEDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
TIME_FROM - Read-from time
Data type: BALHDR-ALTIMEDefault: '000000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TIME_TO - Read-by time
Data type: BALHDR-ALTIMEDefault: SY-UZEIT
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOG_CLASS - Problem class
Data type: BALM-PROBCLASSDefault: '4'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROGRAM_NAME - Program name
Data type: BALHDR-ALPROGDefault: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for APPL_LOG_READ_DB
NUMBER_OF_LOGS - Number of logs read
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for APPL_LOG_READ_DB
HEADER_DATA - Log header data
Data type: BALHDROptional: Yes
Call by Reference: No ( called with pass by value option)
HEADER_PARAMETERS - Log parameters
Data type: BALHDRPOptional: Yes
Call by Reference: No ( called with pass by value option)
MESSAGES - Log messages
Data type: BALMOptional: Yes
Call by Reference: No ( called with pass by value option)
MESSAGE_PARAMETERS - Message parameters
Data type: BALMPOptional: Yes
Call by Reference: No ( called with pass by value option)
CONTEXTS -
Data type: BALCOptional: Yes
Call by Reference: No ( called with pass by value option)
T_EXCEPTIONS - Application Log: Exceptions in Log
Data type: BAL_S_EXCEPTIONOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for APPL_LOG_READ_DB 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: | ||||
| lv_object | TYPE BALHDR-OBJECT, " '*' | |||
| lt_header_data | TYPE STANDARD TABLE OF BALHDR, " | |||
| lv_number_of_logs | TYPE BALHDR, " | |||
| lv_transaction_code | TYPE BALHDR-ALTCODE, " '*' | |||
| lv_user_id | TYPE BALHDR-ALUSER, " SPACE | |||
| lv_mode | TYPE BALHDR-ALMODE, " '+' | |||
| lv_put_into_memory | TYPE BOOLEAN, " SPACE | |||
| lv_subobject | TYPE BALHDR-SUBOBJECT, " '*' | |||
| lt_header_parameters | TYPE STANDARD TABLE OF BALHDRP, " | |||
| lt_messages | TYPE STANDARD TABLE OF BALM, " | |||
| lv_external_number | TYPE BALHDR-EXTNUMBER, " SPACE | |||
| lv_date_from | TYPE BALHDR-ALDATE, " '00000000' | |||
| lt_message_parameters | TYPE STANDARD TABLE OF BALMP, " | |||
| lv_date_to | TYPE BALHDR-ALDATE, " SY-DATUM | |||
| lt_contexts | TYPE STANDARD TABLE OF BALC, " | |||
| lv_time_from | TYPE BALHDR-ALTIME, " '000000' | |||
| lt_t_exceptions | TYPE STANDARD TABLE OF BAL_S_EXCEPTION, " | |||
| lv_time_to | TYPE BALHDR-ALTIME, " SY-UZEIT | |||
| lv_log_class | TYPE BALM-PROBCLASS, " '4' | |||
| lv_program_name | TYPE BALHDR-ALPROG. " '*' |
|   CALL FUNCTION 'APPL_LOG_READ_DB' "Application log: Read log from database |
| EXPORTING | ||
| OBJECT | = lv_object | |
| TRANSACTION_CODE | = lv_transaction_code | |
| USER_ID | = lv_user_id | |
| MODE | = lv_mode | |
| PUT_INTO_MEMORY | = lv_put_into_memory | |
| SUBOBJECT | = lv_subobject | |
| EXTERNAL_NUMBER | = lv_external_number | |
| DATE_FROM | = lv_date_from | |
| DATE_TO | = lv_date_to | |
| TIME_FROM | = lv_time_from | |
| TIME_TO | = lv_time_to | |
| LOG_CLASS | = lv_log_class | |
| PROGRAM_NAME | = lv_program_name | |
| IMPORTING | ||
| NUMBER_OF_LOGS | = lv_number_of_logs | |
| TABLES | ||
| HEADER_DATA | = lt_header_data | |
| HEADER_PARAMETERS | = lt_header_parameters | |
| MESSAGES | = lt_messages | |
| MESSAGE_PARAMETERS | = lt_message_parameters | |
| CONTEXTS | = lt_contexts | |
| T_EXCEPTIONS | = lt_t_exceptions | |
| . " APPL_LOG_READ_DB | ||
ABAP code using 7.40 inline data declarations to call FM APPL_LOG_READ_DB
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 OBJECT FROM BALHDR INTO @DATA(ld_object). | ||||
| DATA(ld_object) | = '*'. | |||
| "SELECT single ALTCODE FROM BALHDR INTO @DATA(ld_transaction_code). | ||||
| DATA(ld_transaction_code) | = '*'. | |||
| "SELECT single ALUSER FROM BALHDR INTO @DATA(ld_user_id). | ||||
| DATA(ld_user_id) | = ' '. | |||
| "SELECT single ALMODE FROM BALHDR INTO @DATA(ld_mode). | ||||
| DATA(ld_mode) | = '+'. | |||
| DATA(ld_put_into_memory) | = ' '. | |||
| "SELECT single SUBOBJECT FROM BALHDR INTO @DATA(ld_subobject). | ||||
| DATA(ld_subobject) | = '*'. | |||
| "SELECT single EXTNUMBER FROM BALHDR INTO @DATA(ld_external_number). | ||||
| DATA(ld_external_number) | = ' '. | |||
| "SELECT single ALDATE FROM BALHDR INTO @DATA(ld_date_from). | ||||
| DATA(ld_date_from) | = '00000000'. | |||
| "SELECT single ALDATE FROM BALHDR INTO @DATA(ld_date_to). | ||||
| DATA(ld_date_to) | = SY-DATUM. | |||
| "SELECT single ALTIME FROM BALHDR INTO @DATA(ld_time_from). | ||||
| DATA(ld_time_from) | = '000000'. | |||
| "SELECT single ALTIME FROM BALHDR INTO @DATA(ld_time_to). | ||||
| DATA(ld_time_to) | = SY-UZEIT. | |||
| "SELECT single PROBCLASS FROM BALM INTO @DATA(ld_log_class). | ||||
| DATA(ld_log_class) | = '4'. | |||
| "SELECT single ALPROG FROM BALHDR INTO @DATA(ld_program_name). | ||||
| DATA(ld_program_name) | = '*'. | |||
Search for further information about these or an SAP related objects