Skip to Content
0
Former Member
Apr 03, 2013 at 07:20 AM

Failing to insert Finance product in CRMD_ORDER by using CRM_ORDER_MAINTAIN

21 Views

Hello Experts,

i am creating a program for to Create the Quotation in CRMD_ORDER.I Created the quotation threw opportunity successfully without any errors.

But my problem is i am not able to create Finance product for that Quotation.

I tried so many ways but of no use.Actally i am facing this problem from so many days but no result so finally i decided to post this question.

My code is

ls_orderadm_i-handle = '00000000000'.
ls_orderadm_i-header = '514E841100C34430E1008000AC1010B7'.
ls_orderadm_i-ordered_prod = 'LOAN'.
ls_orderadm_i-mode = 'A'.

INSERT ls_orderadm_i INTO TABLE lt_orderadm_i.
CLEAR ls_orderadm_i.

ls_input_fields-ref_handle = '0000000000'.
ls_input_fields-ref_guid = '514E841100C34430E1008000AC1010B7'.
ls_input_fields-ref_kind = 'A'.
ls_input_fields-objectname = 'ORDERADM_I'.

ls_input_field_names-fieldname = 'ORDERED_PROD'.
INSERT ls_input_field_names INTO TABLE ls_input_fields-field_names.
CLEAR ls_input_field_names.
ls_input_field_names-fieldname = 'MODE'.
INSERT ls_input_field_names INTO TABLE ls_input_fields-field_names.
CLEAR ls_input_field_names.

INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.

ls_product-ref_handle = '0000000000'.
ls_product-process_qty_unit = 'EA'.
APPEND ls_product TO lt_product.
CLEAR ls_product.

ls_input_fields-ref_handle = '0000000000'.
ls_input_fields-ref_kind = 'A'.
ls_input_fields-objectname = 'PRODUCT_I'.

ls_input_field_names-fieldname = 'PROCESS_QTY_UNIT'.
INSERT ls_input_field_names INTO TABLE ls_input_fields-field_names.
CLEAR ls_input_field_names.

INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_product_i = lt_product
IMPORTING
et_exception = lt_exception
CHANGING
ct_orderadm_i = lt_orderadm_i
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.

Can any one please help me to rectify this.It's very Urgent for me.

Thanks

Mani