cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

yes_sapteam
Participant
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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