Change log for Z-Table Maintenance (via SCDO)

本文介绍如何在SAP系统中为特定维护表启用变更日志记录,包括使用自动表变更日志及变更文档对象(SCDO)进行部分表的日志记录。自动表变更日志适合所有定制表,默认情况下会自动记录所有定制表变更;而SCDO则允许更细粒度地跟踪特定表的变更。

Generally we don’t need table logging for custom table maintenance (SM30), but it is important and needed for some cases. All customizing tables are automatically recorded by default but if you use regular Application tables (master and transaction data), you’re about to get your hands dirty .)

Z-TableSample Z-Table

Automatic table change logging

Actually this is not suitable for our case because we want to log particular tables but it’s good to know..

You can use Automatic table change logging by setting the “Log Data Changes” flag under the table “Technical Settings” in SE11 (p.s. You must activate the table again after saving it, otherwise it will not be effective).

Next, to be able to log the table changes you must activate the system profile parameter Rec/Client. The default setting is OFF (no changes are logged). BASIS Team can assist you in this.
Setting Rec/Client Parameter for Logging

However, SAP recommends this option only in systems where this is worthwhile, because all tables with “Log data changes” option will be logged, so this has a major impact on performance (Even for one client)

You can now view the changes via SCU3 (Table: DBTABLOG)

SCU3-Logs
SCU3-Logs

Logging using Change Document Objects (SCDO)

To log changes for particular tables in SM30 Maintenance, we can use change document objects and its associated functions.

Let’s do it step by step;

  • Go to SCDO and create a Change Document Object (Choose Yes for opening Namespace Pop-ups)
    SCDO-Create
  • Insert the entries and choose Utilities → Generate update pgm.SCDO-Insert Entries
  • In the opening pop-up, give function group name (it will be created if it doesn’t exist) and generate the update program for the object by clicking Activate. SCDO-Generated
  • In the Data Element → Further Characteristics Tab, set the “Change Document” flag for the objects which you want to track changes. As you recognise, many SAP standard data elements come with the selected flag.
  • You can now insert appropriate calls in the corresponding programs, for our example we will use Table Maintenance Events.
  • Under the table maintenance (SE56) go to Environment → Modification → Events.
    Give the events & subroutine names as shown in the figure and click the Editor icon to create suggested include (L<fg_name>F01).
    SM30-Events

Now, you can just copy and paste the code snippet (link is below) into the created include. It will begin to create logs in CDHDR-CDPOS tables. You can now view the changes via reports CHANGEDOCU_READ & RSSCD100.

SCDO-LogsSCDO-Logs

Source code on GitHub: https://goo.gl/VrwXaC
(Fork me on GitHub if you want to contribute)

Originally published at – Change log for Z-Table Maintenance (via SCDO)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值