Hi All,
I am updating the CUSTOMER_I table using CRM_ORDER_MAINTAIN in ORDER_SAVE Prepare method.
But I am not able to update Customer fields in CUSTOMER_I table.
Below is the code.
LOOP AT lt_orderadi INTO ls_orderadi.
ls_customer_i-ref_guid = ls_orderadi-guid.
ls_customer_i-ZZ_FIELD= '12345'
INSERT ls_customer_i INTO TABLE lt_customer_i.
ls_input_fields-ref_guid = ls_orderadi-guid.
ls_input_fields-ref_kind = 'B'.
ls_input_fields-objectname = 'CUSTOMER_I'.
ls_field_names-fieldname = 'ZZ_FIELD'.
INSERT ls_field_names INTO TABLE lt_field_names.
ls_input_fields-field_names[] = lt_field_names[].
INSERT ls_input_fields INTO TABLE lt_input_fields.
ENDLOOP.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_customer_i = lt_customer_i
IMPORTING
et_exception = lt_excep
CHANGING
ct_input_fields = lt_input_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.
* ENDIF.
ENDIF.
regards,ram