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

At Selection Screen

Former Member
0 Likes
615

Hi Experts,

i have selection screen like this

SELECT-OPTIONS: S_WERKS LIKE MSEG-WERKS,

S_LGORT LIKE MSEG-LGORT.

How will validate this one.

i have plants 1110, 1220, 1310, 1210, 1310, 1210, 1120, 1130, 1410.

Storage locations are 1222, 1224,1225,1226,1227.

i need this plants & storage locations only.

Thanks & Regards,

Sreedhar.

5 REPLIES 5
Read only

Former Member
0 Likes
547

Hi create an itab for a plant with the required values in INITIALISATION event

& AT SELECTION SCREEN, u can check the values of select options

Sandeep

Reward if helpful

Read only

Former Member
0 Likes
547

Hi

Declare first

tables: t001w, t001l.

SELECT-OPTIONS: S_WERKS LIKE t001w-WERKS,

S_LGORT LIKE t001l-LGORT.

in AT selection Screen write the code:

  • Validation of Plant

clear t001w.

if not s_werks is initial.

select werks from t001w up to 1 rows

into t001w-werks

where werks in s_werks.

endselect.

if sy-subrc ne 0.

message e004. " Invalid Plant Number

endif.

endif.

  • Validation of Storage Location

clear t001l.

if not s_lgort is initial.

select lgort from t001l up to 1 rows

into t001l-lgort

where lgort in s_lgort.

endselect.

if sy-subrc ne 0.

message e004. " Invalid Storage Location Number

endif.

endif.

reward if useful

regards,

Anji

Read only

former_member404244
Active Contributor
0 Likes
547

Hi ,

First of all change the syntax..

SELECT-OPTIONS: S_WERKS for MSEG-WERKS,

S_LGORT for MSEG-LGORT.

U can validate at selection screen event.

at selection-screen.

select werks from mseg into v_werks up to 1 rows

where werks in s_werks.

endselect.

if sy-subrc ne 0.

throw error message.

endif.

Regards,

Nagaraj

Read only

Former Member
0 Likes
547

Hi Sreedhar,

Initially, push this plants and storage location inot the separate internal tables.

Say for example t_plants and t_storage.

AT SELECTION-SCREEN.

SELECT WERKS

FROM MSEG

INTO fs_mseg

WHERE s_werks IN t_plants.

IF sy-subrc NE 0.

MESSAGE 'Enter valid plant' TYPE 'E'.

ENDIF.

If it works fine,if not it is must and should to write the logic..

Regards,

V.Raghavender.

Read only

Former Member
0 Likes
547

HI..

at selection-screen.

if S_WERKS ne 1110 or

S_WERKS ne 1220 or.....1410.

message 'invalid werks' type 'E'.

endif.

if S_LGORT ne 1222 or ......, 1224,1225,1226,1227.

message 'invalid lgort' type 'E'.

endif.