loggingabapsap-basis

Writing to customizing table programmatically and logging changes


I want to write into an SAP customizing table programmatically.

How do I get changes to the table entries into the change log?

I need no transporting. It is only one table, no corresponding language dependent table.

I am aware that customizing table changes are logged into table DBTABLOG. (This is different from application data changes which use change documents).

How do I get changes programmatically into DBTABLOG?

I used transaction SE56 'Generate Table Maintenance Dialog' to generate forms that appear to be useful for this task:

This generates forms like FORM bc_entry_log_fill which is used by FORM vim_bc_logs_put.

Are there examples how to use these generated forms without the generated dialogs?


Solution

  • First of all, you should be aware of SAP logging concept a bit. Logging in SAP is divided into business object logging and table logging, let's call it technical. We do not take into account application logging (SLG1) and speak only about tabular data. Business logging is presented by change documents (SCDO) and technical logging (tables) is presented by standard tools (SCU3).

    You can enable logging for any table (including customizing one) this way:

    1. Ensure that checkbox Log Data Changes is enabled in table settings. It can be checked in Technical Settings page of the table.
    2. Set rec/client parameter (RZ11 tcode) to the client number you want track changes for. If you want to enable logging for all clients then set ALL value there (not recommended!).
    3. Reboot the Application Server.

    Answering your particular question:
    You don't need special FMs or methods for populating DBTABLOG table. The changes are logged no matter how they were made: via maintenance view, programmatically or by manual edit. You do not need any special actions for populating this table, and you can read stored records by any way you prefer (write own report, create view or whatever).

    Several other points to be noted: