Created by Jerry Wang, last modified on Apr 29, 2015

测试代码如下:

REPORT zcreate_order_via_switch.
DATA: lt_orderadm_h_com TYPE crmt_orderadm_h_comt,
ls_orderadm_h_com LIKE LINE OF lt_orderadm_h_com,
lt_input_fields TYPE crmt_input_field_tab,
ls_input_field LIKE LINE OF lt_input_fields,
ls_field_name TYPE LINE OF crmt_input_field_names_tab,
lt_switch TYPE crmt_active_switch_t,
ls_switch TYPE LINE OF crmt_active_switch_t.
ls_orderadm_h_com-guid = 'FA163EEF573D1EE4BBC55ED30227B2FC'.
ls_orderadm_h_com-process_type = 'SC1'.
ls_orderadm_h_com-mode = 'A'.
APPEND ls_orderadm_h_com TO lt_orderadm_h_com.
ls_input_field-ref_guid = ls_orderadm_h_com-guid.
ls_input_field-ref_kind = 'A'.
ls_input_field-objectname = 'ORDERADM_H'.
ls_field_name-fieldname = 'MODE'.
APPEND ls_field_name TO ls_input_field-field_names.
ls_field_name-fieldname = 'PROCESS_TYPE'.
ls_field_name-changeable = 'A'.
APPEND ls_field_name TO ls_input_field-field_names.
APPEND ls_input_field TO lt_input_fields.
ls_switch-ref_guid = ls_input_field-ref_guid.
ls_switch-ref_kind = 'A'.
ls_switch-partner_determ = 'A'.
APPEND ls_switch TO lt_switch.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_active_switch = lt_switch
CHANGING
ct_orderadm_h = lt_orderadm_h_com
ct_input_fields = lt_input_fields
EXCEPTIONS
OTHERS = 99.
IF sy-subrc = 0.
WRITE: / 'order maintain is done sucessfully'.
ENDIF.

如何禁掉partner determination逻辑_d3​​ 传递A的原因:
​​如何禁掉partner determination逻辑_5e_02​​ 则function module CRM_PARTNER_DETERMINATION_OW调用的时候,该flag被evaluate,如果为A,直接结束partner determination。
​​如何禁掉partner determination逻辑_d3_03