• You are here:
  • Home »
  • sap crm »

Recursive call error of function module ‘CRM_ORDER_MAINTAIN’

Advertisements

The SAP CRM Recursive call error for SAP function module CRM_ORDER_MAINTAIN is caused by nested calling of the FM i.e. calling it while already within a call to CRM_ORDER_MAINTAIN. Also happens via function module CRM_ORDER_MAINTAIN_MULTI_OW which also performs the recursive check.

Advertisements
Function module CRM_ORDER_MAINTAIN  appears several times in the current hierarchy for the calls. This is not scheduled. There is an error in the program.

"MESSAGE_TYPE_X"

"SAPLCRM_ORDER_OW" or "LCRM_ORDER_OWU01"

Advertisements

"CRM_ORDER_MAINTAIN_MULTI_OW"

Advertisements

Solution for crm Recursive call

Try using different function modules to perform the CRM updates such as:

Advertisements

CRM_STATUS_MAINTAIN_OW to Update status values usking

This FM updates the STATUS values


CALL FUNCTION 'CRM_STATUS_MAINTAIN_OW'
EXPORTING
it_status_com = lt_user_status
* IT_STATUS_COMINT =
* IV_CHECK_ONLY = FALSE
* IV_TRACE =
* IV_NO_1O_MAINTAIN = FALSE
* IV_FORCE_1O_MAINTAIN = FALSE
* IV_GET_ACTUAL_EXCPN = FALSE
CHANGING
ct_input_field_names = lt_input_field_names
EXCEPTIONS
not_allowed = 1
error_occurred = 2
warning_occurred = 3
OTHERS = 4
.

CRM_ORDER_I_MAINTAIN_SINGLE_OW to update ORDERADM values

Enter your text here...

Check if within CRM_ORDER_MAINTAIN update


DATA: lv_raise_exceptions TYPE crmt_boolean VALUE 'X',
lv_recursive_call TYPE i,
lv_maintain_active TYPE i,
lv_recursive_save TYPE i.

* For the OW function modules to work it needs to be within an CRM_ORDER_MAINTAIN
* update but too many recursive calls to this can cause SAP DUMP
*
* CRM_ORDER_CHECK_RECURSIVE_OW check if you are already within an update and can use
* The OW functions
CALL FUNCTION 'CRM_ORDER_CHECK_RECURSIVE_OW'
EXPORTING
iv_raise_exceptions = lv_raise_exceptions
IMPORTING
ev_recursive_call = lv_recursive_call
ev_maintain_active = lv_maintain_active
ev_recursive_save = lv_recursive_save
EXCEPTIONS
recursive_call = 2
recursive_save = 4
call_without_order_maintain = 6
OTHERS = 8.

* If return code is call_without_order_maintain then you need to perform update
* using the CRM_ORDER_MAINTAIN
IF sy-subrc = 6.
" CALL FUNCTION 'CRM_ORDER_MAINTAIN'
" EXPORTING
" it_status = " new status details
" CHANGING
" ct_orderadm_i = " orderadm_i values
" ct_input_fields = " input_field values
" EXCEPTIONS
" error_occurred = 1
" document_locked = 2
" no_change_allowed = 3
" no_authority = 4
" OTHERS = 5.
* Else you can use OW function modules
ELSE.
* Call an alternate OW function module such as CRM_STATUS_MAINTAIN_OW to update STATUS
" CALL FUNCTION 'CRM_STATUS_MAINTAIN_OW'
" EXPORTING
" it_status_com = " new status details
" CHANGING
" ct_input_field_names = " input_field values
" EXCEPTIONS
" not_allowed = 1
" error_occurred = 2
" warning_occurred = 3
" OTHERS = 4.
ENDIF.

Other CRM update FM's to check

CRM_ORDER_COPY_SINGLE_OW
CRM_ORDER_H_MAINTAIN_OW
CRM_ORDER_I_MAINTAIN_MULTI_OW
CRM_ORDER_I_MAINTAIN_SINGLE_OW
CRM_ORDER_MAINTAIN
CRM_ORDER_MAINTAIN_MULTI_OW
CRM_ORDER_MAINTAIN_SINGLE_OW
CRM_STATUS_COMINT_SAVE_OW
CRM_STATUS_EXPORT_DATA_UI
CRM_STATUS_MAINTAIN_MUL_OW
CRM_STATUS_MAINTAIN_OW

Advertisements