SAP Function Modules

LTRM_APP_LOG_ADD SAP Function module - Adds messages to TRM's application log







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

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


Pattern for FM LTRM_APP_LOG_ADD - LTRM APP LOG ADD





CALL FUNCTION 'LTRM_APP_LOG_ADD' "Adds messages to TRM's application log
  EXPORTING
    iv_subobject =              " balsubobj     Application log: sub-object
    iv_problemclass =           " balprobcl     Application log: Message problem class
    iv_extid =                  " balnrext      Application Log: External ID
    iv_locat =                  " ltrm_locat    Site
*   iv_rt =                     " ltrs_rstyp    Resource type
*   iv_mode =                   " ltrm_mode     Mode
*   iv_parent =                 " ltrm_entity   Entity
*   iv_prior =                  " ltrm_prior    Calculated priority
*   it_task_qualif =            " ltrm_it_task_qualif
*   iv_app_log_write_flg =      " xfeld         Ignores application log flag (on/off)
* TABLES
*   it_priority =               " ltrm_it_priority_log
*   it_src =                    " ltrm_it_src_log
*   it_dst =                    " ltrm_it_dst_log
  EXCEPTIONS
    WRONG_SUBOBJECT = 1         "               Invalid subobject
    .  "  LTRM_APP_LOG_ADD

ABAP code example for Function Module LTRM_APP_LOG_ADD





The ABAP code below is a full code listing to execute function module LTRM_APP_LOG_ADD 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_it_priority  TYPE STANDARD TABLE OF LTRM_IT_PRIORITY_LOG,"TABLES PARAM
wa_it_priority  LIKE LINE OF it_it_priority ,
it_it_src  TYPE STANDARD TABLE OF LTRM_IT_SRC_LOG,"TABLES PARAM
wa_it_src  LIKE LINE OF it_it_src ,
it_it_dst  TYPE STANDARD TABLE OF LTRM_IT_DST_LOG,"TABLES PARAM
wa_it_dst  LIKE LINE OF it_it_dst .

DATA(ld_iv_subobject) = 'Check type of data required'.
DATA(ld_iv_problemclass) = 'Check type of data required'.
DATA(ld_iv_extid) = 'Check type of data required'.
DATA(ld_iv_locat) = 'Check type of data required'.
DATA(ld_iv_rt) = 'Check type of data required'.
DATA(ld_iv_mode) = 'Check type of data required'.
DATA(ld_iv_parent) = 'Check type of data required'.
DATA(ld_iv_prior) = 'Check type of data required'.
DATA(ld_it_task_qualif) = 'Check type of data required'.
DATA(ld_iv_app_log_write_flg) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_priority to it_it_priority.

"populate fields of struture and append to itab
append wa_it_src to it_it_src.

"populate fields of struture and append to itab
append wa_it_dst to it_it_dst. . CALL FUNCTION 'LTRM_APP_LOG_ADD' EXPORTING iv_subobject = ld_iv_subobject iv_problemclass = ld_iv_problemclass iv_extid = ld_iv_extid iv_locat = ld_iv_locat * iv_rt = ld_iv_rt * iv_mode = ld_iv_mode * iv_parent = ld_iv_parent * iv_prior = ld_iv_prior * it_task_qualif = ld_it_task_qualif * iv_app_log_write_flg = ld_iv_app_log_write_flg * TABLES * it_priority = it_it_priority * it_src = it_it_src * it_dst = it_it_dst EXCEPTIONS WRONG_SUBOBJECT = 1 . " LTRM_APP_LOG_ADD
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_iv_subobject  TYPE BALSUBOBJ ,
it_it_priority  TYPE STANDARD TABLE OF LTRM_IT_PRIORITY_LOG ,
wa_it_priority  LIKE LINE OF it_it_priority,
ld_iv_problemclass  TYPE BALPROBCL ,
it_it_src  TYPE STANDARD TABLE OF LTRM_IT_SRC_LOG ,
wa_it_src  LIKE LINE OF it_it_src,
ld_iv_extid  TYPE BALNREXT ,
it_it_dst  TYPE STANDARD TABLE OF LTRM_IT_DST_LOG ,
wa_it_dst  LIKE LINE OF it_it_dst,
ld_iv_locat  TYPE LTRM_LOCAT ,
ld_iv_rt  TYPE LTRS_RSTYP ,
ld_iv_mode  TYPE LTRM_MODE ,
ld_iv_parent  TYPE LTRM_ENTITY ,
ld_iv_prior  TYPE LTRM_PRIOR ,
ld_it_task_qualif  TYPE LTRM_IT_TASK_QUALIF ,
ld_iv_app_log_write_flg  TYPE XFELD .

ld_iv_subobject = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_priority to it_it_priority.
ld_iv_problemclass = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_src to it_it_src.
ld_iv_extid = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_dst to it_it_dst.
ld_iv_locat = 'Check type of data required'.
ld_iv_rt = 'Check type of data required'.
ld_iv_mode = 'Check type of data required'.
ld_iv_parent = 'Check type of data required'.
ld_iv_prior = 'Check type of data required'.
ld_it_task_qualif = 'Check type of data required'.
ld_iv_app_log_write_flg = 'Check type of data required'.

SAP Documentation for FM LTRM_APP_LOG_ADD


This function module creates log handles and logs the messages in the application 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 LTRM_APP_LOG_ADD or its description.