‎2006 Nov 08 10:39 PM
Hi Folks,
Does someone knows what's the FM used to display messages in a popup dialog?
For example something like the one that uses the TCODE ME21N would be great.
If this FM is tricky a little code sample would be great.
Thanks for your help.
Kind Regards,
Gilberto Li
‎2006 Nov 08 11:43 PM
have a look at function group SMSG and the function modules contained in it. eg, MESSAGES_INITIALIZE, MESSAGE_STORE, MESSAGES_SHOW.
Message was edited by: Neil Woodruff
Thanks Rich. When you've been abapping as long as I have SOME of the stuff you know is bound to be useful sooner or late! (of course a lot of the other stuff is completely useless but that's not the point)
‎2006 Nov 08 10:48 PM
‎2006 Nov 08 10:49 PM
‎2006 Nov 08 10:59 PM
Hi again,
Thanks for your replies. Really appreciate it.
Rich, the example definitevely will solve my problem. Although I was expecting something more simple. I will leave this open see if someone can give me another FM.
Thanks again.
Kind Regards,
Gilberto Li.
‎2006 Nov 08 11:09 PM
hi Gilberto,
I was wondering whether you are looking for POPUP_WITH_TABLE_DISPLAY, which is very easy to handle .......to display error logs.
Sajan.
‎2006 Nov 08 11:10 PM
Hi,
Try to use the FM REUSE_ALV_POPUP_TO_SELECT..
Check this sample code...
TYPE-POOLS: slis.
DATA: BEGIN OF itab OCCURS 0,
type TYPE icon-id,
text(50),
END OF itab.
DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
DATA: s_fieldcatalog LIKE LINE OF t_fieldcatalog.
s_fieldcatalog-fieldname = 'TYPE'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-icon = 'X'.
s_fieldcatalog-seltext_s = 'Type'.
APPEND s_fieldcatalog TO t_fieldcatalog.
CLEAR: s_fieldcatalog.
s_fieldcatalog-fieldname = 'TEXT'.
s_fieldcatalog-tabname = 'ITAB'.
s_fieldcatalog-seltext_s = 'Message'.
s_fieldcatalog-outputlen = '50'.
APPEND s_fieldcatalog TO t_fieldcatalog.
itab-type = '@5C@'.
itab-text = 'This is a Error message'.
APPEND itab.
itab-type = '@5D@'.
itab-text = 'This is a Warning message'.
APPEND itab.
itab-type = '@5B@'.
itab-text = 'This is a Success message'.
APPEND itab.
DATA: v_repid TYPE syrepid.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = 'Test'
i_screen_start_column = 10
i_screen_start_line = 10
i_screen_end_column = 70
i_screen_end_line = 20
i_tabname = 'ITAB'
it_fieldcat = t_fieldcatalog
i_callback_program = v_repid
TABLES
t_outtab = itab.
Thanks,
Naren
‎2006 Nov 08 11:43 PM
have a look at function group SMSG and the function modules contained in it. eg, MESSAGES_INITIALIZE, MESSAGE_STORE, MESSAGES_SHOW.
Message was edited by: Neil Woodruff
Thanks Rich. When you've been abapping as long as I have SOME of the stuff you know is bound to be useful sooner or late! (of course a lot of the other stuff is completely useless but that's not the point)
‎2006 Nov 09 12:53 AM
I appears that Neil has the solution. It is pretty much like the other log in the example program I suggest above, but it is exactly what you see in ME21n, notice that there is parameter that will force an ALV grid instead of list display, I kind of like the grid.
report zrich_0001.
call function 'MESSAGES_INITIALIZE'
exceptions
others = 1.
call function 'MESSAGE_STORE'
exporting
arbgb = 'M3'
msgty = 'E'
msgv1 = space
msgv2 = space
msgv3 = space
msgv4 = space
txtnr = '002'
exceptions
message_type_not_valid = 1
not_active = 2
others = 3.
call function 'MESSAGES_SHOW'
exporting
I_USE_GRID = 'X' " Comment for list display
batch_list_type = 'L'
exceptions
inconsistent_range = 1
no_messages = 2
others = 3.
Very nice, Neil.
Regards,
Rich Heilman