Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Capturing Log in BDC

Former Member
0 Likes
656

Hai..

I want to capture error messages. I am able to do so with the normal error messages that appear on the status bar at the down. But I am not able to capture error messages that appear in the error log and not on the status bar. How to capture it?

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
604

Hi,

In BDC call transaction mode you will get messages in MESSAGES table. In session it is handeled automatically. I don't think you can get any extra messages which are not captured be MESSGE addition.

Read only

Former Member
0 Likes
604

Hi rajalaxmi,

Use the following code



CALL TRANSACTION 'ME51' USING bdcdata MODE 'N'
                                                MESSAGES INTO t_msg.


DATA:
    lw_msg TYPE string.
    LOOP AT t_msg INTO fs_msg where msgid eq 'E'.
    CALL FUNCTION 'FORMAT_MESSAGE'
      EXPORTING
        id        = fs_msg-msgid
        lang      = 'EN'
        no        = fs_msg-msgnr
        v1        = fs_msg-msgv1
        v2        = fs_msg-msgv2
        v3        = fs_msg-msgv3
        v4        = fs_msg-msgv4
      IMPORTING
        msg       = lw_msg
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    WRITE:/ lw_msg.
  ENDLOOP.

Regards and Best wishes.

Read only

Former Member
0 Likes
604

What is the log you refer to?