On selection screen, I want to display a status message if the data is not found from the values the user entered. I wrote the following coding. I am able to get the message but it is coming out in the output rather than on the selction screen itself. Can you tell me what correction I can make to get the desired result?
IF p_vbeln IS not INITIAL.
SELECT vbeln erdat FROM vbak
INTO CORRESPONDING FIELDS OF TABLE itab_vbeln
WHERE vbeln = p_vbeln.
IF sy-subrc <> 0.
MESSAGE s004(zer) WITH 'No data found'.
Thank you very much,