Skip to Content

problem in service request category throgh CRM_ORDER_MAINTAIN

hello,

We are using FM 'CRM_ORDER_MAINTAIN' to create new service request.

The problem is that we can't save a Category as relation of the service.
We put exactly the same parameters which we saw in debug mode of 'CRM_ORDER_MAINTAIN'.

These are our parameters. Anybody sees a problem?

Thanks in advance,
Becky

  ls_input_field_names-fieldname  = 'CONC_KEY'.
  INSERT ls_input_field_names INTO TABLE lt_input_field_names.

  ls_input_fields-ref_guid    = lv_order_guid.
  ls_input_fields-ref_kind    = 'A'.
  ls_input_fields-objectname  = 'SERVICE_OS'.
  ls_input_fields-field_names = lt_input_field_names.
  APPEND ls_input_fields TO lt_input_fields_tab.

  ls_service_os-ref_guid = lv_order_guid.
  ls_service_os-ref_kind = 'A'.
  ls_subject-code = lv_status_reason_str.

  ls_subject-codegruppe = lv_codeprofile.
  ls_subject-ref_guid =  lv_order_guid.
  ls_subject-mode = 'A'.
  ls_subject-katalogart = lv_katalogart.
  APPEND ls_subject TO lt_subject.

  ls_osset-subject = lt_subject.
  ls_osset-subject_profile = lv_subject_profile.
  ls_osset-profile_type = 'G'.
  ls_osset-ref_guid = lv_order_guid.
  APPEND ls_osset TO lt_osset.

  ls_service_os-osset = lt_osset.
  APPEND ls_service_os TO lt_service_os.

  " SET CATEGORY
  CLEAR: ls_service_os,
         ls_subject,
         lt_subject,
         ls_osset,
         lt_osset.

  ls_subject-asp_id = lv_scheme_id.
  ls_subject-cat_id = lv_cat_id.
  ls_subject-katalog_type = 'D'.
  APPEND ls_subject TO lt_subject.

  ls_osset-subject = lt_subject.
  ls_osset-profile_type = 'A'.
  APPEND ls_osset TO lt_osset.

  ls_service_os-ref_guid = lv_order_guid.
  ls_service_os-ref_kind = 'A'.
  ls_service_os-osset = lt_osset.
  APPEND ls_service_os TO lt_service_os.

CALL FUNCTION 'CRM_ORDER_MAINTAIN' EXPORTING it_partner = lt_partner_tab it_activity_h = lt_activity_h it_status = lt_status it_service_os = lt_service_os CHANGING ct_orderadm_h = lt_crmt_orderadm_h_comt ct_input_fields = lt_input_fields_tab. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF.

CALL FUNCTION 'CRM_ORDER_SAVE' EXPORTING it_objects_to_save = lt_objects_to_save iv_update_task_local = abap_true IMPORTING et_objects_not_saved = lt_objects_not_save et_saved_objects = lt_objects_saved EXCEPTIONS document_not_saved = 1 OTHERS = 2. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 09, 2017 at 02:01 AM

    Hello Meirav,

    FM CRM_ORDER_MAINTAIN is not released to customer for any custom logic in any kind of enhancement.

    Since It is the main API it will cause many abnormal issues. So I strongly suggest you not call it in custom code.

    If you have any further question please let me know.

    Regards,

    Webster

    Add comment
    10|10000 characters needed characters exceeded