‎2009 Oct 05 2:17 PM
Hi guys,
I have to write a error message if after entering data in the selection screen i have no data, something like this:
if ti_data[] is not initial.
perform show_report.
else.
message e002(z_mensajes).
endif.
But, if ti_data IS INITIAL, I have to come back to the selection screen, how I can do that? I see an empty page and the error message.
Thanks
Gabriela.
‎2009 Oct 05 2:22 PM
Try this,
if ti_data[] is not initial.
perform show_report.
else.
message e002(z_mensajes).
exit. " add this
endif.
‎2009 Oct 05 2:21 PM
I did it this way. Does it fit with your requirement?
at selection-screen.
if p_x = 'E'.
message s000(ZMSG) with 'dodgy value in param'.
stop.
endif.
‎2009 Oct 05 2:22 PM
Try this,
if ti_data[] is not initial.
perform show_report.
else.
message e002(z_mensajes).
exit. " add this
endif.
‎2009 Oct 05 2:29 PM
Hi guys,
I forgot to tell you, that I have that code un the END-OF.SELECTION event.
START-OF-SELECTION.
select * into corresponding fields of ti_vuelos
from ztabla_vuelos
where carrid eq p_carrid and
connid in s_carrid and
countryfr eq p_country.
check sy-subrc eq 0.
END-OF-SELECTION.
IF ti_vuelos[] IS NOT INITIAL.
PERFORM show_report.
ELSE.
MESSAGE e004(z_gabriela).
EXIT.
ENDIF.
I tried with EXIT, but is not working.
What I can do? I have to return to the selection screen after the error message in order to enter new values.
Thanks.
Gaby
‎2009 Oct 05 2:39 PM
Hi,
Try to use like this without the message class
START-OF-SELECTION.
select * into corresponding fields of ti_vuelos
from ztabla_vuelos
where carrid eq p_carrid and
connid in s_carrid and
countryfr eq p_country.
check sy-subrc eq 0.
END-OF-SELECTION.
IF ti_vuelos[] IS NOT INITIAL.
PERFORM show_report.
ELSE.
MESSAGE 'Error message' TYPE 'S' DISPLAY LIKE 'E'.
EXIT.
ENDIF.
‎2009 Oct 05 2:43 PM
IT WORKED!!
Thank you Vinkranth!
I wrote this:
MESSAGE 'Error message' TYPE 'S' DISPLAY LIKE 'E'.
Thak you very much!
Gaby
‎2009 Oct 05 2:24 PM
Hi,
try:
CALL SELECTION-SCREEN ....
or
leave screen
Regards
Nicole
‎2009 Oct 05 2:32 PM
HI,
Try like this.
if ti_data[] is not initial.
perform show_report.
else.
message I002(z_mensajes).
LEAVE LIST-PROCESSING.
endif.
Regards,
Nagaraj
‎2009 Oct 05 2:36 PM
Hi Nagaraj,
Not working yet, I mean, If I write an information message, works, but I need an error message and then return to the selection screen.
Thanks anyway!
‎2009 Oct 05 2:45 PM
hI,
we do give error messages when we want to validate the selection screen fields .Once we enter the data and then execute , for the data retrieval part if we don't get any records we give information message and go back to selection screen.error message won't work as it blanks the screen. Hence i suggested for information message
else try this
if ti_data[] is not initial.
perform show_report.
else.
MESSAGE 'No DATA ' TYPE 'S' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
endif.
Regards,
Nagaraj
‎2009 Oct 05 2:51 PM