做SAP 表,字段级的变更记录到,CDHDR和CDPOS的方法
tcode = ‘/NSL/TR062_MANUAL’.
utime = sy–uzeit.
udate = sy–datum.
username = sy–uname.
APPEND LINES OF gt_capm[] TO XNSL_TR062_CAP[].
APPEND LINES OF gt_cdsm[] TO XNSL_TR062_CDS[].
APPEND LINES OF gt_INDXM[] TO XNSL_TR062_INDXM[].
APPEND LINES OF gt_RATEM[] TO XNSL_TR062_RATEM[].
APPEND LINES OF lt_capm[] TO YNSL_TR062_CAP[].
APPEND LINES OF lt_cdsm[] TO YNSL_TR062_CDS[].
APPEND LINES OF lt_INDXM[] TO YNSL_TR062_INDXM[].
APPEND LINES OF lt_RATEM[] TO YNSL_TR062_RATEM[].
* APPEND LINES OF gt_tr78_item TO xnsl_tr078_item.
if gt_capm[] is not INITIAL.
upd_nsl_tr062_cap = ‘U’.
endif.
if gt_cdsm[] is not INITIAL.
upd_nsl_tr062_cds = ‘U’.
endif.
if gt_indxm[] is not INITIAL.
upd_nsl_tr062_indxm = ‘U’.
endif.
if gt_ratem[] is not INITIAL.
upd_nsl_tr062_ratem = ‘U’.
endif.
CALL FUNCTION ‘/NSL/TR062_WRITE_DOCUMENT’
EXPORTING
objectid = objectid
tcode = tcode
utime = sy–uzeit
udate = sy–datum
username = sy–uname
planned_change_number = planned_change_number
object_change_indicator = cdoc_upd_object
planned_or_real_changes = cdoc_planned_or_real
no_change_pointers = cdoc_no_change_pointers
upd_icdtxt_tr062 = upd_icdtxt_tr062
upd_nsl_tr062_cap = upd_nsl_tr062_cap
upd_nsl_tr062_cds = upd_nsl_tr062_cds
upd_nsl_tr062_indxm = upd_nsl_tr062_indxm
upd_nsl_tr062_ratem = upd_nsl_tr062_ratem
TABLES
icdtxt_tr062 = ICDTXT_TR062
xnsl_tr062_cap = XNSL_TR062_CAP
ynsl_tr062_cap = YNSL_TR062_CAP
xnsl_tr062_cds = XNSL_TR062_CDS
ynsl_tr062_cds = yNSL_TR062_CDS
xnsl_tr062_indxm = XNSL_TR062_INDXM
ynsl_tr062_indxm = YNSL_TR062_INDXM
xnsl_tr062_ratem = XNSL_TR062_RATEM
ynsl_tr062_ratem = YNSL_TR062_RATEM.