07-05-2006 9:03 AM
Hi i have a variable of type packed decimal whose value is 1.1. I move this value into a variable of type char length 6 and when i display, it displays 1.1, i want it to be displayed as 0001.1 How can i do that?
07-05-2006 9:08 AM
Hi
Pass the decimal value to variable quant type char6
quan1 type char4
quan2 type char2.
split quan at '.' into quan1 quan2.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = quan1
IMPORTING
OUTPUT = quan1.
concatenate quan1 quan2 into quant separated by '.'.
This should solve it
Message was edited by: Dominic Pappaly
07-05-2006 9:05 AM
Hi Kantheri,
<b>Use TYPE N variable and assign packed decimals value to this.</b>
DATA V_PDEC TYPE P DECIMALS 1 VALUE '1.1'.
DATA V_LNUM(4) TYPE N.
V_LNUM = V_PDEC.
WRITE:/ V_LNUM. <b>--->0001</b>
Thanks,
Vinay
07-05-2006 9:13 AM
Hi ,
you can use his FM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_var
IMPORTING
OUTPUT = lv_var
.
Regards,
Sumit.
07-05-2006 9:05 AM
07-05-2006 9:06 AM
07-05-2006 9:08 AM
Hi
Pass the decimal value to variable quant type char6
quan1 type char4
quan2 type char2.
split quan at '.' into quan1 quan2.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = quan1
IMPORTING
OUTPUT = quan1.
concatenate quan1 quan2 into quant separated by '.'.
This should solve it
Message was edited by: Dominic Pappaly
07-05-2006 9:37 AM