Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Display change log for custom table.

pritam_baboo
Participant
0 Kudos
4,040

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.

1 ACCEPTED SOLUTION

RaymondGiuseppi
Active Contributor
3,829

Can you

  • Check the data elements of your table, is the flag 'Change Document' of tab 'Further Characteristics' set?
  • Post the code where you call the FM (or the generated include) How did you fill the parameters (object, indicators, before and after values)
6 REPLIES 6

BaerbelWinkler
SAP Champion
SAP Champion
3,829

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

0 Kudos
3,829

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.

Sandra_Rossi
Active Contributor
3,829

It's easier to read your question if you embed the images (please click on the button "insert image" instead of "insert link")

RaymondGiuseppi
Active Contributor
3,830

Can you

  • Check the data elements of your table, is the flag 'Change Document' of tab 'Further Characteristics' set?
  • Post the code where you call the FM (or the generated include) How did you fill the parameters (object, indicators, before and after values)

0 Kudos
3,829

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.

DominikTylczyn
SAP Champion
SAP Champion
3,829

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

Best regards

Dominik Tylczynski