Hi Ritu,
I am using order maitain once and then status change FM.
Pls check below code.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
IT_PRIDOC = gt_pridoc
CHANGING
CT_ORDERADM_I = lt_orderadm_i
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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
** Change the status if internal table status is initialised.
If not gs_upload-status is initial.
clear lv_item_guid.
lv_item_guid = gv_item_guid.
CALL FUNCTION 'CRM_ORDER_CHANGE_STATUS'
EXPORTING
IV_REF_GUID = lv_item_guid
IV_STATUS = 'I1005'
IV_ACTIVATE = 'X'
IV_REF_KIND = 'B'
IV_ALL_ITEMS = ' '
IV_ONLY_ITEMS = ' '
EXCEPTIONS
PARAMETER_ERROR = 1
NOT_ALLOWED = 2
ERROR_OCCURRED = 3
OTHERS = 4.
IF SY-SUBRC = 0.
gs_alv-STATUS = text-002.
Endif.
Endif.
ENDIF.