‎2007 May 15 10:29 AM
Hello everyone!
When I execute this:
DATA: myAmount TYPE p DECIMAL 2, myString TYPE string.
myAmount = 1234567.89.
myString = myAmount.
WRITE: myAmount, ' ; ', myString.
The output is 1,234,567.89 ; 1234567.89
How can I put back the comma separators to the string? Is there a built-in function that can do this or do I need to write my own?
Thanks a lot guys!
Message was edited by:
Ricardo Caliolio
‎2007 May 15 10:59 AM
‎2007 May 15 10:31 AM
Hi,
You can set the currency defaults in Syetem => User Profilr => Own Data.
This currency format will be used for display.
regards
‎2007 May 16 12:16 PM
> Hi,
> You can set the currency defaults in Syetem => User
> Profilr => Own Data.
> This currency format will be used for display.
>
> regards
Hello. But this only applies to numerical data types and not strings... _
Thanks!
‎2007 May 15 10:33 AM
Instead of this :
myString = myAmount.
Use this :
WRITE myAmount To myString .
Hope this helps you.
‎2007 May 16 12:17 PM
> Instead of this :
>
> myString = myAmount.
>
> Use this :
>
> WRITE myAmount To myString .
>
> Hope this helps you.
This is not working when I tried it but this one do:
MOVE myAmount TO myString.However, it has the same result as:
myString = myAmount.Thanks!
‎2007 May 15 10:46 AM
hi,
goto System => User Profile => Set Data.
then output data for string variables displayed as u get for ur programs.
if helpful reward some points.
with regards,
suresh.
‎2007 May 15 10:55 AM
‎2007 May 16 12:19 PM
> hi
> how did u get the output with ur code..
> it gives dump...
I think it is just a dummy code.. But the logics is there so just try to modify it a little.. _
Thanks!
‎2007 May 15 10:59 AM
‎2007 May 16 12:19 PM
> hi,
> u have to put comma by ur own.
> Regards,
> NRT
I think I am already starting to believe this... _
Thanks!
‎2007 May 15 11:07 AM
Hi,
The write statement has an formatting extension
USING EDIT MASK (mask)
This should solve your problem 7 if so Plz be generous with points...
Regards,
Gaurav
‎2007 May 16 12:23 PM
> Hi,
>
> The write statement has an formatting extension
>
> USING EDIT MASK (mask)
>
> This should solve your problem 7 if so Plz be
> generous with points...
>
>
> Regards,
> Gaurav
I'm sorry but I am not yet used to using this.. Can you please elaborate? Thanks a lot! _
‎2007 May 15 11:08 AM
Hi Ricardo,
Here is the solution for your question.
DATA: myAmount TYPE p DECIMALS 2, myString(15).
myAmount = '1234567.89'.
WRITE myAmount TO myString . <b>"Using this statement will automatically give,</b>
WRITE: myamount ,myString.
MOVE myAmount TO myString . "<b>SImilar to myString = myAmount.</b>
WRITE: myamount ,myString.
So, now the output for this code is
MyAmount Mystring
1,234,567.89 1,234,567.89 -->Using WRITE ...TO
1,234,567.89 1234567.89 --> Using MOVE... TO or Equals
Reward points for all useful answers.
Regards,
SaiRam
‎2007 May 16 12:13 PM
> Hi Ricardo,
> Here is the solution for your question.
>
> DATA: myAmount TYPE p DECIMALS 2, myString(15).
>
> myAmount = '1234567.89'.
> WRITE myAmount TO myString . <b>"Using this
> statement will automatically give,</b>
> WRITE: myamount ,myString.
>
> MOVE myAmount TO myString . "<b>SImilar to myString
> = myAmount.</b>
> WRITE: myamount ,myString.
>
> So, now the output for this code is
> MyAmount Mystring
> 1,234,567.89 1,234,567.89 -->Using WRITE ...TO
>
> 67.89 1234567.89 --> Using MOVE... TO or
> Equals
>
> Reward points for all useful answers.
>
> Regards,
> SaiRam
Hello. I think this is a good idea but it conflicts with my another problem. I posted this with the title "How to remove spaces when printing amounts" in this same forums.
Thanks!
‎2007 May 15 11:20 AM
Hi ,
we can't assign a value 1,234,567.85 to a packed number directly.
How did you assign it and got the output.
It is giving errors know?
Regards,
Balakrishna.N
‎2007 Oct 08 4:32 AM