‎2007 Jul 24 12:56 PM
Hello all,
I have one structure field AVG Data type is CHAR(25) .
In my program i took one local variable GV_AVG type F.
whwn i am trying to store the GV_AVG value into AVG It Stores like 1.23E+00
so My problem is i don't want that E+00 only 1.23.
would u please help me how can i solve this?
‎2007 Jul 24 12:58 PM
Hi,
First assign the value to NUMC(25) and then assing that to CHAR(25).
I think if you use NUMC you will loose '.'
One think you can do is use the command FIND to find 'E' and then you will get the position of it in sy-fdpos.
Then use it and extract the daya from you CHAR as follows
FIND 'E' in CHAR1.
if sy-subrc = 0.
CHAR1 = CHAR1+0(sy-fdpos).
endif.
Regards,
Sesh
‎2007 Jul 24 12:59 PM
hi Vandana,
Use conversion_exit_alpha_input FM.
reward if help ful.
any querry reply.
Azad.
‎2007 Jul 24 1:01 PM
Hi,
Check floating point checks in the attributes section..
Regards,
omkar.
‎2007 Jul 24 1:03 PM
There is no fm for that, but you can use this syntax.
DATA: X TYPE P VALUE '123456789E2'.
WRITE: /X EXPONENT 0, "output: 12345678900,000000
/X(10) EXPONENT 0, "output: 1,235E+10
/X EXPONENT 3, "output: 12345678,90000000E+03
/Y EXPONENT -3, "output: 12345678900000,00E-03
/Y EXPONENT 9, "output: 12,34567890000000E+09
/Y EXPONENT 2
/Y DECIMALS 4. "output: 123456789,0000E+02
If you use exponent 0, you will get the numeric equivvalent of the scientific representation.
~ As found in forum
Regards,
Amit
Reward all helpful replies.