‎2007 Jun 29 6:24 AM
i hav got a requirement where i get character varaible( but it wil be a number) as input and i am required to check if its a 8 digit or 9 digit number, according to which i need to select data from diff tables.
how can i go abt this?
‎2007 Jun 29 6:28 AM
Hi,
u can do like this.
data:num(3),var(10) value 'name'.
num = strlen( var ).
write:/ num.
rgds,
bharat.
‎2007 Jun 29 6:26 AM
Hi balaji,
DESCRIBE FIELD <f> [LENGTH <l>] [TYPE <t> [COMPONENTS <n>]]
[OUTPUT-LENGTH <o>] [DECIMALS <d>]
[EDIT MASK <m>] [HELP-ID <h>].
DATA: float TYPE f,
out TYPE i,
len TYPE i.
DESCRIBE FIELD float LENGTH len OUTPUT-LENGTH out.
Reward if useful!
‎2007 Jun 29 6:27 AM
Hi,
Use code as below :
data : len type i, amt(13).
amt = '11223429'.
len = strlen( amt ).
If len eq 8.
select .............
elseif len eq 9.
select.............
endif.
Regards,
Sandeep Kaushik
‎2007 Jun 29 6:27 AM
Use the following code.
data: len type i.
len = strlen( that input field ).
Kishi.
‎2007 Jun 29 6:28 AM
Hi,
u can do like this.
data:num(3),var(10) value 'name'.
num = strlen( var ).
write:/ num.
rgds,
bharat.
‎2007 Jun 29 6:28 AM
Hi Balaji,
Calculate its length using STRLEN . This might help u in knowing the the no of disgits.
Hope this is useful to u.
Rewards points if useful.
Regrds,
Vijayakumar V
‎2007 Jun 29 6:30 AM
hi,
1 .declare the variable 'X' of type string.
2. assign len = strlren(X) where len is of type i.
then u can chk the variable len to get the length of th variabke.
Regards,
viji
‎2007 Jun 29 6:32 AM
data : field1 type (string /c/n/i ) ,
field2 type n .
field2 = Strlen(field1) .so that the <b>field2</b> will have lenght of the<b> field1</b> .
reward points if it is usefull ..
Girish