2007 Sep 16 12:38 PM
Hello All,
I need to validate the input given from format XXXXXXXXXX to XXX-XXX-XXXX.The system should take <b>only digits</b> and it should <b>not allow user to enter more than 10 digits</b>.Please help me in reaching the above requirements.
Also please tell me whether can I write my code after PAI.Does writing code like this validates the input given or where should i write my code..........Please suggest
2007 Sep 17 4:13 AM
In the PAI, write
CHAIN.
FIELD V_INPUT. "mention here the field name instead of V_INPUT
MODULE VALIDATE_INPUT.
ENDCHAIN.
MODULE VALIDATE_INPUT.
data : l_len type i,
l_counter type i.
l_len = strlen(V_INPUT).
if l_len gt 10.
message 'Invalid INput!'.
endif.
do.
l_var = v_input+l_counter(1).
if l_var lt 0 or l_var gt 10.
message 'Invalid Input!'.
endif.
l_counter = l_counter + 1.
if l_counter gt 10.
exit.
endif.
enddo.
ENDMODULE.
Hello All,
I need to validate the input given from format XXXXXXXXXX to XXX-XXX-XXXX.The system should take <b>only digits</b> and it should <b>not allow user to enter more than 10 digits</b>.Please help me in reaching the above requirements.
Also please tell me whether can I write my code after PAI.Does writing code like this validates the input given or where should i write my code..........Please suggest
2007 Sep 17 4:13 AM
In the PAI, write
CHAIN.
FIELD V_INPUT. "mention here the field name instead of V_INPUT
MODULE VALIDATE_INPUT.
ENDCHAIN.
MODULE VALIDATE_INPUT.
data : l_len type i,
l_counter type i.
l_len = strlen(V_INPUT).
if l_len gt 10.
message 'Invalid INput!'.
endif.
do.
l_var = v_input+l_counter(1).
if l_var lt 0 or l_var gt 10.
message 'Invalid Input!'.
endif.
l_counter = l_counter + 1.
if l_counter gt 10.
exit.
endif.
enddo.
ENDMODULE.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |