2009 Oct 08 11:29 AM
Hi,
My requirement is in a table i have three fields - field1 , field2 and field3. If field1 is 'XX' then in that case alone field2 only should be filled.Field3 should not be filled. If field1 is not 'XX' then this validation need not happen and even field3 can be filled.
I have used event '05' for the same. I am able to do the validation correctly but the validation happens only if the "enter" key is pressed after entering field2. For exmaple : if the user enters "XX" for field1, presses tab and enters value for field2 presses tab again and enter values for field3 and then on pressing enter,the event gets triggered and my error message is displayed.
If the user presses "enter" after entering data in field2 and then uses tab to move to field3 and enters value the event does not get triggered and saving of data becomes possible. Is there any wya to restrict this?
2009 Oct 08 12:27 PM
Hello ,
instead of events , u can make use of field - modules
field bkpf-blart module blart.<<<< IN THAT module u can place same validations.
regards
Prabhu
2009 Oct 08 12:27 PM
Hello ,
instead of events , u can make use of field - modules
field bkpf-blart module blart.<<<< IN THAT module u can place same validations.
regards
Prabhu
2009 Oct 08 12:50 PM
in that form.
if dbtab-field1 eq 'XX'.
clear dbtab-field3.
if dbtab-field2 is initial.
message 'dbtab-field2 can be empty' type 'I'.
endif.
else.
clear dbtab-field2.
if dbtab-field3 is initial.
message 'dbtab-field3 can be empty' type 'I'.
endif.
endif.
2009 Oct 08 1:14 PM
Thanks Prabhu. Your solution works. I have written the code logic inside PAI.