Gerd Castan
Gerd Castan

Reputation: 6849

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 wich is used by FORM vim_bc_logs_put.

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

Upvotes: 1

Views: 3392

Answers (1)

Suncatcher
Suncatcher

Reputation: 10621

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).

  • Change documents are intended for logging custom business objects (however logging standard objects is also possible via predefined CD objects). It is implemented via change document objects and corresponding FMs.
  • Technical table logging or simply logging is intended for tracking changes in any table, literally any. It is set up in system settings and logs are stored in DBTABLOG table.

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:

  • Customizing tables are logged by default.
  • You should differentiate between customizing tables by delivery functions and customizing table by data class, which are APPL02. The first ones are called Organizational and customizing data whereas the second ones are called Customizing tables per se.
    Delivery customizing tables are called customizing because they are not transported during updates and upgrades.They are maintained by customer.
    Data class customizing tables are called customizing as they are stored in customer namespace in DB and the main reason for such naming is their physical representation.
    The previous bullet point is true particularly for delivery class customizing tables.
  • Log data for particular customizing table can be also viewed in SPRO transaction via Go To >> Change Log. Beforehand you should select SPRO node you want to view logs for.

Upvotes: 1

Related Questions