on 10-12-2011 8:33 AM
Hello experts,
I have a requirement of displaying currency values as '123 456 789.00' which is currently displayed as '123,456,789.00'.
I checked with country key but none value of T005X-XDEZP gives me desired result.
I want to write code within the Scripts.
Please help me in this.
Hi,
Try by using different dataelements or use replace keyword.
Check this.
data : i type char100.
i = '123,456,789.00'.
replace ALL OCCURRENCES OF ',' in i WITH ''.
write i.
Jshree
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Fellow
I am afraid to tell you that your specific format '123 456 789.00' is typical to get with in SAP SCRIPT but you can achive the format '123456789.00' modifying your SCRIPT. Upper format will require more complex logic in SCRIPT.
if you are okie with it then try the STEPS
1)Insert few lines with symbol /: Command Line in SCRIPT.
2)copy below code to each line.
DATA : temp TYPE STRING.
temp = '123,456,789.00'. " or your variable to print.
REPLACE ALL OCCURRENCES OF ',' IN temp WITH ' '.
3) now temp has the format to print on form. in place of your variable place temp in the layout.
I hope now this will work.
Regards
Syed Ashkar
Do this in your driver program.
create a global variable of type char20, that should be enough, if not consider a char30.
Then use the WRITE TO statement with the addition "WITH EDIT MASK" to write your value into that new charfield you created.
Finally in script print that charfield instead of your valuefield.
When working with the WRITE TO statement, also consider working with the CURRENCY addition instead of WITH EDIT MASK.
If you dont need spaces instead of commas, but commas just removed, then do following in script:
&YOUR_VARIABLE(T)&
that should stop him from printing thousand seperators. But he wont do spaces instead, just dont print the seperators.
Edited by: Florian Kemmer on Oct 12, 2011 10:18 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.