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: 

Message handling with multiple lines to display

alancecchini
Participant
0 Kudos

We have a requirement to issue an error message during dialog processing (PAI) and I'd like to use standard message handling if possible. The syntax

MESSAGE W008(ZTM) DISPLAY LIKE 'I'.

gives me a dialog box but handles the message as an error hence processing stops and the user returns to the screen. I want this functionality but with the ability to display several lines in the message pop up box. I've looked at the function modules POPUP_DISPLAY_MESSAGE but this displays only 1 line and POPUP_TO_CONFIRM which handles multiple lines but doesn't stop processing (unless further code is added to handle the response). Can someone suggest a standard of way of achieving this requirement or how to handle a response as an error in the subsequent processing after a call to function module POPUP_TO_CONFIRM.

4 REPLIES 4

Former Member
0 Kudos

i know there are other options, but quickly searching SE37 I found C_POPUP_WITH_TABLE_DISPLAY

you can pass it an itab of data, it gives you green check & red X pushbuttons.

regards,

robert.

Former Member
0 Kudos

Hi,

FM - POPUP_WITH_TABLE_DISPLAY_OK this will also solve the purpose.

Here its like a screen where you can provide, message details in itab, start end column positions too.

thnx,

ags.

Former Member
0 Kudos

hi,

you can handle like this.

call function 'POPUP_TO_CONFIRM'

exporting

titlebar = text-000

  • DIAGNOSE_OBJECT = ' '

text_question = v_text

text_button_1 = 'YES'

  • ICON_BUTTON_1 = ' '

text_button_2 = 'NO'

  • ICON_BUTTON_2 = ' '

default_button = '1'

display_cancel_button = 'X'

  • USERDEFINED_F1_HELP = ' '

start_column = 25

start_row = 6

  • POPUP_TYPE =

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

importing

answer = v_ans

  • TABLES

  • PARAMETER =

exceptions

text_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.

endif.

case v_ans.

when '1'.

leave program.

when '2'.

call screen 100.

when others.

call screen 100.

endcase.

endcase.

Here : 1 means yes,

2 means no.

Regards

Sandeep Reddy

former_member182371
Active Contributor
0 Kudos

Hi,

you can retrieve and display the messages with fm´s:


CALL FUNCTION 'MESSAGES_INITIALIZE'. 
 
LOOP AT it_return_bapi. 
    CALL FUNCTION 'MESSAGE_STORE' 
         EXPORTING 
              arbgb                   = it_return_bapi-id 
              exception_if_not_active = ' ' 
              msgty                   = it_return_bapi-type 
              msgv1                   = it_return_bapi-message_v1 
              msgv2                   = it_return_bapi-message_v2 
              msgv3                   = it_return_bapi-message_v3 
              msgv4                   = it_return_bapi-message_v4 
              txtnr                   = it_return_bapi-number 
              zeile                   = ' ' 
         EXCEPTIONS 
              message_type_not_valid  = 1 
              not_active              = 2 
              OTHERS                  = 3. 
  ENDLOOP.
 
CALL FUNCTION 'MESSAGES_STOP' 
       EXCEPTIONS 
            a_message = 04 
            e_message = 03 
            i_message = 02 
            w_message = 01. 
 
 IF NOT sy-subrc IS INITIAL. 
    CALL FUNCTION 'MESSAGES_SHOW' 
         EXPORTING 
              i_use_grid         = 'X' 
              i_amodal_window    = i_amod_window 
         EXCEPTIONS 
              inconsistent_range = 1 
              no_messages        = 2 
              OTHERS             = 3. 
  ENDIF. 

Best regards.