Ccundo Badi
Ccundo Badi
Ccundo Badi
method if_ex_ecm_undo~undo_object.
data: ls_message like line of ct_messages,
lf_string type string,
lf_user type syuname,
ls_ccin type ccin,
lf_conflict type aennr,
lt_cdhdr type pcdhdr_tab,
ls_cdhdr type pcdhdr.
* enqueue
call function 'ENQUEUE_EMMARAE'
exporting
matnr = ls_ccin-matnr
exceptions
foreign_lock = 1
system_failure = 2.
if sy-subrc ne 0.
if sy-subrc eq 1.
lf_user = sy-msgv1.
message e022(m3) with ls_ccin-matnr lf_user into lf_string.
else.
message e021(m3) into lf_string.
endif.
move-corresponding syst to ls_message.
append ls_message to ct_messages.
return.
endif.
* undo check
if i_test_only is initial.
delete from aeoi
where aetyp eq c_object-aetyp
and objkt eq ls_ccin-matnr.
commit work.
else.
rollback work.
endif.