TABLES
Source code
data:editpos type table of cdred with header line, aeditpos type table of cdred with header line. data:wk_repid type repid.
if tablekey[] is initial.
call function 'CHANGEDOCUMENT_READ' exporting
objectclass = objectclass objectid = objectid username = username tablename = tablename tables
editpos = aeditpos exceptions
no_position_found = 1 wrong_access_to_archive = 2 time_zone_conversion_error = 3 others = 4.
else.
loop at tablekey .
call function 'CHANGEDOCUMENT_READ' exporting
objectclass = objectclass objectid = objectid
tablekey = tablekey-tabkey tablename = tablename
username = username tables
editpos = editpos exceptions
no_position_found = 1 wrong_access_to_archive = 2 time_zone_conversion_error = 3 others = 4.
loop at editpos.
append editpos to aeditpos. endloop. endloop. endif.
if aeditpos[] is initial. message s010(zac00). else.
if tcode ne space.
delete aeditpos where tcode ne tcode. endif.
wk_repid = objectclass.
call function 'CHANGEDOCUMENT_DISPLAY' exporting
i_applicationid = wk_repid i_objectclas = objectclass tables
i_cdred = aeditpos. endif.
注: 修改日志在AEDITPOS表中,
可以按需自己定义输入的屏幕,不需要调用函数CHANGEDOCUMENT_DISPLAY输出
五. 在程序中. 条用Z_READ_HISTORY来显示修改日志.
call function 'Z_READ_HISTORY' exporting
objectclass = ' ZMG_TEST001' objectid = lv_objid tablename = lv_tabname * USERNAME = * TCODE = tables
tablekey = tablekey .
“文档对象 “对象值 如PO号 “表名