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: 

reports

Former Member
0 Kudos
179

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 .

1 ACCEPTED SOLUTION

Former Member
0 Kudos
136

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.

7 REPLIES 7

Former Member
0 Kudos
137

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.

Former Member
0 Kudos
136

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'.

Former Member
0 Kudos
136

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

Former Member
0 Kudos
136

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.

Former Member
0 Kudos
136

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...

Former Member
0 Kudos
136

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

Former Member
0 Kudos
136

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.