07-31-2008 7:53 AM
Hi guys,
Is possible for a character value to follow the decimal notation set by user?
ex... if v_char = 11234.50
I want my output to be 11,234.50 as per my decima notation set up...
thanks!
07-31-2008 8:04 AM
Hi Mark,
i hope u have this value 11234.50 in some currency/quantity data type field. If yes then do like like this.
WRITE curr/quantity field TO v_char.
It writes data as per user settings.
WRITE v_char .
Sample code.
DATA: char(20) TYPE c,
quan TYPE LIPS-lgmng VALUE '123456.25'.
WRITE quan TO char.
CONDENSE char.
WRITE: char.
If it is hard coded value then first pass it to some currency/quantity field then use WRITE TO statement for converting data as per user settings.
Make sure that ur char field have sufficient length(Including seperators).
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Jul 31, 2008 12:35 PM
07-31-2008 8:03 AM
Hi Mark,
as per my understandin you need to covert character field value to currency or quantity is it?
for this u need to convert v_char without decimal
by using statement
replace all the occurences of '.' in v_char with ' '.
condense v_char.
then u can write this value to currency or quantity field.
write v_char to v_field.
Reward if useful.
Cheers,
Balaji
07-31-2008 8:04 AM
I think first u can store the value to a type P variable and then move it to a char variable.
v_packed = 11234.50.
write v_packed to v_char.
Now in v_char u will get 11,234.50.
Regards,
Joy.
07-31-2008 8:04 AM
Hi Mark,
i hope u have this value 11234.50 in some currency/quantity data type field. If yes then do like like this.
WRITE curr/quantity field TO v_char.
It writes data as per user settings.
WRITE v_char .
Sample code.
DATA: char(20) TYPE c,
quan TYPE LIPS-lgmng VALUE '123456.25'.
WRITE quan TO char.
CONDENSE char.
WRITE: char.
If it is hard coded value then first pass it to some currency/quantity field then use WRITE TO statement for converting data as per user settings.
Make sure that ur char field have sufficient length(Including seperators).
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Jul 31, 2008 12:35 PM
08-01-2008 4:25 AM
Hi Mark,
It is not possible to display the CHAR variable v_char = 11234.50 as 11,234.50 .
The output will be 11234.50 itself.
If you want to display v_char = 11234.50 as 11,234.50 you need to pass this value to a variable which is of CURRENCY type
For Example:
DATA: v_char(10) TYPE c VALUE '11234.50',
v_curr TYPE netwr. " Currency Field
v_curr = v_char.
WRITE: v_curr.
Best regards,
raam