‎2008 Jul 26 6:03 AM
Hi all
I have a requirement such that the user has to enter only the multiples of 10....like 10,20,30,40,50...If he enters 1,2,3,5,6, or anything that is not a multiple of 10.I need to give a error message.I wud be happy if u can write logic below.Please let me know.How to?
Vijay
‎2008 Jul 26 6:40 AM
Hi,
Write this way-
Parameters:
p_num type i.
Data: w_num type i.
At SELECTION-SCREEN.
w_num = p_num MOD 10.
If w_num NE 0. "Error
Message 'Wrong Entry' Type 'E'.
Endif.
START-OF-SELECTION.
Write: P_num.
Regards,
Sujit
‎2008 Jul 26 6:40 AM
Hi,
Write this way-
Parameters:
p_num type i.
Data: w_num type i.
At SELECTION-SCREEN.
w_num = p_num MOD 10.
If w_num NE 0. "Error
Message 'Wrong Entry' Type 'E'.
Endif.
START-OF-SELECTION.
Write: P_num.
Regards,
Sujit
‎2008 Jul 26 7:12 AM
Hi,
Let your field of input be p_input.
So you have to set validation condition on this field in AT SELECTION-SCREEN ON p_input event. follow the code
Parameters:
p_input type i.
Data:
w_rem type i.
AT SELECTION-SCREEN on p_input.
w_rem = p_input MOD 10.
If w_num NE 0. " that is not a multiple of 10
Message 'Enter only multiple of 10'Type 'E'.
Endif.
then go with your logic.
Regards,
anirban
‎2008 Jul 26 7:18 AM
Hi,
do it this way,
Parameters: field type i.
data:
w_field type i.
w_field = p_field mod 10.
at selection-screen on field.
if w_field <> 0.
message..........'enter mutiply og 10'.
endif.with luck,
Pritam.
‎2008 Jul 29 9:08 PM
Vijay,
Please stop double-posting between ABAP General and ABAP Dictionary!
It is against [the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
Cheers,
Julius