2006 Sep 25 11:04 AM
Hi all,
My selection screen contains 3 fields say for eg area,subarea and plant .If i enter area and plant which is not there in database table if i execute the program,a popup window should come on the selection-screen saying tht the data does not exits and if i select the tick mark on the popup window it should be on the selection screen itself.How to do this.Pls explain with a help of a source code .
2006 Sep 25 11:08 AM
Hi alex,
Simple
1. The main things are
a) use START-OF-SELECTION event
b) use LEAVE LIST-PROCESSING
2. like this
3.
START-OF-SELECTION.
IF <ERROR CONDITION>.
MESSAGE 'NO DATA FOUND' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.
4.
Note:
a) Give message type I,S etc (and not E)
b) use leave list-processing, so that
the system does not go further,
and remains there itself on the selection screen.
regards,
amit m.
2006 Sep 25 11:08 AM
Hi alex,
Simple
1. The main things are
a) use START-OF-SELECTION event
b) use LEAVE LIST-PROCESSING
2. like this
3.
START-OF-SELECTION.
IF <ERROR CONDITION>.
MESSAGE 'NO DATA FOUND' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.
4.
Note:
a) Give message type I,S etc (and not E)
b) use leave list-processing, so that
the system does not go further,
and remains there itself on the selection screen.
regards,
amit m.
2006 Sep 25 11:08 AM
Lets say your data is selecting into ITAB table,then
you can do like,
if ITAB[] is initial.
MESSAGE I000 WITH 'no data selected'.
STOP.
endif.
to display a message just you can use MESSAGE.
you can create a message in SE91.
the same you can use in the programs like,
MESSAGE I000(ZMSG) WITH 'NO DATA SELECTED'.
2006 Sep 25 11:08 AM
hi Alex,
You can achieve the same in multiple way ... one making use of message statement and the other with the helps of FM 'POPUP_TO_CONFIRM'. make use either of them ..
Regards,
Santosh
2006 Sep 25 11:09 AM
Hi,
You can code your conditions in At selection screen event, When ever condition is not satisfied
raise message of type i or use function module popup_to_inform and for leaving the program and remaining on selection screen you can use leave list-processing.
Hope this helps.
2006 Sep 25 11:14 AM
hi,
u can give message type 'I'.
<b>example</b> :
tables t001w.
parameters : p_werks like t001w-werks.
p_lgort like t00l-lgort.
at selection-screen.
select single * from t001w where werks = p_werks.
if sy-subrc ne 0.
message id '00' type 'I' number '058' .
else.
write : / 'ok'.
endif.
reward if useful...
2006 Sep 25 11:40 AM
Hi,
use below logic
PARAMETERS: P_VARI LIKE RSVAR-VARIANT DEFAULT '/DEFAULT'.
AT SELECTION-SCREEN.
IF P_VARI IS INITIAL.
CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
EXPORTING
TEXTLINE1 = 'Invalid entry'
TEXTLINE2 = WSC-DECISION_TEXT2
TITEL = '??? DECISION TIME ???'
IMPORTING
ANSWER = LV_ANSWER.
IF LV_ANSWER = 'J'.
ENDIF.
ENDIF.
Regards
amole
2006 Sep 25 11:43 AM
at selection-screen.
if area is <> ''.
select area into zarea from <tablename>
where area = area.
if sy-subrc <> 0.
message i(zclass).
leave list processing.
endif.
endif.