Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function module to display error

Hi,

I want to display a error message popup. and that pop up message should hold a

series of messages not a single message. i.e i should have a internal table where i can fill

all my msgid, msgno record by record. so that it will be displayed.

Thanks,

Vivek

Former Member
replied

Hi,

do the follwing to display list of messages in pop-up..


"Initialize one time...
* Initialize the messages
  CALL FUNCTION 'MESSAGES_INITIALIZE'
    EXCEPTIONS
      log_not_active       = 1
      wrong_identification = 2
      OTHERS               = 3.

"append all error warning messages to below function module
      PERFORM store_messages USING 'E'
                                   w_pn
                                   w_batch2
                                   w_werks
                                   ' '
                                   w_msgno.

FORM store_messages USING p_msgty
                          p_msgv1
                          p_msgv2
                          p_msgv3
                          p_msgv4
                          p_txtnr.
  IF p_msgty EQ 'E'.
    w_err_fg = 'X'.
  ENDIF.
* Store the messages to be displayed
  CALL FUNCTION 'MESSAGE_STORE'
    EXPORTING
      arbgb                  = 'ZCCH001'
      msgty                  = p_msgty
      msgv1                  = p_msgv1
      msgv2                  = p_msgv2
      msgv3                  = p_msgv3
      msgv4                  = p_msgv4
      txtnr                  = p_txtnr
    EXCEPTIONS
      message_type_not_valid = 1
      not_active             = 2
      OTHERS                 = 3.

ENDFORM.                    " STORE_MESSAGES

"at lsat call the below function module to show the messages ata time..
* Display all the messages together on a pop up
  CALL FUNCTION 'MESSAGES_SHOW'
    EXPORTING
      show_linno         = ' '
    IMPORTING
      e_exit_command     = wa_exit_command
    EXCEPTIONS
      inconsistent_range = 1
      no_messages        = 2
      OTHERS             = 3.

Regards,

Prabhudas

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question