Skip to Content

Message handling with multiple lines to display

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2008 at 02:47 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2008 at 02:55 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2008 at 03:01 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 04, 2008 at 09:32 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.