10-17-2008 8:18 AM
Hi All,
lv_val = '21.45'.
how to read point( dot ) ?
i want to separate 21 and .45 ?
can u help me?
thanks,
srii.
10-17-2008 9:02 AM
Hi,
you have lv_val = '21.45'.
Try this to know th position of dot in 'lv_val'
**********************************
data: L_Length type i.
IF lv_val CS '.'.
L_Length = SY_FDPOS.
ENDIF.
now L_Length will have the position of Dot in lv_val.
Regards,
Syed
10-17-2008 8:22 AM
10-17-2008 8:22 AM
10-17-2008 8:22 AM
Hi
Try this
DATA : VAL1 TYPE CHAR10 VALUE '21.45',
PART1 TYPE CHAR05,
PART2 TYPE CHAR05.
SPLIT VAL1 AT '.' INTO PART1 PART2.
WRITE : / PART1,
PART2.
If your Input value is of type P you can do something like this..
DATA : VAL2 TYPE P decimals 2 VALUE '21.45',
VAL2_CHAR TYPE CHAR10,
PART1 TYPE CHAR05,
PART2 TYPE CHAR05.
VAL2_CHAR = VAL2.
CONDENSE VAL2_CHAR.
SPLIT VAL2_CHAR AT '.' INTO PART1 PART2.
WRITE : / PART1,
PART2.
Regards
Edited by: Rajvansh Ravi on Oct 17, 2008 9:28 AM
10-17-2008 8:23 AM
Hi,
Use the syntax 'Split' at '.' into a variabel...
for the correct syntax check F1 help..
regds,
M...
10-17-2008 8:54 AM
thanks for u replays and i will award the points.
lv_val = '214.5'.
how to read the dot posion?
for example: lv_val = 214.5 now the dot position is 3.
thank you,
srii.
10-17-2008 8:48 AM
Hi,
SPLIT lv_val AT '.' INTO lv_val1 lv_val2.
concatenate lv_val2 '.' into lv_val3.
Regards,
Suresh.
10-17-2008 9:02 AM
Hi,
you have lv_val = '21.45'.
Try this to know th position of dot in 'lv_val'
**********************************
data: L_Length type i.
IF lv_val CS '.'.
L_Length = SY_FDPOS.
ENDIF.
now L_Length will have the position of Dot in lv_val.
Regards,
Syed