on 03-14-2008 3:26 AM
Hi All,
How do you set the amount format to 111,111,111.00 in sapscript?
Is there a command like set date mask for this?
Thanks.
Tyken
Hi,
This format setting is done in user profile: SU01 - Defaults tab.
In the scripts if you want to do that explicitly you can use the command: /: SET COUNTRY 'SG' . (Or any country code you want to use).
Hope this helps.
Regards,
Narendra.
Reward if helpful!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Pass the value to your subroutine, and then chk out for the thousand separator. If it is in the correct format itz fine just pass it back to the script.
Else need to split it and then modify and then pass it back.
By correct format I mean sometimes you get values like 1.234,00 instead of 1,234.00 . So chk out what is there in the 3rd from last place and if you have , instead of . you need to split your variable at , to say var1 and var2.
Now replace . in var1 with , and then concatenate . to var2.
now concatenate var1 and var2 and then write this variable to another variable of currency format.
Now pass it back to the scripts.
Just a suggestion: prior to doing any changes just try doing this:
set country ' ' in your scripts. Chk out. Else, chk out by using set country 'SG' (or 'IN'). Else do it manually as said above.
Hope helps you..
Regards,
Narendra.
Reward if helpful!!
Hi,
can you change your driver program? if so , write the code lines as below.
let us suppose your amount field has length 19 (output length: for this see the domain ) then declare a field of caracter type.
data: v_amount(19) type c, "Total length
v_amt(15) type c, "Length before decimal
v_deci(3) type c. "lenght after decimal
let us say your field is v_netpr
v_amount = v_netpr.
split v_amount at ',' into v_amt v_deci.
replace all occurances of '.' with ',' in v_amt.
clear v_amount .
concatenate v_amt '.' v_deci into v_amount.
now you can use this variable to print in the form.
if you cant change the driver program then the same logic you can use.
if you want to know how to writge the subroutines in the form then search for subroutines, you will get lot many results.
Reward pointgs if useful.
Regards,
Nageswar
hi
as told it is better to make these setting in user profile , DEFAULT tab.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.