1
votes

I would like to log each call of my RFC function module. What is the current state of the art in SAP/ABAP to do this?

Where do these logs get stored and how to see them? Or is it better to create a custom table and write the calls into this table?

ABAP version is 7.4

2

2 Answers

4
votes

There is a set of log transactions, notably SLG0 (to create transaction category) and SLG1 (to look at logs). A search on sap blogs about SLG1 will return useful links

To resume those :

  • Modules functions BAL_LOG_* allow the creation/save of logs. Some usage exemple are present here
  • A log class created to simplify the usage of the log is described here.
2
votes

SAP has a special framework for enabling the RFC logging, it is called LOWGWIN (LOGCOM 200).

Feature set:

The logging of RFCs allows you to establish which users had access to which data at what point in time. You can log data on RFC Function Module (FM) level, for example:

  • Type of parameters

  • Name and corresponding values of parameters

In order to minimize the amount of logged data, you can do the following:

  • Restrict logging to certain users

  • Filter the parameters that need to be logged before they are included in the log records

  • Enable logging on client level only for the RFC Function Modules that you want to log

You can fine-tune wich RFC calls (modules) will be logged including successful or failed ones by BAdI /LOGWIN/BADI_RFC_LOG_FILTER.

Initially the log is stored temporarily in SAP and can be viewed via transaction /LOGWIN/SHOW_LOG, after that you can transfer necessary log records to external repository (which you should set up in advance) by transaction /LOGWIN/TSF_TO_EXT.

Architecture overview:

enter image description here

More documentation is here: