我想将数据 SLT 到我们的 HANA 数据仓库中。这是最简单的部分,我可以移动一对一匹配的数据(类型 1 表)。但我想让它成为类型 2 并保留历史。我在转换中有以下代码,它不会填充更新字段。
*&---------------------------------------------------------------------*
*& Include ZAUSP_SLT_TRANSFORM
*&---------------------------------------------------------------------*
STATICS lv_syn_name TYPE tabname.
DATA con_name TYPE dbcon_name.
DATA lv_timestamp TYPE timestampl.
FIELD-SYMBOLS <lv_operation> TYPE any.
CONCATENATE _mt_id ':R:R' INTO con_name.
ASSIGN COMPONENT 'IUUC_OPERAT_FLAG' OF STRUCTURE <wa_s_AUSP> TO <lv_operation>.
IF sy-subrc = 0 AND
<lv_operation> = 'D'.
IF lv_syn_name IS INITIAL.
CALL METHOD cl_iuuc_tab_ident_access=>get_ident
EXPORTING
iv_mt_id = _mt_id
iv_tabname = _cobj_alias
iv_system_type = cl_iuuc_tab_ident_access=>co_system_receiver
iv_ident_type = cl_iuuc_tab_ident_access=>co_ident_synonym
IMPORTING
ev_full_name = lv_syn_name.
IF lv_syn_name IS INITIAL.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Get Synonym Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
ENDIF.
GET TIME STAMP FIELD lv_timestamp.
UPDATE (lv_syn_name) CLIENT SPECIFIED CONNECTION (con_name)
SET ZDELETE_FLAG = 'X'
ZUPD_DATETIME = lv_timestamp
WHERE mandt = <wa_s_AUSP>-mandt
AND objek = <wa_s_AUSP>-objek
AND atinn = <wa_s_AUSP>-atinn
AND atzhl = <wa_s_AUSP>-atzhl
AND mafid = <wa_s_AUSP>-mafid
AND klart = <wa_s_AUSP>-klart
AND adzhl = <wa_s_AUSP>-adzhl.
IF sy-subrc <> 0.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Update Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
skip_record.
ENDIF.
"Code for timestamp outside of delete.
IF lv_syn_name IS INITIAL.
CALL METHOD cl_iuuc_tab_ident_access=>get_ident
EXPORTING
iv_mt_id = _mt_id
iv_tabname = _cobj_alias
iv_system_type = cl_iuuc_tab_ident_access=>co_system_receiver
iv_ident_type = cl_iuuc_tab_ident_access=>co_ident_synonym
IMPORTING
ev_full_name = lv_syn_name.
IF lv_syn_name IS INITIAL.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Get Synonym Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
ENDIF.
GET TIME STAMP FIELD lv_timestamp.
UPDATE (lv_syn_name) CLIENT SPECIFIED CONNECTION (con_name)
SET ZUPD_DATETIME = lv_timestamp "slt_update is the name in your slt strucure!
WHERE MANDT = <wa_s_AUSP>-MANDT "key_1 = pk of your table
AND OBJEK = <wa_s_AUSP>-OBJEK
AND ATINN = <wa_s_AUSP>-ATINN
AND ATZHL = <wa_s_AUSP>-ATZHL
AND MAFID = <wa_s_AUSP>-MAFID
AND KLART = <wa_s_AUSP>-KLART
AND ADZHL = <wa_s_AUSP>-ADZHL.
IF sy-subrc <> 0.
allog_msg 'E' 'DMC_RT_MSG' '000'
'Update Error' space space space 'IL '.
RAISE stopped_by_rule.
ENDIF.
为什么不为插入到目标中的所有行更新时间字段?当我尝试在复制期间设置断点进行调试时,我收到以下错误:
因此,我单击一个,然后为每个获取以下内容:
所以我去 SE38 并尝试单独激活每个:
我没有在这些附加程序中编写代码,也不明白它们与我编写的 INCLUDE 有何关系。我想我写的 INCLUDE 转换由于后台程序没有被激活而没有被执行?