2007 Dec 07 12:02 PM
Hi,
I have a currency field and i want to assign it to a variable of type char. is this possible? if yes, plz tell me how
Regards,
Prasy
2007 Dec 07 12:17 PM
Hi,
Data:CURR Type NETWR .
Data:CHAR(10) Type c.
CURR = '1234'.
WRITE CURR To CHAR.
WRITE:/ CHAR.
2007 Dec 07 12:13 PM
Hi,
Data: curr(10) type p decimals 2,
char(10) type c.
curr = '12334.56'.
char = curr.
replace '.' in char with '' .
write char.
Regards,
Satish
2007 Dec 07 12:14 PM
Hi..
you can do this.
see the following code it will help you
data : val(10) type char.
**now you want to assign a currency field to this val and the value must be in rupees or something else.
val = val * ekko-umrez / ekko-umren.
with this statement the charecter field value can be converted into cureency field
now you can use the same val in any where of your object.
regards,
swaminath reddy
2007 Dec 07 12:17 PM
Hi,
Data:CURR Type NETWR .
Data:CHAR(10) Type c.
CURR = '1234'.
WRITE CURR To CHAR.
WRITE:/ CHAR.
2007 Dec 07 12:28 PM
Hi,
Variable is decalred as
data: l_ansal LIKE q0008-ansal
i want to assign it to
line(80) type c.
the value is not geeting assigned to line.
plz help
2007 Dec 07 12:50 PM
Hi,
This is working for me.
data: l_ansal LIKE q0008-ansal,
line(80) type c.
l_ansal = '1234567890.12'.
line = l_ansal.
replace '.' in line with ''.
write line.
Regards,
Satish
2007 Dec 07 12:19 PM
DATA : Cur TYPE CHAR16.
cur = itab-curr . " Currency field...
WRITE 😕 cur.
that's all..
in more detail..
DATA : text type char18.
text = itab-kwmeng. "field with value 1,0000.00
REPLACE ALL OCCURRENCES OF ',' IN text
WITH ' '.
CONDENSE text.
WRITE 😕 text.
Or also:
For Converting currency field in char type, Just do
DATA : ZCHAR(20) TYPE C.
MOVE CURRENCY TO ZCHAR.
Reward points if found helpfull.....
Cheers,
Chandra Sekhar.