2012 Dec 15 6:14 PM
I'm unsure of how to validate an input parameter that has this format: xxxx-xxxxxx-xxxxx where 'x' are numbers with the first 'x' being the number 3. So the user has to input '3' first followed by any numbers while '-'s are included in their respective placement in the format in order for my program to accept the data input.
Hi mark...
if am correct you are askin how to validate every input user enters..am not clear about my answer but you could go a try..
make a feild for every 'X'
for eg:
field1 field2 field3 field4 for "XXXX"
NOW,WHEN EVER THE USER ENTER THE VALUE,IN THE PAI CHECK FOR THE VALUE WITH YOU WANT.
EG:
if Field1 = 3.
if sy-subrc = 0.
if field2 = 4
etc.
2012 Dec 15 6:37 PM
You will have to extract each character and validate it. You can use a DO_WHILE loop inside which you can use offsets to get each character.
2012 Dec 17 7:00 PM
Hi mark...
if am correct you are askin how to validate every input user enters..am not clear about my answer but you could go a try..
make a feild for every 'X'
for eg:
field1 field2 field3 field4 for "XXXX"
NOW,WHEN EVER THE USER ENTER THE VALUE,IN THE PAI CHECK FOR THE VALUE WITH YOU WANT.
EG:
if Field1 = 3.
if sy-subrc = 0.
if field2 = 4
etc.
2012 Dec 17 7:36 PM
Hi Mark,
You could do this in a number of different ways. One possibility is to check that...
input(1) = '3'.
and that...
input+5(1) = '-' and input+12(1) = '-'.
Then you could remove these two '-' characters from input and check that all that is left are digits.
input CO '0123456789'.
Or if you wanted to get fancy, you could use a regular expression to validation the string.
Cheers,
Amy
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |