SAP /TMF/FM_SAVE_LOG Function Module for Save trace log line









/TMF/FM_SAVE_LOG is a standard /tmf/fm save log SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Save trace log line 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 /tmf/fm save log FM, simply by entering the name /TMF/FM_SAVE_LOG into the relevant SAP transaction such as SE37 or SE38.

Function Group: /TMF/FG_TRACE_LOG
Program Name: /TMF/SAPLFG_TRACE_LOG
Main Program: /TMF/SAPLFG_TRACE_LOG
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function /TMF/FM_SAVE_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 '/TMF/FM_SAVE_LOG'"Save trace log line
EXPORTING
* IV_MANDT = SY-MANDT "Client
* IV_NO_COMMIT = "General Flag
IV_RUN_ID = "Run ID
IV_LOG_TRACE_ID = "Log trace ID
IV_LOG_TYPE = "Count per execution
IV_LOG_INI_FIN = "Initialization or Finalization of each step
IV_REPORT_ID = "Report ID
IV_DESCRIPTION = "Description value (CHAR255)
IV_UNAME = "User Name
* IV_TIMESTAMP = "UTC time stamp in long form (YYYYMMDDhhmmss,mmmuuun)
.



IMPORTING Parameters details for /TMF/FM_SAVE_LOG

IV_MANDT - Client

Data type: MANDT
Default: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)

IV_NO_COMMIT - General Flag

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

IV_RUN_ID - Run ID

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

IV_LOG_TRACE_ID - Log trace ID

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

IV_LOG_TYPE - Count per execution

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

IV_LOG_INI_FIN - Initialization or Finalization of each step

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

IV_REPORT_ID - Report ID

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

IV_DESCRIPTION - Description value (CHAR255)

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

IV_UNAME - User Name

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

IV_TIMESTAMP - UTC time stamp in long form (YYYYMMDDhhmmss,mmmuuun)

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

Copy and paste ABAP code example for /TMF/FM_SAVE_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:
lv_iv_mandt  TYPE MANDT, "   SY-MANDT
lv_iv_no_commit  TYPE FLAG, "   
lv_iv_run_id  TYPE /TMF/DE_RUN_ID, "   
lv_iv_log_trace_id  TYPE /TMF/DE_LOG_TRACE_ID, "   
lv_iv_log_type  TYPE /TMF/DE_LOG_TYPE, "   
lv_iv_log_ini_fin  TYPE /TMF/DE_LOG_INI_FIN, "   
lv_iv_report_id  TYPE /TMF/DE_REPORT_ID, "   
lv_iv_description  TYPE /TMF/DE_DESCRICAO_STRING, "   
lv_iv_uname  TYPE SYUNAME, "   
lv_iv_timestamp  TYPE TZNTSTMPL. "   

  CALL FUNCTION '/TMF/FM_SAVE_LOG'  "Save trace log line
    EXPORTING
         IV_MANDT = lv_iv_mandt
         IV_NO_COMMIT = lv_iv_no_commit
         IV_RUN_ID = lv_iv_run_id
         IV_LOG_TRACE_ID = lv_iv_log_trace_id
         IV_LOG_TYPE = lv_iv_log_type
         IV_LOG_INI_FIN = lv_iv_log_ini_fin
         IV_REPORT_ID = lv_iv_report_id
         IV_DESCRIPTION = lv_iv_description
         IV_UNAME = lv_iv_uname
         IV_TIMESTAMP = lv_iv_timestamp
. " /TMF/FM_SAVE_LOG




ABAP code using 7.40 inline data declarations to call FM /TMF/FM_SAVE_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_mandt) = SY-MANDT.
 
 
 
 
 
 
 
 
 
 


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!