2023 May 11 7:30 AM
Hi All,
We have created a custom table. We also created a module pool program ( and ztcode) to add and maintain data in our ztable. Now we want to add a change log button in our module pool to display the log history. For this we created a object class in SCDO tcode and a Z***_write_document function module was generated. We are using this FM in Module Pool but but nothing gets updated to CDHDR and CDPOS tables. Any suggestion on how to use this function module or any ideas on how to get the complete change history is appreciatedztable.pngo-fm.png.
2023 May 11 9:49 AM
2023 May 11 8:12 AM
pritam_baboo
Hi Pritam,
would it be an option to use simple table logging which you can switch on in the technical settings for the Z-table? The information is then available via TCode SCU3 and can also be displayed in your program based on DBTABLOG-entries. This may however only be feasible if the table is not changed all the time, that is for configuration or master data like tables.
Hope this helps!
Cheers
Bärbel
2023 May 11 9:27 AM
Thanks for the info Barbel, but we want the log history to display the log history along with new and old value. And yes this table data will be changed frequently.
2023 May 11 9:08 AM
It's easier to read your question if you embed the images (please click on the button "insert image" instead of "insert link")
2023 May 11 9:49 AM
2023 May 13 6:54 AM
Thanks Raymond,
At data element level the 'Changed Document' flag was set but I was passing an internal table instead of work area in the before and after values. I corrected it and now I can see the changes are updated to CDHDR and CDPOS tables. Thanks again for the info.
CALL FUNCTION 'ZCD_STK_UPDATES_WRITE_DOCUMENT'
EXPORTING
objectid = lv_objid
tcode = lv_tcode
utime = lv_time
udate = lv_date
username = lv_user
* PLANNED_CHANGE_NUMBER = ' '
object_change_indicator = 'U'
* PLANNED_OR_REAL_CHANGES = ' '
* NO_CHANGE_POINTERS = ' '
* UPD_ICDTXT_ZCD_STK_UPDATES = ' '
n_zstock_level = wa_new
o_zstock_level = wa_old
upd_zstock_level = 'U'
TABLES
icdtxt_zcd_stk_updates = it_stk_updates.
2023 May 11 3:15 PM
Hello pritam_baboo
You have created a module pool program to maintain the table and you have generated change document object for the table.
Now, you need to integrate change documents into your table maintenance program - see SAP Help Include Functionality in Program
Dominik Tylczynski