2007 Sep 17 2:49 PM
i am using FM "CEVA_CONVERT_FLOAT_TO_CHAR" to convert 3.0000000000000000E+02 to 300 in my report. I am using this FM as below
<b>DATA: l_var TYPE p DECIMALS 2.
DATA: l_char(25).
LOOP AT i_cdpos .
IF i_cdpos-fname = 'ATFLV'.
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
float_imp = i_cdpos-value_old
format_imp = l_var
LEFT_IMP = ' '
round_imp = ' '
IMPORTING
char_exp = l_char
OVERFLOW_EXP =
.
ENDIF.
MOVE l_char TO i_cdpos-value_old.</b>
But it is not able to take i_cdpos-value_old (3.0000000000000000E+02 ) as a float as the value_old is a char field. Kindly help me
i am using FM "CEVA_CONVERT_FLOAT_TO_CHAR" to convert 3.0000000000000000E+02 to 300 in my report. I am using this FM as below
<b>DATA: l_var TYPE p DECIMALS 2.
DATA: l_char(25).
LOOP AT i_cdpos .
IF i_cdpos-fname = 'ATFLV'.
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
float_imp = i_cdpos-value_old
format_imp = l_var
LEFT_IMP = ' '
round_imp = ' '
IMPORTING
char_exp = l_char
OVERFLOW_EXP =
.
ENDIF.
MOVE l_char TO i_cdpos-value_old.</b>
But it is not able to take i_cdpos-value_old (3.0000000000000000E+02 ) as a float as the value_old is a char field. Kindly help me
2007 Sep 17 2:54 PM
Hi,
Please try this.
DATA: EXP TYPE ANZ_TAGE,
CHAR(16) TYPE P.
EXP = '3.0000000000000000E+02 '.
MOVE EXP TO CHAR.
WRITE: CHAR.
Regards,
Ferry Lianto
2007 Sep 17 2:57 PM
Thanks for ur quick reply . But i didn't understand one thing. Do i need to use the FM followed by ur code?...or no need of using FM now?
2007 Sep 17 3:01 PM
Hello,
Try like this.
DATA: CHAR1(30).
WRITE: FLOAT_VALUE TO CHAR1 EXPONENT 0 DECIMALS 3.
CONDENSE CHAR1 NO-GAPS.
Regards,
Vasanth
2007 Sep 17 3:01 PM
Hi,
No need FM, if you want to convert 3.0000000000000000E+02 to 300.
You just need to move to type p field without decimal.
Regards,
Ferry Lianto
2007 Sep 17 3:27 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |