‎2006 Sep 01 7:56 PM
hi to all
iam having amount like these 5,000.00 i want o relplace , with . and . with , is there any functional moudule to do this or can i use translate function to do it
thanks in advance
kiran kumar
‎2006 Sep 01 8:08 PM
Hi Kiran,
Please check this FM REPLACE_STRING.
Regards,
Ferry Lianto
‎2006 Sep 01 8:04 PM
There is no function module for the same but would need to use either translate or replace command.
TRANSLATE lvalue using '.*'.
TRANSLATE lvalue using ',.'.
TRANSLATE lvalue using '*,'.
Regards
Anurag
‎2006 Sep 01 8:04 PM
Don't think that there is a function module, but the TRANSLATE will work well, you just need to use a placeholder in this case when swapping values.
REPORT ZRICH_0001.
data: c(20) type c value ' 5,000.00'.
translate c using ',@'.
translate c using '.,'.
translate c using '@.'.
write:/ c.
Regards,
Rich Heilman
‎2006 Sep 01 8:55 PM
hi rich heilman,
READ TABLE IT_IN WITH KEY 'MHND-DMSHB'.
CHECK SY-SUBRC = 0.
WRITE IT_IN-VALUE TO AMOUNT.
we r getting amount into it how we should this amount to
the format for both euro and non euro
plz suggest the solution
‎2006 Sep 01 9:06 PM
I think you may need to check the user settings to find out how to reformat .
You can use this to get rid of any/all formatting based on the user settings. Then when you write into AMOUNT field, it will apply the user specific formatting. I assume that you want to do some calculation with the IT_IN-VALUE? A litle unclear about what you want to do.
report zrich_0001.
data: value(20) type c value '1,235.67'.
data: xusr01 type usr01.
* 1.234.567,89
*X 1,234,567.89
*Y 1 234 567,89
select single * from usr01 into xusr01
where bname = sy-uname.
case xusr01-dcpfm.
when ' '.
translate value using '. '.
translate value using ',.'.
when 'X'.
translate value using ', '.
when 'Y'.
translate value using ',.'.
endcase.
condense value no-gaps.
write:/ value.
Regards,
Rich Heilman
‎2006 Sep 01 9:11 PM
hi heilman,
DATA :D_DT TYPE T005X-XDEZP.
READ TABLE IT_IN WITH KEY 'MHND-DMSHB'.
CHECK SY-SUBRC = 0.
WRITE IT_IN-VALUE TO AMOUNT.
after we getting it
here ineed to write the select statment for customer country,cusotmer and the decimal places d_dt how to write
this select statemnt so that icanpass the right amount
5.000,00 instead of 5,000.00 like wise
IF D_DT EQ 'X'.
TRANSLATE AMOUNT USING '.,,.'.
ENDIF.
IF L_CURR EQ 'EUR'.
CALL FUNCTION 'AMOUNT_STRING_CONVERT'
EXPORTING
AMOUNT_STRING = AMOUNT
DCPFM = D_DT
MLLN = 'M'
TSND = 'T'
WAERS = l_CURR
IMPORTING
AMOUNT = L_VALUE.
EXCEPTIONS
INVALID_TYPE = 1
OTHERS = 2
‎2006 Sep 01 9:15 PM
‎2006 Sep 01 9:20 PM
hi can u plz sugggest the possible solution how the
select statement should be there .this problem is coming in dunning notices for customers other than europe.
‎2006 Sep 01 8:08 PM
Hi Kiran,
Please check this FM REPLACE_STRING.
Regards,
Ferry Lianto