‎2010 Oct 25 7:48 AM
hi everyone
Im receiving lines containing quantity fields and amount fields.
Both fields can have dot and comma as separator
and space as thousand separator
like
249 522,99
149,637.81
145,89,56
Im trying to use a TRANSLATE, but the comma , space and dot are getting interchanged
can anybody help please?
‎2010 Oct 25 7:51 AM
What is the requirement..? If you want to format "," or "." then go for write to and move to statment.
Nabheet
‎2010 Oct 25 7:58 AM
hi
there should be comma as decimal separator and dot as thousand separator
‎2010 Oct 25 8:04 AM
This can be handled via user setting default also..or use write to statment press f1 and you will be able to find..
Nabheet
‎2010 Oct 25 8:46 AM
Hi Prema,
What is the purpose of using the TRANSLATE? Are you using it to convert to the correct separator format or for some other purpose.
Regards,
Immanuel.
‎2010 Oct 25 9:00 AM
‎2010 Oct 25 10:14 AM
I tried this code andit works.
DATA:lv_char TYPE dmbtr.
DATA:lv_char1 TYPE char10.
lv_char = '1210.10'. set country 'DE'.
WRITE lv_char TO lv_char1.
WRITE lv_char1.Nabheet
‎2010 Oct 25 8:28 AM
HI,
U can set the user profile.
Goto System->User Profile->Own Data--->Defaults.
Here u can set the "Decimal Notation" field.
‎2010 Oct 25 8:44 AM
‎2010 Oct 25 9:00 AM
use write to with edit mast....or u can use set county command before write
nabheet
‎2010 Oct 25 9:21 AM
Hi,
try this:
DATA: STR1 TYPE STRING.
DATA: DMBT TYPE DMBTR.
STR1 = '149,637.81'.
TRANSLATE STR1 USING ', . '.
CONDENSE STR1 NO-GAPS.
DMBT = STR1 / 100.
WRITE: / DMBT.
Regards, Dieter
‎2010 Oct 25 9:39 AM
My telepathy skills are week today. How have your tried using translate? What is your input, and what output do you expect?
It's really important to state your questions clearly, with relevant information. Otherwise the answers you get will be just guesses.
‎2010 Oct 25 9:58 AM
You are trying to Translate the workarea / variable containing the amount and quantity filed.
What is the output format you require in those fields for translation. ?
Give example of your output which is needed after translate ?
Thanks
ABAP Dev
‎2010 Oct 25 10:15 AM
‎2010 Oct 26 11:56 AM
thanks evryone
I used if conditions and translate and its working nw