02-27-2009 10:07 AM
Dear all
I need help i am using C14W_NUMBER_CHAR_CONVERSION FM to convert the floating vale to Character but i am getting run time error. coz it is not converting BIG values. I need to convert 9.9999999990000000E+09 this value to 9999999999.0000 any other simple way or any other FM is available plz help me anybody to resolve this issue.
Regards
ACJ
02-27-2009 10:10 AM
Use FM FLTP_CHAR_CONVERSION
CALL FUNCTION 'FLTP_CHAR_CONVERSION'
EXPORTING
DECIM = '3'
* EXPON = 0
INPUT = WA_PLMK-TOLERANZOB
* IVALU = ' '
* MASKN = ' '
IMPORTING
FLSTR = V_UPPER
02-27-2009 10:16 AM
when i am running the FM in SE37 i am not getting the result in FLSTR variable.
it is giving as 9.9999999990000000E 09.
But i want this 9999999999.0000
why it is not coming.
02-27-2009 10:50 AM
same variable i am passing to get the result what your used in the example i am getting null value FLSTR.
02-27-2009 10:12 AM
02-27-2009 10:17 AM
ACJ,
try with 'CHAR_FLTP_CONVERSION' FM
data F type F.
data C(20) type C value '9.99E-10'.
Call function 'CHAR_FLTP_CONVERSION'
exporting string = C
importing flstr = F.
Best Regards,
Syf
Edited by: syfulla shaik on Feb 27, 2009 3:49 PM
02-27-2009 10:22 AM
i am not getting dear in which variable i need to pass the value
actually i ll pass two variable one is floating point value another is number of deceimal.
02-27-2009 10:35 AM
Check this sample code.
DATA:
w_float TYPE atflv value '9.9999999990000000E+09',
w_char(20).
WRITE:
w_float TO w_char EXPONENT 0 DECIMALS 4.
CONDENSE w_char NO-GAPS.
WRITE:
w_char. " 9999999999.0000
Regards
Adil
02-27-2009 10:40 AM
Adil i need to convert the value from internal table i cant do HOT code for that any FM is a beter way i think so
actually i used the C14W_NUMBER_CHAR_CONVERSION FM
it is giving exact result up to 999999999.0000 only after next 9 it is giving run time eroor all other also i tried but i am not getting.
02-27-2009 10:50 AM
Check this sample code,
DATA:
w_float TYPE atflv VALUE '9.9999999990000000E+09',
w_char(20).
CALL FUNCTION 'FLTP_CHAR_CONVERSION_FROM_SI'
EXPORTING
char_unit = 'EA'
unit_is_optional = 'X'
decimals = 4
exponent = 0
fltp_value_si = w_float
indicator_value = 'X'
masc_symbol = '_'
IMPORTING
char_value = w_char
EXCEPTIONS
no_unit_given = 1
unit_not_found = 2
OTHERS = 3.
CONDENSE w_char NO-GAPS.
WRITE:
w_char. " 9999999999.0000
Regards
Adil
02-27-2009 10:56 AM
no i am not getting just run the same FM in SE37 by passing the values you will come to know.
02-27-2009 10:56 AM
hi,
use
call function 'MC_FLTP_CHAR'
exporting
fc_a_fld = wa_qamv-toleranzun " ur floating variable
importing
fc_r_fld = l_v_low. " ur string variable
кu03B1ятu03B9к
02-27-2009 10:59 AM
Dear karthik
How can i get deceimal points in that.
Decimal points also required right?
02-27-2009 11:10 AM
check in se37 if the fm provides u option of specifying decimal points i am not on sap system now to check it.
кu03B1ятu03B9к
02-27-2009 11:14 AM
NO i tried that there is no option to pass the decimal point i think so.
02-27-2009 11:21 AM
Dear Karthik
I am not getting exact result it is giving in program only 4 Character in FM they Declared Output variable as CHAR10.
and decimal point also required this is for Inspection PLAN QP03 Draft Print.
02-27-2009 11:34 AM
Any other idea to get the result by using FM MC_FLTP_CHAR i am getting the value but i should get the decimal points also.
02-27-2009 11:01 AM
To test, copy the code in SE38 and execute it. you will see the expected result.
02-27-2009 11:53 AM
You can try this Function module.
Check this Function module 'QSS0_FLTP_TO_CHAR_CONVERSION' in SE37
or Run the below code in SE38
DATA:
w_float TYPE qsollwerte VALUE '9.9999999990000000E+09',
w_char TYPE qsollwertc.
CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'
EXPORTING
i_number_of_digits = 4
i_fltp_value = w_float
i_value_not_initial_flag = 'X'
i_screen_fieldlength = 16
IMPORTING
e_char_field = w_char.
WRITE:
w_char. " 9999999999.0000
Regards
Adil
02-27-2009 12:20 PM
Thanks Adil
It Is ok Itseems
I am getting correct Result.
I ll implement live and will see.
Thanks lot.
Reagrds
ACJ