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

Message with internal table

Former Member
0 Likes
475

Hi,

How am i gonna show the error generated here using the message class? Thanks a lot!

LOOP AT i_messages WHERE type = c_error.

*Show errors generated from i_messages

EXIT.

ENDLOOP.

4 REPLIES 4
Read only

Former Member
0 Likes
460

LOOP AT i_messages WHERE type = c_error.

*Show errors generated from i_messages

MESSAGE E000(<message class>) with i_messages-message1.

EXIT.

ENDLOOP.

<message class> is the message class you want to use ...

Read only

former_member188827
Active Contributor
0 Likes
460

message e001(zmessage_class).

Read only

Former Member
0 Likes
460

Use FM MESSAGE_TEXT_BUILD to generate the message using the details in i_messages

Read only

Former Member
0 Likes
460

Try using the below code to show the error message on the message screen.


p_screen = '0999'.

* set a default message of space in with three &&&
  IF v_msg_number = ' '.
    v_msg_id = 'OO'.
    v_msg_number = '000'.
  ENDIF.

  IF v_devty(5) = '16X20'.
    v_msg_line = 18.
    v_msg_nln  = 13.
  ELSE.
    v_msg_line = 40.
    v_msg_nln  = 4.
  ENDIF.

  v_msg_lang = sy-langu.

* error or message screen
  CALL FUNCTION 'CALL_MESSAGE_SCREEN'
    EXPORTING
      i_msgid          = v_msg_id
      i_lang           = v_msg_lang
      i_msgno          = v_msg_number
      i_msgv1          = v_msg_var1
      i_msgv2          = v_msg_var2
      i_msgv3          = v_msg_var3
      i_msgv4          = v_msg_var4
      i_message_screen = p_screen
      i_line_size      = v_msg_line
      i_lines          = v_msg_nln
      i_non_lmob_envt  = c_x
    IMPORTING
      o_answer         = v_msg_answ
    EXCEPTIONS
      OTHERS           = 99.