Skip to Content
author's profile photo Former Member
Former Member

CRM-ABAP how to capture long text of error log from SLG1

Hi experts,

I need to get capture error messages from log and long text for the error message.

I am using CRM_ORDER_READ to get teh detials.

I am using APPL_LOG_READ_DB to get the log details and messages from my custom program.

I was able to get the error messages but need to fetch long text also.

I tried to call the fm's CRM_MESSAGES_SEARCH and CRM_MESSAGES_GET_LONGTEXT using teh log handle got from APPL_LOG_READ_DB..

Log not found in memory - message I am getting.

I am capturing the errors from outside the transaction.

If any one has idea please guide me.

Thanks in advance.

Sudha

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2012 at 04:37 PM

    Hello Sudha

    With the function module APPL_LOG_READ_DB you get message table, this table has an id message , number of message and value variables . With this information you can go to function module RH_MESSAGE_GET and get long description of a message.

    That description is equal to description you can view in transaction SLG1.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI Linderman,

      Thanks for your reply.

      By using the FM RH_MESSAGE_GET I am getting the error message.

      I need to capture the Transmission log from SLG1.

      Long text of crmd_order.

      If you have any idea please guide me.

      Thanks,

      Sudha

  • author's profile photo Former Member
    Former Member
    Posted on Jun 03, 2013 at 06:43 AM

    Hi Sudha,

    We display the App-log in a report, where we have a column with "?" icon that is used as

    hot-spot. Clicking the hot-spot will display a popup with long-text (same as in SLG1).

    This is how we did it:

    1. First you need to check if message has long-text:

    * Build object from Message-ID & Message-Number.
    CONCATENATE iv_msgid iv_msgno INTO lv_object.

    * Check for long-text
    SELECT SINGLE selfdef
    FROM dokil
    INTO lv_selfdef
    WHERE id = 'NA' "For messages
    AND object = lv_object
    AND langu = sy-langu.

    This will allow you to know if you need to display the Icon for the hot-spot or not.

    2. When the hot-spot is clicked you activate this code:


    DATA: ls_display TYPE ty_display,
    ls_help_info TYPE help_info,
    lt_dselc TYPE STANDARD TABLE OF dselc,
    lt_dval TYPE STANDARD TABLE OF dval.
    DATA: lv_arbgb TYPE arbgb,
    lv_msgnr TYPE msgnr.

    * Read log line
    READ TABLE gt_display INTO ls_display INDEX es_row_no-row_id.

    IF ls_display-long_text IS INITIAL.
    MESSAGE i000(y1) WITH 'No long-text to display'.
    RETURN.
    ENDIF.

    ls_help_info-call = 'D'.
    ls_help_info-spras = sy-langu.
    ls_help_info-messageid = ls_display-msgid.
    ls_help_info-messagenr = ls_display-msgno.
    ls_help_info-title = 'Langtext'(lon).
    ls_help_info-docuid = 'NA'.
    ls_help_info-msgv1 = ls_display-msgv1.
    ls_help_info-msgv2 = ls_display-msgv2.
    ls_help_info-msgv3 = ls_display-msgv3.
    ls_help_info-msgv4 = ls_display-msgv4.

    CALL FUNCTION 'HELP_START'
    EXPORTING
    help_infos = ls_help_info
    TABLES
    dynpselect = lt_dselc
    dynpvaluetab = lt_dval.


    Hope it helps.

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.