on 02-10-2005 1:39 PM
Howdy,
I've got a program where i retrieve some data from the database and then I need to check if field BKPF-XBLNR has exactly 15 digits in it.
I've got no idea on how I would do this...
Can anyone help?
Thanking you kindly!
XBLNR is a character field. If you want to make sure all 15 positions have a digit and not some other character then use:
IF BKPF-XBLNR CO '0123456789'.
* OKAY, all 15 positions have digits
ELSE.
* NOT OKAY, at least one of the 15 is not a digit
ENDIF.
If you do not care what the characters are, then Rich has given you the solution but be aware that you could have embedded blanks, for example:
'ABCDEF GHIJK'
is length 15.
Message was edited by: Charles Folwell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the following code.
data: len type i.
len = strlen( BKPF-XBLNR ).
Regards,
Rich Heilman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.