如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue

i042416發表於2020-08-22

By default after a service order is saved, there is a distribution lock set, which prevents you from editing this order in status transferring. Click edit button you will meet with error message below until it has successfully been transferred.


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


In blog  Regarding Service Order distribution lock and status I introduce the step how to avoid this distribution lock. Nevertheless there is still BDOC and an inbound CSA queue automatically generated. The purpose of CSA queue has already been well explained by Rohit Sharma in this  thread:


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


In case you really would like that for a given transaction type, no BDOC and inbound CSA queue should be generated for whatever reasons, you can suppress this behavior by enhancement on function module CRM_ORDER_SAVE_OW.

In this function module, the BDOC and CSA queue will be created by function module CRM_ORDER_UPLOAD_SINGLE only when ALL the THREE condition in IF are fulfilled. The second condition, lv_send_bdoc is controlled by a switch.


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


So the solution would be: Create a new enhancement on function module CRM_ORDER_SAVE_OW:


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


Insert one line below:


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


Suppose you would like that for transaction type ZSRV, no BDOC should be generated, then the source code of run method:

METHOD run.
    DATA lv_process_type    TYPE crmt_process_type.
    LOOP AT it_object_list ASSIGNING FIELD-SYMBOL(<guid>).
      CALL FUNCTION 'CRM_ORDERADM_H_READ_OW'
        EXPORTING
          iv_orderadm_h_guid     = <guid>
        IMPORTING
          ev_process_type        = lv_process_type
        EXCEPTIONS
          admin_header_not_found = 1
          OTHERS                 = 2.
      CHECK lv_process_type = 'ZSRV'.
      CALL FUNCTION 'CRM_ORDER_SET_NO_BDOC_SEND_OW'
        EXPORTING
          iv_guid = <guid>
          iv_flag = 'N'.
    ENDLOOP.
  ENDMETHOD.

Now the lv_send_bdoc will be set as false in the runtime according to the switch you set in enhancement, as a result no BDOC and inbound queue will be created any more.


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


Now after service order is saved you can still continue to edit.


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


Update on 2017-01-23

I am told by my colleague today that there is a better solution to leverage BAdI CRM_DATAEXCHG_BADI:


如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":

如何避免SAP訂單儲存後生成的中介軟體CSA inbound queue


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2713817/,如需轉載,請註明出處,否則將追究法律責任。

相關文章