2009 Jun 02 7:58 PM
Hi friends,
i have a price ex: 3,45,444.98 ( this is based on the format which we set specific to country ).
it also could be 3.45.444,98 or 3 45 444,98 ( these are the possible 3 cases)
Now i want the above price to be converted to 345444.98 ( everytime, irrespective of above 3 cases ).
Is there any FM available which converts from 3,45,444.98 to 345444.98 ??
I cannot right a logic to build it because of the no of digits after decimals.
I have some countries which doenst have decimals. it may be like 3,45,444 ( no decimals ). so in this cases i cannot rgith custom logic.
pls respond,
RD
Hi friends,
i have a price ex: 3,45,444.98 ( this is based on the format which we set specific to country ).
it also could be 3.45.444,98 or 3 45 444,98 ( these are the possible 3 cases)
Now i want the above price to be converted to 345444.98 ( everytime, irrespective of above 3 cases ).
Is there any FM available which converts from 3,45,444.98 to 345444.98 ??
I cannot right a logic to build it because of the no of digits after decimals.
I have some countries which doenst have decimals. it may be like 3,45,444 ( no decimals ). so in this cases i cannot rgith custom logic.
pls respond,
RD
2009 Jun 02 8:02 PM
You may try with Menu options.
System -> User profiles -> Own data -> Defaults (Tab).
Thanks
Satya
2009 Jun 02 8:04 PM
try to move that to a floating variable and use FM to convert to character varaible and character to Packed variable with 2 decimals.
2009 Jun 02 8:07 PM
Jay,
canu pls explain what is the FM ?
also the last step u said to move it to 2 decimals - but there are cases wehre i have price which doenst have deciamls?
how to do this?
RD
2009 Jun 02 8:09 PM
I cannot user REpliace ',' or '.'.
Because if price is 3,45,444.98 , and i replce . with space, it will be 34544498 ( this is wrong).
Please see the test cases which i posted.. above..
thanks,
RD
2009 Jun 02 8:09 PM
v_f = ( wa_komp_o-netwr / o_komp-mglme ).
CALL FUNCTION 'FLTP_CHAR_CONVERSION'
EXPORTING
decim = 5
input = v_f
IMPORTING
flstr = v_c.
v_p = v_c.
2009 Jun 02 8:13 PM
TO FM FLTP_CHAR_CONVERSION, if i give input 3,45,444.98 and decimals 2
it is dumping..
RD
2009 Jun 02 8:18 PM
try this way..
"or if you unable to mention 'KUD' or 'USD' pu the commans set country 'US' before the write command
Dmbtr = 123456.
Write dmbtr currency 'KUD'
123.456
Write dmbtr currency 'USD'
1234.56
Prabhudas
2009 Jun 02 8:26 PM
Friends,
My input is 3,45,444.98 or 3.45.444,98 or 3 45 444,98
I need output 345444.98
If y input has 3 digits after decimals, output should be 3 digits after decimal
if y input has 0 digits after decimals, output should have 3 digits after decimals meaning, 345444
RD
2009 Jun 02 8:33 PM
HI,
Simple move the value to the char field. Don't use WRITE Statement to move the value from the amount field to char field.
Amount = '345444.98'.
Char = Amount.
2009 Jun 02 9:01 PM
>
> TO FM FLTP_CHAR_CONVERSION, if i give input 3,45,444.98 and decimals 2
> it is dumping..
> RD
you need to input the floating value into the FM.... no the value what u have... read the post what I said before.
2009 Jun 02 9:24 PM
Hi Avinash,
the value which is 3,45,444,98 i m getting this value in a string variable.
Hi J@y,
what do u mean ny floating value, how to convert string to a floating value?
RD
2009 Jun 17 11:34 PM
I dont think there is a standard way for this, but instead i called IPC again and fetched the prices from IPC, as sipc doenst send prices in formatted manner.
it will give price as 1234.44
Solved
2009 Jun 02 8:06 PM
try like this..
w_curr = 3,45,444.98 .
REPLACE ALL OCCURRENCES OF ',' IN:
w_curr WITH space .
CONDENSE w_curr NO-GAPS.
Prabhu
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |