SAP Function Modules

APPL_LOG_READ_INTERN SAP Function module - Application Log: Read local memory







APPL_LOG_READ_INTERN 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 APPL_LOG_READ_INTERN into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SLG0
Released Date: 22.12.1994
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM APPL_LOG_READ_INTERN - APPL LOG READ INTERN





CALL FUNCTION 'APPL_LOG_READ_INTERN' "Application Log: Read local memory
* EXPORTING
*   object =                    " balhdr-object  Object name
*   subobject = SPACE           " balhdr-subobject  Subobject name
*   log_handle =                " balhdr-log_handle
*   log_class = '4'             " balhdr-probclass  Log class
*   language = SPACE            " sy-langu      Message language
  IMPORTING
    number_of_logs =            "               Number of logs read
  TABLES
    header_data =               " balhdr        Log header data
    header_parameters =         " balhdrp       Log parameters
    messages =                  " balm          Log messages
    message_parameters =        " balmp         Message parameters
*   contexts =                  " balc
*   message_prepared =          " t_prepared_messages  formatted log messages
*   t_exceptions =              " bal_s_exception  Application Log: Exceptions in Log
*   t_prepared_exc =            " bal_s_prepared_exc  Application Log: Formatted Exceptions in Log
  EXCEPTIONS
    OBJECT_NOT_FOUND = 1        "               Object not found
    SUBOBJECT_NOT_FOUND = 2     "               Subobject not found
    FUNCTION_NOT_COMPLETED = 3  "               Formatting unsuccessful
    MESSAGE_NOT_FOUND = 4       "               Log message not found
    PARAMETER_MISSING = 5       "               Input parameter missing
    .  "  APPL_LOG_READ_INTERN

ABAP code example for Function Module APPL_LOG_READ_INTERN





The ABAP code below is a full code listing to execute function module APPL_LOG_READ_INTERN 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:
ld_number_of_logs  TYPE STRING ,
it_header_data  TYPE STANDARD TABLE OF BALHDR,"TABLES PARAM
wa_header_data  LIKE LINE OF it_header_data ,
it_header_parameters  TYPE STANDARD TABLE OF BALHDRP,"TABLES PARAM
wa_header_parameters  LIKE LINE OF it_header_parameters ,
it_messages  TYPE STANDARD TABLE OF BALM,"TABLES PARAM
wa_messages  LIKE LINE OF it_messages ,
it_message_parameters  TYPE STANDARD TABLE OF BALMP,"TABLES PARAM
wa_message_parameters  LIKE LINE OF it_message_parameters ,
it_contexts  TYPE STANDARD TABLE OF BALC,"TABLES PARAM
wa_contexts  LIKE LINE OF it_contexts ,
it_message_prepared  TYPE STANDARD TABLE OF T_PREPARED_MESSAGES,"TABLES PARAM
wa_message_prepared  LIKE LINE OF it_message_prepared ,
it_t_exceptions  TYPE STANDARD TABLE OF BAL_S_EXCEPTION,"TABLES PARAM
wa_t_exceptions  LIKE LINE OF it_t_exceptions ,
it_t_prepared_exc  TYPE STANDARD TABLE OF BAL_S_PREPARED_EXC,"TABLES PARAM
wa_t_prepared_exc  LIKE LINE OF it_t_prepared_exc .


SELECT single OBJECT
FROM BALHDR
INTO @DATA(ld_object).


SELECT single SUBOBJECT
FROM BALHDR
INTO @DATA(ld_subobject).


SELECT single LOG_HANDLE
FROM BALHDR
INTO @DATA(ld_log_handle).


SELECT single PROBCLASS
FROM BALHDR
INTO @DATA(ld_log_class).

DATA(ld_language) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_header_data to it_header_data.

"populate fields of struture and append to itab
append wa_header_parameters to it_header_parameters.

"populate fields of struture and append to itab
append wa_messages to it_messages.

"populate fields of struture and append to itab
append wa_message_parameters to it_message_parameters.

"populate fields of struture and append to itab
append wa_contexts to it_contexts.

"populate fields of struture and append to itab
append wa_message_prepared to it_message_prepared.

"populate fields of struture and append to itab
append wa_t_exceptions to it_t_exceptions.

"populate fields of struture and append to itab
append wa_t_prepared_exc to it_t_prepared_exc. . CALL FUNCTION 'APPL_LOG_READ_INTERN' * EXPORTING * object = ld_object * subobject = ld_subobject * log_handle = ld_log_handle * log_class = ld_log_class * language = ld_language IMPORTING number_of_logs = ld_number_of_logs TABLES header_data = it_header_data header_parameters = it_header_parameters messages = it_messages message_parameters = it_message_parameters * contexts = it_contexts * message_prepared = it_message_prepared * t_exceptions = it_t_exceptions * t_prepared_exc = it_t_prepared_exc EXCEPTIONS OBJECT_NOT_FOUND = 1 SUBOBJECT_NOT_FOUND = 2 FUNCTION_NOT_COMPLETED = 3 MESSAGE_NOT_FOUND = 4 PARAMETER_MISSING = 5 . " APPL_LOG_READ_INTERN
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 ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "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_number_of_logs  TYPE STRING ,
ld_object  TYPE BALHDR-OBJECT ,
it_header_data  TYPE STANDARD TABLE OF BALHDR ,
wa_header_data  LIKE LINE OF it_header_data,
ld_subobject  TYPE BALHDR-SUBOBJECT ,
it_header_parameters  TYPE STANDARD TABLE OF BALHDRP ,
wa_header_parameters  LIKE LINE OF it_header_parameters,
ld_log_handle  TYPE BALHDR-LOG_HANDLE ,
it_messages  TYPE STANDARD TABLE OF BALM ,
wa_messages  LIKE LINE OF it_messages,
ld_log_class  TYPE BALHDR-PROBCLASS ,
it_message_parameters  TYPE STANDARD TABLE OF BALMP ,
wa_message_parameters  LIKE LINE OF it_message_parameters,
ld_language  TYPE SY-LANGU ,
it_contexts  TYPE STANDARD TABLE OF BALC ,
wa_contexts  LIKE LINE OF it_contexts,
it_message_prepared  TYPE STANDARD TABLE OF T_PREPARED_MESSAGES ,
wa_message_prepared  LIKE LINE OF it_message_prepared,
it_t_exceptions  TYPE STANDARD TABLE OF BAL_S_EXCEPTION ,
wa_t_exceptions  LIKE LINE OF it_t_exceptions,
it_t_prepared_exc  TYPE STANDARD TABLE OF BAL_S_PREPARED_EXC ,
wa_t_prepared_exc  LIKE LINE OF it_t_prepared_exc.


SELECT single OBJECT
FROM BALHDR
INTO ld_object.


"populate fields of struture and append to itab
append wa_header_data to it_header_data.

SELECT single SUBOBJECT
FROM BALHDR
INTO ld_subobject.


"populate fields of struture and append to itab
append wa_header_parameters to it_header_parameters.

SELECT single LOG_HANDLE
FROM BALHDR
INTO ld_log_handle.


"populate fields of struture and append to itab
append wa_messages to it_messages.

SELECT single PROBCLASS
FROM BALHDR
INTO ld_log_class.


"populate fields of struture and append to itab
append wa_message_parameters to it_message_parameters.
ld_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_contexts to it_contexts.

"populate fields of struture and append to itab
append wa_message_prepared to it_message_prepared.

"populate fields of struture and append to itab
append wa_t_exceptions to it_t_exceptions.

"populate fields of struture and append to itab
append wa_t_prepared_exc to it_t_prepared_exc.

SAP Documentation for FM APPL_LOG_READ_INTERN


This function module reads all log data for the specified object and sub-object from the local memory that at least has the specified log ...See here for full SAP fm documentation

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 APPL_LOG_READ_INTERN or its description.