‎2008 Feb 05 10:54 AM
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..
‎2008 Feb 05 10:57 AM
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.
‎2008 Feb 05 10:57 AM
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
‎2008 Feb 05 10:57 AM
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
‎2008 Feb 05 11:05 AM
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.