Application Development 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: 

Capturing Runtime messages in BDC through 'Call Transaction'

Former Member
0 Kudos

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 !!

8 REPLIES 8

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

former_member182371
Active Contributor
0 Kudos

Hi,

have a look at transaction SLG1.

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

Best regards.