1

我正在尝试学习功能模块CRM_ORDER_MAINTAIN,到目前为止,我设法与合作伙伴及其角色创建了一个标准订单,但是现在我在创建带有必填字段的服务票证时遇到了麻烦。

我在从 WEBUI 调用 FM 以查看要填充哪些结构和表时尝试调试它,但是我在确定要填充哪些以及生成哪些并且不知道我是否丢失时遇到了一些麻烦某处的小东西导致它无法保存。

我认为错误在于处理分类的这部分代码,因为处理添加合作伙伴的其他代码适用于标准订单。

我没有填写任何 GUIDS,只填写 HANDLES,因为这是我为标准订单所做的。

*****categorization: motive+submotive******
clear ls_input_fields.
clear ls_fieldsname.

ls_fieldsname-fieldname = 'CONC_KEY'.
INSERT ls_fieldsname INTO TABLE ls_input_fields-field_names.
ls_input_fields-ref_handle = 1."
ls_input_fields-ref_kind = gc_object_kind-orderadm_h.
ls_input_fields-objectname = 'SERVICE_OS'.

ls_subject-ref_handle = ls_orderadm_h-handle.
ls_subject-ref_handle_h = ls_orderadm_h-handle.
ls_subject-katalogart = 'Z1'.
ls_subject-codegruppe = 'ZCA00001'.
ls_subject-code = 'Z044'.
append ls_subject TO ls_osset-subject.
ls_osset-ref_handle = ls_orderadm_h-handle.
ls_osset-profile_type = 'A'.
ls_osset-subject_profile = 'ZCCCAST'.
append ls_osset to ls_service_os-osset.
ls_service_os-ref_handle = ls_orderadm_h-handle.
append ls_service_os to it_service_os.

INSERT ls_input_fields INTO TABLE lt_input_fields.

ls_subject-ref_handle = ls_orderadm_h-handle.
ls_subject-ref_handle_h = ls_orderadm_h-handle.
ls_subject-katalogart = 'Z1'.
ls_subject-codegruppe = 'ZCA00002'.
ls_subject-code = 'Z009'.
append ls_subject TO ls_osset-subject.
ls_osset-ref_handle = ls_orderadm_h-handle.
ls_osset-profile_type = 'A'.
ls_osset-subject_profile = 'ZCCCAST'.
append ls_osset to ls_service_os-osset.
ls_service_os-ref_handle = ls_orderadm_h-handle.
append ls_service_os to it_service_os.

INSERT ls_input_fields INTO TABLE lt_input_fields.

任何帮助表示赞赏

4

1 回答 1

2

对于 SAP CRM 中的 Service OS,有多级分类(四级)。CRM_ORDER_READ您可以在参数中检查报告的层次结构ET_SERVICE_OS

此外,您可以检查以下结构中的层次结构CRMT_SRV_OSSET_WRK服务操作系统结构

要维护超过 2 级层次结构的数据,您必须创建新的 ref GUID。您必须准备和填充数据以创建操作系统,如下所示 -

 CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        ev_guid_16 = lv_ref_guid.

ls_subject-ref_handle = '0000000000'.
ls_subject-ref_guid   =  lv_ref_guid.   "Newly created ref GUID to maintain hierarchy   
ls_subject-cat_id = 'As per your req.'.
ls_subject-katalog_type = ''.
ls_subject-mode = 'A'.         "For creation A, for update B
"Maintain other Subject parameter as per your requirement
APPEND ls_subject TO lt_subject.

"You can skip preparing Ref-Object structure, In case you don't want to update 
 ls_refobj-ref_guid    = lv_ref_guid.          "Newly created ref GUID to maintain hierarchy   
 ls_refobj-product_id  = "Product ID".         "In case you've product ID (Not Mandt.)
 ls_refobj-ref_handle  = '0000000000'.
 ls_refobj-main_object = abap_true.
 ls_refobj-mode        = 'A'.        " Mode A for creating, B for update
 "Maintain other Ref-Object parameter as per your requirement
 INSERT ls_refobj INTO TABLE lt_refobj.

ls_osset-ref_handle      = '0000000000'.
ls_osset-ref_guid        = "Header or Item GUID of Service".  
ls_osset-subject_profile = 'SERVICE'.
ls_osset-profile_type    = 'A'.        "Service profile type
ls_osset-refobject       = lt_refobj.
ls_osset-subject         = lt_subject.
INSERT ls_osset INTO TABLE lt_osset.

ls_service_os-ref_guid = "Header or Item GUID of Service".
ls_service_os-ref_kind = "A or B".    "A for Header and B for Item
ls_service_os-osset    = lt_osset.
INSERT ls_service_os INTO TABLE lt_service_os.
于 2021-06-24T13:37:31.257 回答