‎2007 Apr 17 6:27 AM
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.
‎2007 Apr 17 6:31 AM
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
‎2007 Apr 17 6:31 AM
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
‎2007 Apr 17 6:34 AM
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
‎2007 Apr 17 6:40 AM
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.
‎2007 Apr 17 6:41 AM
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.