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: 
Read only

Select options validation in selection screen

Former Member
0 Likes
740

Hi all,

I have select options for plant in selection screen..I want to validate the Plants. and display the invalid plants in the selection screen itself....Since my report is for online purpose i am in need of this requirement...i dont want to print or display the invalid plants as output of the report..

Is thaee any way to achieve this...please help.

points will be rewareded definetely if problem gets solved by your solution.

Thanks in advance..

4 REPLIES 4
Read only

Former Member
0 Likes
572

Hi,

You can do this in at selection-screen event.


at selection-screen.

if plant[] is initial.

"write select statement to get only valid plant

elseif not plant[] is initial.

"write select statement and filter out the invalid plants.

endif.

]

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
572

Hello Hema,

You can do the validation like this.


AT SELECTION-SCREEN ON SO_WERKS.
IF not SO_WERKS[] is initial.
select * from t001w into table where werks in so_werks.
if sy-subrc ne 0.
Message E999(HH) With 'The enetered palnt is not valid.'
endif.
endif.

Cheers,

Vasanth

Read only

Former Member
0 Likes
572

Hi

AT SELECTION-SCREEN ON S_WERKS.

PERFORM F_CHECK_PLANT USING TEXT-024.

FORM F_CHECK_PLANT USING P_TEXT_004.

IF S_WERKS IS NOT INITIAL.

DATA: LV_WERKS TYPE WERKS_D.

SELECT SINGLE WERKS

INTO LV_WERKS

FROM T001W

WHERE WERKS IN S_WERKS.

IF SY-SUBRC <> 0.

CLEAR S_WERKS.

MESSAGE E000 WITH P_TEXT_004 "(Plant does not exist)

ENDIF.

CLEAR LV_WERKS.

ENDIF.

ENDFORM. " F_CHECK_PLANT

Reward if useful

Narendra

Read only

Former Member
0 Likes
572

Hi,

let p_plant be ur parameter

at selection-screen on p_plant.
tables T001W.
select single * from T001W where werks = p_plant. 
if sy-subrc is not initial.
message 'Plant does not exist' type'E'.
endif.