cancel
Showing results for 
Search instead for 
Did you mean: 

Hi i am facing the problem with CRM_ORDER_READ

Former Member
0 Kudos

Dear Experts,

I have written the program in which i am changing the status of transaction by using the function module

CRM_ORDER_MAINTAIN and CRM_ORDER_READ and next BAPI_TRANSACTION_COMMIT it was working fine in CRM 5.2 but now we have upgraded to CRM 7.0 in this it is falling saying that commit is required.

and i tryed to debug also it is geting terminated when it is calling the FM crm_order_read.

please help me on this issue.

Regards,

Tanveer.Ahmed

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Tanveer,

After call CRM_ORDER_MAINTAIN please, call CRM_ORDER_SAVE passing the GUID that was created. After call the FM CRM_ORDER_INITIALIZE passing again the GUID. So you can read using CRM_ORDER_READ.

Regards,

Caíque Escaler

Former Member
0 Kudos

Hi,

Thank's for replay there is one problem it was working fine in CRM5.2 noe we have upgraded to CRM7.0 and after upgrade only this problem is coming up.

and this problem come only when the FM CRM_ORDER_SAVE is called it is saying commit is requred and after this FM i am calling COMMIT FM also but till then it is geting failed.

Regards,

Tanveer.Ahmed

Former Member
0 Kudos

Hi Tanveer,

After call your process, please, call trx SM13 and see where the error is happening.

Regards,

Caíque Escaler

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Tanveer,

Maybe follwoing function modules can help you:

  • CRM_ORDER_READ_OW

  • CRM_ORDERADM_H_CHANGE_OW

I'm using those two FM to check the partner of an order and change the description. So here is my example code:


" set guid for order read
  append iv_guid to lt_guids.

" set objects for order read
  ls_req_obj = 'PARTNER'.
  append ls_req_obj to lt_req_obj.

" read order
  call function 'CRM_ORDER_READ_OW'
    exporting
      it_header_guid       = lt_guids
      it_requested_objects = lt_req_obj
    importing
      et_orderadm_h        = lt_orderadm_h
      et_partner           = lt_partner
    changing
      cv_log_handle        = lv_log_handle
    exceptions
      document_not_found   = 1
      error_occurred       = 2
      document_locked      = 3
      no_change_authority  = 4
      no_display_authority = 5
      no_change_allowed    = 6
      others               = 7.

" ...
" checking partner and setting new description etc...... (omited coding)
" ...

" set new description
  ls_orderadm_h-description = lv_new_desc.

" move order header to 'com' structure for order change
  move-corresponding ls_orderadm_h to ls_order_com.

" set description field into changed fields table
  ls_field-fieldname = 'DESCRIPTION'.
  ls_field-changeable = ' '.
  append ls_field to lt_fields.

" change order (description)
  call function 'CRM_ORDERADM_H_CHANGE_OW'
    exporting
      is_orderadm_h_com    = ls_order_com
    changing
      ct_input_field_names = lt_fields
    exceptions
      fill_error           = 1
      put_error            = 2
      publish_error        = 3
      process_type_error   = 4
      no_authority         = 5
      others               = 6.

Hopefully that helps,

Cheers,

Melanie