‎2008 Apr 24 11:03 AM
Hello gurus,
I have 2 select options in my slection screen.Both r mandatory fields.
1)purchasing organisation-ekorg
2)Plant(werks)
If i enter ekorg and werks.
if the werks entered is not in the entered ekorg then raise an error message saying no werks in the entered ekorg.
how can i validate this??
Thanks in advance...
‎2008 Apr 24 11:07 AM
Hi Madan,
in at selection screen event write below code.
at selection screen on ekorg.
if not werks in ekorg
message e001 'werks entered is not in ekorg'.
endif.
Regards,
Koti.
‎2008 Apr 24 11:08 AM
HI Madana,
IN the at selection-screen . section
use the function module:
ME_CHECK_EKORG_FOR_PLANT
Regards,
Ravi Kanth Talagana
‎2008 Apr 24 11:13 AM
Hi,
Just copy the following code as it is.
TABLES: t001w, tvko.
DATA: w_firsttime(1) VALUE 'Y'.
*
SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE text-000.
*
SELECT-OPTIONS: s_werks FOR t001w-werks,
s_vkorg FOR tvko-vkorg obligatory.
SELECTION-SCREEN END OF BLOCK 1.
*
AT SELECTION-SCREEN.
*
Loop at s_werks.
*
*Select Single * from t001w where werks = s_werks-werks.
If t001w-vkorg IN s_vkorg.
Else.
Message e999(znov) with 'Error Mess'.
Endif.
Endloop.
I hope this helps,
Regards
Raju Chitale
‎2008 Apr 24 11:16 AM
hi,
at selection screen on ekorg.
select single ekorg from <dbtab> ... where ekorg in select-option9ekorg.
if sy-sybrc <> o.
....error message.
endif.
regards,
chandu
‎2008 Apr 24 11:19 AM
Hi,
check th code
at selection-screen on ekorg.
select single werks
from t001w
where werks in s_werks
and ekorg in s-ekorg.
if sy-subrc ne 0.
message e0002(zmesclass) 'plant doesnot exist for ekorg'.
. ENDIF.
.Regards,
Raj.