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

validation

Former Member
0 Likes
696

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...

5 REPLIES 5
Read only

Former Member
0 Likes
647

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.

Read only

Former Member
0 Likes
647

HI Madana,

IN the at selection-screen . section

use the function module:

ME_CHECK_EKORG_FOR_PLANT

Regards,

Ravi Kanth Talagana

Read only

Former Member
0 Likes
647

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

Read only

Former Member
0 Likes
647

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

Read only

Former Member
0 Likes
647

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.