‎2008 Mar 10 10:52 AM
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.
‎2008 Mar 10 10:56 AM
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 ...
‎2008 Mar 10 10:56 AM
‎2008 Mar 10 10:56 AM
Use FM MESSAGE_TEXT_BUILD to generate the message using the details in i_messages
‎2008 Mar 10 11:03 AM
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.