2013 Nov 20 11:59 AM
Hi experts,
I have a char field with value 1,000.00
i need to copy this to a currency field.
how to achieve this?
2013 Nov 20 12:05 PM
Hi,
try to copy it to a field of type P decimal 2. then copy it to currency from this field. I cannot check this as i dont have access to sap at this time.
thanks.
2013 Nov 20 12:09 PM
Hi,
Hi,
Try moving it to NEWR TYPE field
DATA :
VAL1 TYPE CHAR10 VALUE '1000.00',
VAL2 TYPE NETWR.
VAL2 = VAL1.
WRITE : / VAL1,
VAL2.
Regards
Sumeet
2013 Nov 20 12:11 PM
HI dhivya,
Try moving the char value to currency field .
DATA :
VAL1 TYPE CHAR10 VALUE '1000.99',
VAL2 TYPE NETWR. "Currency field
VAL2 = VAL1.
WRITE : / VAL1,
VAL2.
Or
try passing the string value directly in the function module CHAR_FLTP_CONVERSION , you will get the currency value in FLSTR parameter.
Regards,
sivaganesh.
2013 Nov 20 1:30 PM
data type NETWR works only if the value is w/o thousands separator.
eg: if the value is like '1000.99'
but if the value is like '1,000.99' it gets to dump.
thanks.
2013 Nov 20 12:15 PM
Hi Dhivya,
Use FM HRCM_STRING_TO_AMOUNT_CONVERT pass decimal separator and thousand separator (Ex: '.' and ',')
Thanks
Siddhu
2013 Nov 20 1:29 PM
Function module HRCM_STRING_TO_AMOUNT_CONVERT does the work.
thanks
2013 Nov 20 12:41 PM
use this FM HRCM_STRING_TO_AMOUNT_CONVERT
pass the string , thousand separator,decimal separator and if it is currecy pass currecy key WAERS.
2013 Nov 20 1:28 PM
Function module HRCM_STRING_TO_AMOUNT_CONVERT does the work.
thnks.
2013 Nov 20 2:18 PM
Why to use a function module included in SAP HR module to process a simple task as to convert a character-based value into a decimal value? Maybe this function module is not available in every SAP system.
My recommendation is to use other more general function or procedure or do it manually using standard ABAP constructions.
2013 Nov 20 5:02 PM
Why to use a function module included in SAP HR module to process a simple task as to convert a character-based value into a decimal value?
Lack of common sense may be
I could write a simple ABAP routine for this purpose; but alas - "the end justifies the means"
Cheers,
Suhas