Dear Experts,
In my Z program am trying to create the Service Contract with condition record for the line item. For getting this, am using 'CRM_ORDER_MAINTAIN' with the input of it_pridoc. But its not creating the condition record for the line item. Hope i missed somthing in my program. Pl find my program bellow, Guide me.
ls_pridoc_com-ref_kind = 'B'.
ls_pridoc_com-ref_handle = '0000000001'.
ls_cond-kschl = '0PSV'.
ls_cond-kbetr = '10000'.
ls_cond-KPEIN = '1'.
ls_cond-waers = 'INR'.
INSERT ls_cond INTO TABLE ls_pridoc_com-cond_add.
INSERT ls_pridoc_com INTO TABLE gt_pridoc_com.
ls_crmt_input_field-ref_handle = '0000000001'.
ls_crmt_input_field-ref_guid = lv_guid.
ls_crmt_input_field-ref_kind = 'B'.
ls_crmt_input_field-objectname = 'PRIDOC'.
INSERT ls_input_field_names INTO TABLE ls_crmt_input_field-field_names.
INSERT ls_crmt_input_field INTO TABLE it_crmt_input_field_tab.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_sales = ls_ordermaintain_if-sales
it_pridoc = gt_pridoc_com
it_schedlin_i = ls_ordermaintain_if-schedlin_i
it_partner = it_crmt_partner_comt
it_orgman = gt_orgman
it_ordprp_objl_i_d = it_ordprp_objl_i_d
it_pricing = it_pricing
* it_appointment = gt_appointment
CHANGING
ct_orderadm_h = ls_ordermaintain_if-orderadm_h
ct_orderadm_i = ls_ordermaintain_if-orderadm_i
ct_input_fields = it_crmt_input_field_tab
cv_log_handle = gv_log_handle
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ls_bad_orderadm_h-orderadm_h_guid = lv_guid.
INSERT ls_bad_orderadm_h-orderadm_h_guid INTO TABLE lt_objects_to_save.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = lt_objects_to_save
iv_update_task_local = ''
iv_save_frame_log = 'X'
IMPORTING
et_saved_objects = lt_saved_objects
et_exception = lt_exception
CHANGING
cv_log_handle = lv_loghandle
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.