on 2019 Sep 13 2:01 PM
Hi Experts.
I have an Issue is regarding function module CRM _ORDER_SAVE.
Firstly,I am creating an incident .Example : Incident no : 8000000711.
Now,my requirement is to change the 'Employee responsible and reporting manager 'based on the category 1.As we know 'Employee responsible' and Reporting manager would be vary from category to category.While creating a new incident/complaint category might be 'Electrical maintainance'.This complaint will be created by HDMS system.Now complaint received to CRM system,based on the complaint description the required category 1 and category 2 should be changed.
Example : Description : 'Required Mouse'.
It's a IT support hardware issue.so complaint should be forwarded to IT-Support team.i.eCategory 1 : IT support ,Category 2 : Hardware.Our aim is to update the employee responsible and reporting manager based on the category we change.
Code : Using BADI-ORDER_SAVE
METHOD if_ex_order_save~check_before_save.
**
INCLUDE crm_object_names_con.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = it_header_guid
it_requested_objects = lt_request_objs
* iv_no_auth_check = 'X'
IMPORTING
et_orderadm_h = it_orderadm
et_orgman = it_orgman
et_subject = it_subject
et_partner = it_partner
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.
IF sy-subrc <> 0.
** Implement suitable error handling here
ENDIF.
SORT it_subject BY timestamp .
READ TABLE it_subject INTO wa_subject WITH KEY ref_guid = lv_ref_guid.
IF sy-subrc = 0.
ENDIF.
READ TABLE it_partner INTO wa_partner WITH KEY ref_guid = lv_ref_guid.
IF sy-subrc = 0.
ENDIF.
SELECT SINGLE * FROM zdepartment INTO wa_dept WHERE category_2 = wa_subject-cat_id.
IF wa_partner-ref_partner_no = wa_dept-zuser.
SKIP.
ELSE.
->partner details
IF wa_dept-zuser IS NOT INITIAL.
wa_partner1-partner_fct = '00000014'.
wa_partner1-partner_no = wa_dept-zuser. "Employee responsibl
APPEND wa_partner1 TO it_partner1.
ENDIF.
IF wa_dept-reporter IS NOT INITIAL.
wa_partner1-partner_fct = 'Z0000001'.
wa_partner1-partner_no = wa_dept-reporter. "reporting manager
APPEND wa_partner1 TO it_partner1.
ENDIF.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_partner = it_partner1
IMPORTING
et_exception = lt_exception1
CHANGING
ct_input_fields = it_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
wa_save = lv_ref_guid.
INSERT wa_save INTO TABLE it_save_guid.
wa_saved_objects-guid = lv_ref_guid.
INSERT wa_saved_objects INTO TABLE et_saved_objects.
**--> Save
*************************************************************************************
* CALL FUNCTION 'CRM_ORDER_SAVE'
* EXPORTING
* it_objects_to_save = it_save_guid
*** iv_update_task_local = false
*** iv_save_frame_log = false
*** iv_no_bdoc_send = false
*** it_active_switch =
* IMPORTING
* et_saved_objects = et_saved_objects
* et_exception = et_exception1
* et_objects_not_saved = et_objects_not_saved
* CHANGING
* cv_log_handle = lv_log_handle
** ct_nocheck_before_save =
* EXCEPTIONS
* document_not_saved = 1
* OTHERS = 2.
ENDMETHOD.
Until CRM_ORDER_MAINTAIN its working fine and in debugging the employee responsible and reporter are getting updated but when the cursor goes near CRM_ORDER_SAVE its not accepting to run.its getting buffered and none of the value is getting updated in CRM_GUI screen.
Please help out me here,how can i update the value.
Note : I also used another function module for saving i.e
CRMXIF_ORDER_SAVE but its also not working.
Guys your suggestions are most appreciated and valued.
Thanks in advance :).
Srilatha
User | Count |
---|---|
12 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.