Copy IR2 SR
Copy IR2 SR
Copy IR2 SR
METHOD if_ex_crm_copy_badi~subject.
INCLUDE:
crm_object_names_con.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA:
lv_katalogart TYPE comt_catalog,
lv_codegruppe TYPE crm_qcodegrp,
lv_code TYPE crm_qcode,
lv_subject_profile TYPE crmt_subject_profile.
IF is_orderadm_h-process_type = zif_crm_common_constants=>gc_process_type-
interaction_record
AND is_ref_orderadm_h-process_type =
zif_crm_common_constants=>gc_process_type-service_request.
lv_katalogart = lv_cat_concat(2).
lv_codegruppe = lv_cat_concat+2(8).
lv_code = lv_cat_concat+10(4).
cs_subject-ref_kind = 'A'.
cs_subject-subject_profile = lv_subject_profile.
cs_subject-profile_type = 'F'.
cs_subject-katalogart = lv_katalogart.
cs_subject-codegruppe = lv_codegruppe.
cs_subject-code = lv_code.
cs_subject-asp_id = ''.
cs_subject-cat_id = ''.
cs_subject-katalog_type = ''.
cs_subject-catalog_type = 'F'.
ELSE.
lv_cat_key = cs_subject-katalogart && cs_subject-codegruppe && cs_subject-
code.
cl_crm_ml_category_util=>get_aspect(
EXPORTING
iv_ref_guid = is_ref_orderadm_h-guid " Header/Item
GUID
iv_ref_kind = cs_subject-ref_kind " HEADER/ITEM
iv_profile_type = cs_subject-profile_type " Subject
Profile Category
iv_catalog_type = cs_subject-catalog_type " Catalog
Category
iv_check_subj_prof = abap_true " Check the subject
profile for schema
iv_subject_profile = cs_subject-subject_profile " Subject
Profile
IMPORTING
er_aspect = DATA(lr_aspect) " Coherent Cat -
Categorization Aspect
).
CHECK lr_aspect IS BOUND.
lr_aspect->get_details(
IMPORTING
ev_asp = DATA(ls_asp) " Coherent Cat - Aspect
Buffer Linetype
).
lv_asp_id = ls_asp-asp-asp_id.
DATA(ls_copy) = cs_subject.
CLEAR cs_subject.
cs_subject-guid = ls_copy-guid.
cs_subject-ref_guid = ls_copy-ref_guid.
cs_subject-ref_kind = ls_copy-ref_kind.
cs_subject-ref_handle = ls_copy-ref_handle.
cs_subject-handle = ls_copy-handle.
cs_subject-profile_type = 'A'.
cs_subject-asp_id = lv_asp_id.
cs_subject-cat_id = lv_cat_id.
cs_subject-katalog_type = cs_subject-catalog_type = 'D'.
ENDMETHOD.