2007 Feb 13 3:02 PM
hi to all,
help me inthis issue
amount2 = 860.851,00 i want to divide it by 100 for jpy currency
but when i keep above amount1 = amount2 / 100.
it is going to dump.
thanks in advance
kiran reddy
2007 Feb 13 3:05 PM
hi
convert your char- value to a p-value
use fm prpare_string:
DATA digit(11) VALUE ' 0123456789'.
data: var(16) value '860.851,00'.
DATA var_new(16).
DATA s(2) VALUE ' 0'.
var_new = var.
CALL FUNCTION 'PREPARE_STRING'
EXPORTING
i_valid_chars = digit
i_xvalid_check = 'X'
i_xchar_repl = 'X'
i_xtoupper = 'X'
CHANGING
c_string = var_new.
CONDENSE var_new NO-GAPS.
amount2 = var_new / <b>10000</b>.
Message was edited by:
Andreas Mann
2007 Feb 13 3:07 PM
hi both the amount are of char type
thanks in advance
kiran reddy
2007 Feb 13 3:10 PM
amount2 <b>must</b> be a <b>numeric</b> if you want to use an arithmetic operation
regards Andreas
2007 Feb 13 3:18 PM
Hi Kiran,
System will not consider '860.851,00' as number because of comma. First you need to remove the commas & dots form it. then do the airthmetic operation.
e.g.:
amount3 = '860851.00'.
amount1 = amount3 / 100.
Ashven
2007 Feb 13 3:22 PM
Kiran,
Can you please let me know, why you are taking amount2 as character.
Thanks,
Sri.
2007 Feb 13 3:36 PM
the reason u r getting a dump is
'amount 2 is character 'valued as ' 860. 851,00'
. and , are not iterpreted as number
if u see the dump analysis in ST 22 it will be as
<b>not able to recognise '.' as number .</b>
i can divide that value with decimals only if its numeric format .
declare amount2 as currency format .
regards,
vijay.