A logger for function module (RFC)
Let's work with function modules like IDoc.
ABAP Version: 740 or higher
The report ZAFL_VIEWER
empowers you to search logs and reprocess specific records.
1, Add the include file ZAFL_MACROS
which contains core function of the logger.
FUNCTION-POOL zzxxxx.
INCLUDE zafl_macros.
2, Call the macros on demand in the function.
FUNCTION z_fm.
**initialize logger. It should be always on the top of the FUNCTION.
/afl/log_init.
**optional, you can specify at most 3 fields for search.
/afl/set_custom_fields '2020' '1001' '2000000001'.
**optional, you can save a status code and message text for search.
/afl/set_status 'S' 'message'.
**save logs. It should be always on the bottom of the FUNCTION.
/afl/save.
ENDFUNCTION.
Table ZAFL_CONFIG
allows for basic configuration.
/afl/save
will be bypassed.Schedule the report ZAFL_HISTORY_CLEANER
as a job to delete history log.