SAP TRINT_WRITE_LOG Function Module for









TRINT_WRITE_LOG is a standard trint write log SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 trint write log FM, simply by entering the name TRINT_WRITE_LOG into the relevant SAP transaction such as SE37 or SE38.

Function Group: SLOG
Program Name: SAPLSLOG
Main Program: SAPLSLOG
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function TRINT_WRITE_LOG 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 'TRINT_WRITE_LOG'"
EXPORTING
* IV_LOG_TYPE = 'FILE' "
* IV_LOGNAME_DB = "Name of log (database)
* IV_LOGNAME_FILE = "Name of log (file)
* IV_CONDENSE = 'X' "Lines are condensed
* IV_MASTER_LANGU = 'E' "Alternative language
* IV_OPEN_OUTPUT = 'X' "
* IV_CLOSE_OUTPUT = 'X' "
* IV_TRACE_ERR = ' ' "

TABLES
IT_MSGS = "Table with messages
* IT_RAWMSGS = "

EXCEPTIONS
INVALID_INPUT = 1 DB_ACCESS_ERROR = 2 FILE_ACCESS_ERROR = 3 LOG_OVERFLOW = 4
.



IMPORTING Parameters details for TRINT_WRITE_LOG

IV_LOG_TYPE -

Data type: TRLOG_TYPE
Default: 'FILE'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_LOGNAME_DB - Name of log (database)

Data type: DDPRH-PROTNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_LOGNAME_FILE - Name of log (file)

Data type: TSTRF01-FILE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_CONDENSE - Lines are condensed

Data type: TRPARI-FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_MASTER_LANGU - Alternative language

Data type: T100-SPRSL
Default: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_OPEN_OUTPUT -

Data type: TRPARI-FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_CLOSE_OUTPUT -

Data type: TRPARI-FLAG
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_TRACE_ERR -

Data type: TRPARI-FLAG
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for TRINT_WRITE_LOG

IT_MSGS - Table with messages

Data type: SPROT_U
Optional: No
Call by Reference: No ( called with pass by value option)

IT_RAWMSGS -

Data type: TRLOGR
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

INVALID_INPUT - Invalid entry

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DB_ACCESS_ERROR - Error Accessing Database

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

FILE_ACCESS_ERROR - Error accessing file

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

LOG_OVERFLOW -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for TRINT_WRITE_LOG 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_it_msgs  TYPE STANDARD TABLE OF SPROT_U, "   
lv_iv_log_type  TYPE TRLOG_TYPE, "   'FILE'
lv_invalid_input  TYPE TRLOG_TYPE, "   
lt_it_rawmsgs  TYPE STANDARD TABLE OF TRLOGR, "   
lv_iv_logname_db  TYPE DDPRH-PROTNAME, "   
lv_db_access_error  TYPE DDPRH, "   
lv_iv_logname_file  TYPE TSTRF01-FILE, "   
lv_file_access_error  TYPE TSTRF01, "   
lv_iv_condense  TYPE TRPARI-FLAG, "   'X'
lv_log_overflow  TYPE TRPARI, "   
lv_iv_master_langu  TYPE T100-SPRSL, "   'E'
lv_iv_open_output  TYPE TRPARI-FLAG, "   'X'
lv_iv_close_output  TYPE TRPARI-FLAG, "   'X'
lv_iv_trace_err  TYPE TRPARI-FLAG. "   ' '

  CALL FUNCTION 'TRINT_WRITE_LOG'  "
    EXPORTING
         IV_LOG_TYPE = lv_iv_log_type
         IV_LOGNAME_DB = lv_iv_logname_db
         IV_LOGNAME_FILE = lv_iv_logname_file
         IV_CONDENSE = lv_iv_condense
         IV_MASTER_LANGU = lv_iv_master_langu
         IV_OPEN_OUTPUT = lv_iv_open_output
         IV_CLOSE_OUTPUT = lv_iv_close_output
         IV_TRACE_ERR = lv_iv_trace_err
    TABLES
         IT_MSGS = lt_it_msgs
         IT_RAWMSGS = lt_it_rawmsgs
    EXCEPTIONS
        INVALID_INPUT = 1
        DB_ACCESS_ERROR = 2
        FILE_ACCESS_ERROR = 3
        LOG_OVERFLOW = 4
. " TRINT_WRITE_LOG




ABAP code using 7.40 inline data declarations to call FM TRINT_WRITE_LOG

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.

 
DATA(ld_iv_log_type) = 'FILE'.
 
 
 
"SELECT single PROTNAME FROM DDPRH INTO @DATA(ld_iv_logname_db).
 
 
"SELECT single FILE FROM TSTRF01 INTO @DATA(ld_iv_logname_file).
 
 
"SELECT single FLAG FROM TRPARI INTO @DATA(ld_iv_condense).
DATA(ld_iv_condense) = 'X'.
 
 
"SELECT single SPRSL FROM T100 INTO @DATA(ld_iv_master_langu).
DATA(ld_iv_master_langu) = 'E'.
 
"SELECT single FLAG FROM TRPARI INTO @DATA(ld_iv_open_output).
DATA(ld_iv_open_output) = 'X'.
 
"SELECT single FLAG FROM TRPARI INTO @DATA(ld_iv_close_output).
DATA(ld_iv_close_output) = 'X'.
 
"SELECT single FLAG FROM TRPARI INTO @DATA(ld_iv_trace_err).
DATA(ld_iv_trace_err) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!