2007 Mar 05 4:45 PM
How Do Everyone!
I have a currency amount say 144.66 and I want to insert leading zeroes.
I want to convert it to say 000000144.66
I have used the FM CONVERSION_EXIT_ALPHA_INPUT but because
there is a decimal point in the number it is not quite working.
Any ideas anyone??
Cheers
Andy
2007 Mar 05 4:59 PM
Hi,
Please try this.
DATA: P TYPE P DECIMALS 2 VALUE '144.66'.
DATA: N(12) TYPE C.
N = P.
SHIFT N RIGHT.
TRANSLATE N USING ' 0'.
WRITE:/ N.Regards,
Ferry Lianto
How Do Everyone!
I have a currency amount say 144.66 and I want to insert leading zeroes.
I want to convert it to say 000000144.66
I have used the FM CONVERSION_EXIT_ALPHA_INPUT but because
there is a decimal point in the number it is not quite working.
Any ideas anyone??
Cheers
Andy
2007 Mar 05 4:49 PM
2007 Mar 05 4:51 PM
You could move it to a type C field and use
overlay <field> with '0000000000'.
2007 Mar 05 4:57 PM
Hi,
Try this..
data: p_1 type p decimals 2.
data: p_2(16).
p_1 = '144.66'.
p_2 = p_1.
translate p_2 using ' 0'.
write: / p_2.
Thanks,
Naren
2007 Mar 05 4:59 PM
Hi,
Please try this.
DATA: P TYPE P DECIMALS 2 VALUE '144.66'.
DATA: N(12) TYPE C.
N = P.
SHIFT N RIGHT.
TRANSLATE N USING ' 0'.
WRITE:/ N.Regards,
Ferry Lianto
2007 Mar 05 5:01 PM
try this...
data: v_test(16) type p decimals 2,
v_test1(19).
v_test = '000000144.66'.
write v_test.
v_test1 = v_test.
overlay v_test1 with '000000'.
condense v_test1 no-gaps.
write:/ v_Test1.
award points if it helps.
2007 Mar 05 5:05 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |