10-19-2007 12:48 PM
I have written a BDC.I want to display msgs of MESSTAB in ALV.Can someone guide me on this?
10-19-2007 12:59 PM
hI,
every time when the messge is coming out from the bdc
it will be collected into the bdcmsgcoll table
after the bdc
display this table bdcmsgcoll using alv_grid
if you want to put only the error messages
then
loop at bdcmsgcoll where msgtyp = 'E'.
append itab from bdcmsgcoll.
endloop.
display itab.
regards,
Venkatesh
10-19-2007 12:59 PM
hI,
every time when the messge is coming out from the bdc
it will be collected into the bdcmsgcoll table
after the bdc
display this table bdcmsgcoll using alv_grid
if you want to put only the error messages
then
loop at bdcmsgcoll where msgtyp = 'E'.
append itab from bdcmsgcoll.
endloop.
display itab.
regards,
Venkatesh
10-19-2007 12:59 PM
READ TABLE it_messtab INDEX sy-tfill.
SELECT SINGLE * FROM t100 WHERE sprsl = it_messtab-msgspra
AND arbgb = it_messtab-msgid
AND msgnr = it_messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH it_messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH it_messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH it_messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH it_messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH it_messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH it_messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH it_messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH it_messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
Use above code to format the messtab contents...
then fill this l)mstring in your itab and display this itab via ALV
01-30-2008 2:48 PM
In the response above, l_mstring usually has to be quite a long field, as otherwise after 4 REPLACEs (each bringing in trailing blanks) truncation will have occurred.
I use 300 characters and have had no problems yet.
John
03-24-2011 11:33 AM
03-25-2011 10:25 AM
Hi,
You can use the function module POPUP_WITH_TABLE_DISPLAY also directly to display messages in ALV.