We can help. Together we learn....

ABAP CRM Tips

by Biswa | Tuesday, November 04, 2008 in , |

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>

Tip 2: Inserting or Deleting Standard / Custom messages in CRM GUI.

If possible, you can follow the following steps.

a) First delete message, for example


* Deleting the messages from stack

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.


3 comments:

  1. Sankar Babu on March 16, 2010 at 1:00 PM

    Excellent work,thnx for sharing with us.

    Want to learn more,keep doing.

     
  2. Sunitha Gadugula on January 28, 2013 at 4:12 PM

    Hi this is regarding "Opening CRM Order in a new window" Tip 1. Is there any other way to do this, as because I dont have access to "BAPI_BUSPROCESSND_DISPLAY", So am getting dump... Could u plz help in this regard..
    Thanks in advance
    Sunitha Gadugula

     
  3. Unknown on November 15, 2016 at 12:49 PM

    You made some decent factors there. I looked on the internet for the difficulty and found most individuals will associate with along with your website.Keep update more excellent posts.

    Sap Training in Chennai | Sap Abap Training in Chennai | Sap SD Training in Chennai

     

Categories