2008 Jul 29 2:00 PM
Hi All,
I have created a Call transaction for the T code F9B1.On pressing save button a new screen is displyed and success message getting displayed on the status bar of the screen . I have to send this message details to the user by mail.
Now my problem is that this success message is not captured in BDCMSGCOLL table. Please let me know the procedure to capture the message.
Regards,
Shiva
Hi All,
I have created a Call transaction for the T code F9B1.On pressing save button a new screen is displyed and success message getting displayed on the status bar of the screen . I have to send this message details to the user by mail.
Now my problem is that this success message is not captured in BDCMSGCOLL table. Please let me know the procedure to capture the message.
Regards,
Shiva
2008 Jul 29 2:03 PM
perform background tables bdcerror2
using 'XD01' " s_tcode
'A' " s_mode
'A'. " s_update
form background tables xmessages structure bdcmsgcoll
using p_tcode
p_mode
p_update.
data: lin like sy-tfill.
refresh xmessages.
call transaction p_tcode using bdcdata mode p_mode
update p_update messages into xmessages.
clear lin.
describe table xmessages lines lin.
if lin > 0.
loop at xmessages.
if xmessages-msgtyp = 'S'.
move-corresponding xmessages to: bdcerror,msg_log.
msg_log-msgno = xmessages-msgnr.
msg_log-msgty = xmessages-msgtyp.
call function 'MESSAGE_TEXTS_READ'
exporting
msg_log_imp = msg_log
importing
msg_text_exp = msg_text
exceptions
others = 1.
bdcerror-msgtx = msg_text-msgtx.
append bdcerror.
endif.
endloop.
endif.
endform. " background
this will help u...
Regards
Anbu
2008 Jul 29 2:09 PM
HI,
Thanks for the early reply.
But my problem is that message is not getting stored in BDCMSGCOLL table.
Regards,
Shiva
2008 Jul 29 2:12 PM
check in debgg weather that message is raising r not.
and c that bdcmsg structure what it holds....
Regards
Anbu
2008 Jul 29 2:09 PM
Hi,
To capture success messages in call transaction..method...
As u know that U need to create an internal table (IT_MESSAGE )like BDCMSGCOLL ... ..
while ur looping this IT_MESSAGE ...
if MSGTYP = ' '.
pass internal table to workarea..
endif..
for Error records 'E' for success reocrds ' ' (space).
\[removed by moderator\]
Edited by: Jan Stallkamp on Jul 29, 2008 5:29 PM
2008 Jul 29 2:12 PM
hi use this..it is better to use this..MESSAGES INTO itab in the call transaction...then read the messages using the fm
format_message