Quantcast
Channel: SCN : Unanswered Discussions - SAP CRM: Service
Viewing all articles
Browse latest Browse all 1084

Price agreements are not updating using CRM_ORDER_MAINTAIN

$
0
0

Dear All,

 

I'm trying to upload the price agreements for a service contract line item using CRM_ORDER_MAINTAIN but not updating .

 

Below is the code. Kindly check and please help me to get resolved.

 

lt_price_agee_modify internal table have all the required values to update .

 

*....Below is the code for lt_input_fields

 

    ls_input_field_names-fieldname  = 'KSCHL'.
  INSERT ls_input_field_names INTOTABLE lt_input_field_names.
  CLEAR: ls_input_field_names.


  ls_input_field_names-fieldname  = 'KBETR'.
  INSERT ls_input_field_names INTOTABLE lt_input_field_names.
  CLEAR: ls_input_field_names.
*

  ls_input_field_names-fieldname  = 'KOTABNR'.
  INSERT ls_input_field_names INTOTABLE lt_input_field_names.
  CLEAR: ls_input_field_names.

 

    ls_input_field_names-fieldname  = 'PRODUCT'.
  INSERT ls_input_field_names INTOTABLE lt_input_field_names.

 

    ls_input_fields-ref_handle = '1'.
  ls_input_fields-ref_guid   = iv_item_guid.
  ls_input_fields-ref_kind   = 'B'.
  ls_input_fields-objectname = 'PRIDOC_COM'.        "gc_object_name-pridoc.
  ls_input_fields-field_names = lt_input_field_names.
  INSERT ls_input_fields INTOTABLE lt_input_fields.
  REFRESH: lt_input_field_names.
  CLEAR: ls_input_fields .

 

   CALL FUNCTION'CRM_ORDER_MAINTAIN'
   EXPORTING
     it_price_agreements_crm       = lt_price_agree_modify
   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.
    lv_header_guid = lv_header_guid. " Passing header guid of the service contract
    INSERT lv_header_guid INTOTABLE lt_objects_to_save.

    CALLFUNCTION'CRM_ORDER_SAVE'
      EXPORTING
        it_objects_to_save   = lt_objects_to_save
      IMPORTING
        et_saved_objects     = lt_saved_objects
        et_objects_not_saved = lt_obj_not_saved
      EXCEPTIONS
        document_not_saved   = 1
        OTHERS               = 2.
    IF sy-subrc = 0.
      CALLFUNCTION'BAPI_TRANSACTION_COMMIT'.
      IF sy-subrc = 0.
        WRITE: / 'Price agr success'.
      ENDIF.
    ENDIF.
  ENDIF.


Viewing all articles
Browse latest Browse all 1084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>