Application Development and Automation 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: 
Read only

Error Log FM

Former Member
0 Likes
2,212

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

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
1,644

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)

7 REPLIES 7
Read only

Former Member
0 Likes
1,644

You can look at FM POPUP_TO_DISPLAY_TEXT.

Rob

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,644

Hi, please see example program SBAL_DEMO_01. It will give you an idea of how to use the function modules which will solve your problem. Its a little more than what is in ME21N, but I think it will work for you.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,644

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.

Read only

Former Member
0 Likes
1,644

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.

Read only

Former Member
0 Likes
1,644

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

Read only

former_member186741
Active Contributor
0 Likes
1,645

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)

Read only

0 Likes
1,644

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