‎2006 Nov 06 12:23 PM
Hi,
I have got a field with the currency data type, but the text file given to me has only character. so i need a
Function Module to convert the character field to currency.
‎2006 Nov 06 12:27 PM
hi,
use this FM HRCM_STRING_TO_AMOUNT_CONVERT
pass the string , thousand separator,decimal separator, if it is currecy pass currecy key WAERS.
or try this code.
DATA: v_dcpfm TYPE usr01-dcpfm,
v_amount TYPE bseg-wrbtr,
v_char(16) TYPE C.
SELECT SINGLE dcpfm FROM usr01
INTO v_dcpfm
WHERE bname = sy-uname.
IF v_dcpfm = 'X'.
*-- decimal point is '.' and thousands separator is ','
TRANSLATE v_char USING ', '.
CONDENSE v_char NO-GAPS.
v_amount = v_char.
ELSEIF v_dcpfm = 'Y'.
*-- decimal point is ',' and thousands separator is '.'
TRANSLATE v_char USING '. '.
CONDENSE v_char NO-GAPS.
v_amount = v_char.
ELSE.
*-- decimal point is ',' and thousands separator is space
CONDENSE v_char NO-GAPS.
v_amount = v_char.
ENDIF.rgds
Anver
if hlped pls mark points
‎2006 Nov 06 12:28 PM
Hi
Try ISM_CONVERT_CHAR_TO_CURR
function module.
reward points if helpful.
Regs
Manas Ranjan Panda
‎2006 Nov 06 12:32 PM