Skip to Content
author's profile photo
Former Member

'CRM_ORDER_MAINTAIN' error messages

HI guys,

I am using BAPI 'CRM_ORDER_MAINTAIN' to create FS Quotation, but i want to get error message before SAVE, Bapi only return exceptions table and CV_LOG_HANDLE. How can I get details of errors generated in the process of creation?

Thanks ind advance,

Regards.

Marisol

Edited by: Marisol on May 3, 2011 4:22 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on May 03, 2011 at 04:55 PM

    Hi Marisol,

    Not sure how you are using it - but CRM_ORDER_MAINTAIN returns exception names. Please use pattern button to get the complete code (or CONTROL + F6)

    * EXCEPTIONS
    *   ERROR_OCCURRED                = 1
    *   DOCUMENT_LOCKED               = 2
    *   NO_CHANGE_ALLOWED             = 3
    *   NO_AUTHORITY                  = 4
    *   OTHERS                        = 5

    .

    Also, you are right BAPI would return exception table - but CRM_ORDER_MAINTAIN is just an FM and not bapi.

    Also, further I am sure you are calling CRM_ORDER_SAVE and 'BAPI_TRANSACTION_COMMIT' after this .

    CV_LOG_HANDLE is for application log - you can use FM BAL_LOG_CREATE to create it and BAL_LOG_HDR_READ to read what it contains.

    I hope it helps.

    Thanks,

    Rohit

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 03, 2011 at 05:04 PM

    To add to it, you can use FM: 'CRM_MESSAGE_COLLECT' to add a message to application log.

    Example: when dealing with partners (say partner in partner function of one order transaction).

    CALL FUNCTION 'CRM_MESSAGE_COLLECT'
    EXPORTING
    iv_caller_name = 'PARTNER'
    iv_ref_object = iv_guid
    iv_ref_kind = 'A'
    iv_msgno = '<msgno>'
    iv_msgid = '<msgclassname>' 
    iv_msgty = 'E'
    iv_fieldname = 'PARTNER_NO'
    iv_log_handle = IV_APPLICATION_LOG
    iv_docnumber = iv_guid
    IMPORTING
    es_msg_handle = <handlevariable>
    EXCEPTIONS
    not_found = 1
    appl_log_error = 2
    OTHERS = 3.

    and you can use FM: 'CRM_MESSAGES_REGISTER' to get the handle of application log from guid. This is required in case you want to add some message to existing log and you want to know the log handle from the guid.

    I hope it helps.

    Thanks,

    Rohit

    Add comment
    10|10000 characters needed characters exceeded