Tip 1: Opening CRM Order in a new window
When there is a requirement to open a CRM Order (Customer Order. Service Order. etc.) from a program, the normal process is to populate the Business Object Parameter (CRM_OBJECT_ID) with the Transaction Number (OBJECT_ID) and then doing a CALL TRANSACTION to CRMD_ORDER. But this method does not seem to work.
SET PARAMETER ID 'CRM_OBJECT_ID' FIELD
CALL TRANSACTION 'CRMD_ORDER' AND SKIP FIRST SCREEN.
It will not get into the transaction (CRM Order) , but stop at the search screen
The way around could be using the BAPI BAPI_BUSPROCESSND_DISPLAY to display the CRM Order. You can use it to display the CRM Order screen directly. Just pass your Order Header GUID ID to the business process and the CRMD_ORDER screen will be displayed.
CALL FUNCTION 'BAPI_BUSPROCESSND_DISPLAY'
EXPORTING
business_process = <order_header_guid>
If possible, you can follow the following steps.
a) First delete message, for example
CALL FUNCTION 'CRM_MESSAGES_DELETE'
EXPORTING
iv_caller_name = gc_object_name-order
iv_ref_object = iv_item
it_r_msgidno = lt_idno
EXCEPTIONS
OTHERS = 1.
b) Check for corresponding message text already exists or not, for example
CALL FUNCTION 'CRM_TEXT_READ_API'
EXPORTING
it_guid = lt_object_guids
iv_object_kind = gc_object_kind-orderadm_i
IMPORTING
et_text = lt_text.
OR,
Search the corresponding messages, for example,
ls_idno-sign = 'I'.
ls_idno-option = 'EQ'.
ls_idno-low-msgid = 'Z_ZZZ_CA_MESSAGES'.
ls_idno-low-msgno = '126'.
APPEND ls_idno TO lt_idno.
CALL FUNCTION 'CRM_MESSAGES_SEARCH'
EXPORTING
it_r_msgidno = lt_idno
iv_ref_object = iv_header_guid
iv_ref_kind = gc_object_kind-orderadm_h
iv_only_errors_on_object = true
IMPORTING
et_msg_info = lt_msg_info
EXCEPTIONS
appl_log_error = 1
error_occurred = 2
OTHERS = 3.
c) If message does not exist .Then raise message. for example
CALL FUNCTION 'CRM_MESSAGE_COLLECT'
EXPORTING
iv_caller_name = gc_object_name-order
iv_ref_object = iv_item
iv_ref_kind = gc_object_kind-orderadm_i
iv_logical_key = 'MAINTAIN'
iv_msgno = lv_msgno
iv_msgid = 'CRM_ORDERADM_I'
iv_msgty = lv_msgty
EXCEPTIONS
not_found = 1
appl_log_error = 2
OTHERS = 3.