Skip to Content
0
Jul 27, 2020 at 05:33 PM

SCDO in ABAP on cloud

114 Views

Hello Experts,

I have created Change object for table using the steps in the below link.

https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/63cb1c060276481a99e2316e4bf9214e.html

But the change is getting captured only for insert and delete.

When data is updated, the updated field is not getting captured in change log.

Inside position_aendern, there is a table tabinfo, the field logflag should be X, but it is not. I have attached the dubug screenshot.

IF update IS NOT INITIAL.

LOOP AT update-proord ASSIGNING FIELD-SYMBOL(<update>).

SELECT SINGLE * FROM zproord

WHERE po_num = @<update>-po_num

INTO @DATA(lw_proord).

TRY.

lt_chgnum = update_changedoc_matrel( im_objectid = 'ZPROORD1'

im_object_change_indicator = 'U'

im_n_proord = <UPDATE>

im_o_proord = lw_proord

im_upd_proord = 'U' ).

CATCH cx_chdo_write_error INTO lcx_chdo_write_error.

ENDTRY.

ENDLOOP.

ENDIF.

METHOD update_changedoc_matrel.

DATA n_proord TYPE zproord.

MOVE-CORRESPONDING im_n_proord TO n_proord.

GET TIME STAMP FIELD DATA(lv_time_stamp).

CONVERT TIME STAMP lv_time_stamp TIME ZONE 'EST'

INTO DATE DATA(lv_date) TIME DATA(lv_time).

TRY.

zcl_zproord1_chdo=>write(

EXPORTING

objectid = im_objectid

utime = lv_time

udate = lv_date

username = sy-uname

object_change_indicator = im_object_change_indicator

o_zproord = im_o_proord

n_zproord = n_proord

upd_zproord = im_upd_proord

IMPORTING

changenumber = rt_CHGNUM ).

CATCH cx_chdo_write_error INTO DATA(cx_chdo_write_error).

ENDTRY.

ENDMETHOD.

ENDCLASS.

If you any of have done this before, please give your comments on this.

Thanks,

Dinesh.

Attachments

debug.png (85.9 kB)