سؤال

There is a Z table that have to be updated frequently. These updates should be tracked, and now the tracking is implemented via SAP change documents functionality.

All is working fine, records in CDHDR are being created, but now the *********_WRITE_DOCUMENT FM is called using complex logic because DB updates of are made using statement:

MODIFY dbtab FROM itab.

Where one should put *********_WRITE_DOCUMENT call in order to track every time MODIFY itab changes? How could we simplify this procedure? How to cover all DB updates

هل كانت مفيدة؟

المحلول

Short answer: that won't work.

Long answer: If you want't to achieve this, you have to get the information on what is changed and what is inserted yourself. I'd do an

select ... from ZTABLE into OLD_DATA_TAB for all entries in ITAB where ...

afterwards loop over ITAB and check if you have a corresponing dataset in your OLD_DATA_TAB and if it has to be changed.

With that information you can build you input parameter for *_WRITE_DOCUMENT which you call after the successful modify, but before the commit.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top