on 07-22-2005 5:22 PM
Hi,
I need to do a numeric(divide) operation with larger decimal value. I have given the example below.
var1 = 12345678 ( 8 digits )
Var2 = 98765432 ( 8 digits )
I want to store the above numbers in a variable,
CONCATENATE var1 "." Var2 INTO var3.
var3 = "12345678.98765432"
var4 = var3 / 1000 ( this 1000 is variable between 1 to 100000000 )
var4 = "12345.67898765432"
and then I need to pick 4 digits before decimal and 5 digits after decimal and Post IDoc for Exchange Rate.
Final output needed = "2345.67898"
I am stuck in this place, TYPE P data store only 16 characters.
Please suggest a solution in this case.
Thanks,
Sivanandham.P
Hi
u can maintain one character type variable then move the values into the type p variable.try this it will work out.i had an exp. on this
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try type F (Float). Declare all variable of type float.
Thanks
Vinod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for your suggesstion, But TYPE F saves the data as "123.34000E+02" format.
But i want to store the data in the exact format as mentioned below, please suggest a idea on how to proceed with this, I am really stuck at this point
Data to be stored : "12345678.98765432"
Thanks,
Sivanandham.P
you could try FM
MURC_ROUND_FLOAT_TO_PACKED to convert the float.
data: a type float ,
b type p decimals 10 .
a = '123.34000E+02' .
CALL FUNCTION 'MURC_ROUND_FLOAT_TO_PACKED'
EXPORTING
if_float = a
IF_SIGNIFICANT_PLACES = 10
IMPORTING
EF_PACKED = b
EXCEPTIONS
OVERFLOW = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
Raja
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.