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

Capturing Runtime messages in BDC through 'Call Transaction'

Hello All..

In case of BDC, when CALL TRANSACTION..USING...MESSAGES INTO IT_MESSAGE is called,only the error messages which appears at the bottom get captured but i want to capture those messages which appear in a pop-up during the execution of transaction..

e.g. in transaction TX02...goto 'Default Risk limit' tab..n click on 'Limit utilisation details'..the content displayed need to be captured...how to do that ?

If somebody has worked on this..it would be of great help !!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2006 at 10:09 AM

    hi ,

    there is one function module FORMAT_MESSAGE

    which will capture all the error messages of that transaction

    use this function module after call transacation

    and pass the necessary parameters.

    all the best

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2006 at 10:14 AM

    The BDCMSGCOLL does not have the messages text. It has only the message type, number and message parameters.

    You have to read the message text. (the database table T100 stores all the messages.)

    There are more than one method of doing this.

    Following is the psuedocode for one of the methods.

    LOOP for the internal table IT1 which has data value from flat file.

    call transcation using....

    if SY-SUBRC <> 0.

    Read the dictionary table T100 FOR ALL ENTRIES in BDCMSGCOLL.

    (also use the condition T100-SPRAS = SY-LANGU (the log on language. This is because you need only the message texts in English if the user is logged in English language)

    IF message type is E , then, transfer the contents of this particular error record to file x. (TRANSFER......)

    ( Ignore all other messages. Only consider type 'E' messages. Ignore other types of messages.)

    (You can also store the message text from T100 and the error record in another internal table IT2)

    .....

    ....

    ENDLOOP.

    Otherwise just display the error messages and the error records in the internal table IT2 in the form of a list.

    Thats it.

    Alternatively,

    Instead of

    " Read the dictionary table T100 FOR ALL ENTRIES in BDCMSGCOLL."

    you can use the function module

    WRITE_MESSAGES to read the messages.

    Please refer to the function module for the list of parameters.

    Also refer FORMAT_MESSAGES function module.

    Best Regards,

    Vibha

    *Please mark all the helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Vibha..

      Thanks for your input..

      I have already tried the way u suggested. Actually the problem is the messges in the <b>POP-UP</b> does not get tracked in IT_MESSAGE ( which is of type BDCMSGCOLL )...If it gets tracked then only i will be able to display it.

      Can u please elaborate it for <b>POP-UP messages</b>..the ones which are displayed in ALV GRID..in a pop-up

      If you can go to the transaction TX02 in the way i mentioned in the query...u will come to know what sort of pop-up i am talking about..

      waiting for your reply..

      regards

      nidhi

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2006 at 11:04 AM

    Try to use this code.....

    data: lt_messages like bdcmsgcoll occurs 0 with header line.

    refresh lt_messages.

    call transaction 'TX02' using lt_bdcdata

    options from option

    messages into lt_messages.

    if sy-subrc <> 0.

    *-- Perform to format the message given by the system

    perform format_messages tables lt_messages

    using lv_msg

    lv_lines.

    else.

    *-- Perform to format the message given by the system

    perform format_messages tables lt_messages

    using lv_msg

    lv_lines.

    endif.

    refresh: lt_bdcdata,lt_messages.

    clear: lt_bdcdata,lt_messages.

    form format_messages tables pt_messages structure bdcmsgcoll

    using pv_msg pv_lines.

    clear : pv_lines,pt_messages,pv_msg.

    describe table pt_messages lines pv_lines.

    read table pt_messages index pv_lines.

    check not pt_messages-msgid is initial.

    *-- Function module to format the message given

    call function 'FORMAT_MESSAGE'

    exporting

    id = pt_messages-msgid

    lang = sy-langu

    no = pt_messages-msgnr

    v1 = pt_messages-msgv1

    v2 = pt_messages-msgv2

    v3 = pt_messages-msgv3

    v4 = pt_messages-msgv4

    importing

    msg = pv_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 into pv_msg.

    endif.

    Madhavi

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Madhavi..

      Use of FORMAT_MESSAGE will again require that lt_message table to be filled with the message i need..

      The problem lies here only..the 'lt_message' table itself is <b>not getting filled up</b> because the exact msg comes in a pop-up ( <b>NOT a System msg OR ERROR msg</b> )

      How to get this Information Message in the program is the main issue !!

      Thanks & regards

      Nidhi

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2006 at 11:45 AM

    HI,

    See the Fm <b>MASS_MESSAGE_GET</b>

    CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text

    EXPORTING

    arbgb = tmess_mtab-msgid

    msgnr = tmess_mtab-msgnr

    msgv1 = tmess_mtab-msgv1

    msgv2 = tmess_mtab-msgv2

    msgv3 = tmess_mtab-msgv3

    msgv4 ! = tmess_mtab-msgv4

    IMPORTING

    msgtext = wa_mtab-text

    EXCEPTIONS

    message_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.

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 12, 2006 at 01:00 PM

    Sorry Nidhi none of the replies are addressing your question. Unfortunately with CALL TRANSACTION..USING...MESSAGES INTO IT_MESSAGE what you see is what you get. There is nothing more you can do to influence the messages returned. If it is that important you could implement a small mod that would push the message to the bottom of the screen as well as the popup.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 14, 2006 at 07:52 AM

    Hi,

    have a look at transaction SLG1.

    it´s a good way of controlling the messages in a BDC.

    Best 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.