07-21-2009 10:16 AM
Hi All,
I need to concatenate '$' sign to a currency field.
The code i am using is -
-
DATA L_TOTAL_PRICE TYPE CHAR15.
L_TOTAL_PRICE = W_CAT2_PRICE. " W_CAT2_PRICE is currency field and its (type is CRMT_NET_PRICE....(in CRM)
CONDENSE L_TOTAL_PRICE.
CONCATENATE W_DOLLAR L_TOTAL_PRICE INTO W_TOT_PRICE.
-
The problem i am facing is 'COMMAs' are getting omitted as i have taken L_TOTAL_PRICE TYPE CHAR15.
If I take L_TOTAL_PRICE TYPE P then it gives a dump as the '$' cannot be interpreted.
I want the output to be like $1,23,456.00 (with commas) and i am getting $123456.00 (without commas).
Please help guys !!!
07-21-2009 10:19 AM
Hi,
Could you please try the following logic?
DATA L_TOTAL_PRICE TYPE CHAR15.
write w_cat2_price to l_total_price.
CONDENSE L_TOTAL_PRICE.
CONCATENATE W_DOLLAR L_TOTAL_PRICE INTO W_TOT_PRICE.
Thanks and Regards,
Suresh
07-21-2009 10:19 AM
Hi,
Could you please try the following logic?
DATA L_TOTAL_PRICE TYPE CHAR15.
write w_cat2_price to l_total_price.
CONDENSE L_TOTAL_PRICE.
CONCATENATE W_DOLLAR L_TOTAL_PRICE INTO W_TOT_PRICE.
Thanks and Regards,
Suresh
07-21-2009 10:19 AM
Hi,
Instead of
L_TOTAL_PRICE = W_CAT2_PRICE.
use,
WRITE: W_CAT2_PRICE to L_TOTAL_PRICE.
this will apply the user's decimal format.
Regards,
Nick
07-21-2009 10:19 AM
07-21-2009 10:29 AM
hi
use
write statment insted of assining W_CAT2_PRICE to L_TOTAL_PRICE .
~linganna
07-21-2009 10:29 AM
Hi,
Try the following code.
DATA W_TOT_PRICE TYPE STRING.
L_TOTAL_PRICE = W_CAT2_PRICE. " W_CAT2_PRICE is currency field and its (type is CRMT_NET_PRICE....(in CRM)
CONDENSE L_TOTAL_PRICE.
CONCATENATE W_DOLLAR L_TOTAL_PRICE INTO W_TOT_PRICE.
Just for displaying purpose, you can assign the variable as string into which the concatenated valuse is going to be stored.
Regards,
Vik
07-21-2009 10:30 AM
DATA amt TYPE p DECIMALS 2.
amt = your amount
write AMOUNT to OUT currency 'USD'.
CONCATENATE '$' out INTO out.
CONDENSE out.