cancel
Showing results for 
Search instead for 
Did you mean: 

Updating billing plan status in service contracts

former_member193947
Participant
0 Kudos

Dear Experts,

I have worked in Business Partner module, but not much in other modules like BT.

I have a requirement to create a program for updating bill plan status in Service Contracts. Hope it will update both header/item levels. Can i use CRM_ORDER_MAINTAIN function module to achieve that ? Please point, which tables might be updated by doing this as well.

Can someone please post sample code snipped here ?

Your help is much appreciated.

Thanks and Regards,

Seeker.

Accepted Solutions (1)

Accepted Solutions (1)

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

You can use CRM_ORDER_MAINTAIN FM.Table CRM_JEST table you can check for updated status.

chck this code

lv_guid = "service contract guid
    
      lwa_status_com-user_stat_proc  = "status profile.    
      lwa_status_com-ref_guid =  lv_guid.
      lwa_status_com-status = iv_status."status u want to update
      lwa_status_com-ref_kind = 'A'.
      lwa_status_com-activate = 'X'.
      INSERT lwa_status_com INTO TABLE li_status.

      lwa_fieldname-fieldname = 'ACTIVATE'.
      INSERT lwa_fieldname INTO TABLE li_fieldnames.

      lwa_input_field-field_names  =  li_fieldnames.
      lwa_input_field-ref_guid        =  lv_guid.
      lwa_input_field-ref_kind        =  'A'.
      lwa_input_field-objectname   =  'STATUS'.
      CONCATENATE lwa_status_com-status lwa_status_com-user_stat_proc INTO lwa_input_field-logical_key.

      INSERT lwa_input_field INTO TABLE li_input_field.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_status         = li_status
        CHANGING
          ct_input_fields   = li_input_field
          cv_log_handle     = log_handle
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
      REFRESH: li_saved_objects.
      INSERT lv_guid INTO TABLE li_header_guid.
      CALL FUNCTION 'CRM_ORDER_SAVE'
        EXPORTING
          it_objects_to_save   = li_header_guid
          iv_update_task_local = 'X'
          iv_save_frame_log    = 'X'
        IMPORTING
          et_saved_objects     = li_saved_objects
        EXCEPTIONS
          document_not_saved   = 1
          OTHERS               = 2.
      IF sy-subrc IS INITIAL.
        COMMIT WORK AND WAIT.     
      ENDIF.

Regards,

Deepika.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

   1.Put breakpoint in CRM_ORDER_MAINTAIN function module.

   2.Go to CRMD_ORDER transaction and try to update billing plan status and save.

   3.Breakpoint will trigger. then check the parameters which are passing?

 

         Eg. CT_Input_fields or ET_partner or ET_orderadm_h.

   4.In your se38 program use CRM_ORDER_MAINTAIN fm and pass the parameters which are found in   Debugging.