11-13-2006 6:20 AM
Hi sapper~
I'd like to change "1,230,450.00-" to "-1,230,450"
ex)
Follow the example use two option.
1&symbol& --> 1,230,450.00-
2. &symbol(<)& --> &-1,230,450.00&
3. &symbol(.0)& --> &-1,230,450&
Do you know how to apply number 2,3 to number 1 a time ?
11-13-2006 10:18 AM
hi jake ,
for this scenario u need to handle with an Fm
1.
declare the variables in CHARACTERS ,
TYPE C
2. to put the sign in front ..
use this Functional module ..
CLOI_PUT_SIGN_IN_FRONT
check the code ..
REPORT zex3 .
data : p1 type p decimals 3 .
p1 = '123450.000'.
data: p2(13) type c.
write:/ p1.
*normal calculation
p1 = p1 * -1.
write:/ p1.
p2 = p1.
*with fm
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = p2.
write:/ p2.
note that this takes the input in character format and
o/p in character format ..
3. supress the zeros in the diaplay
&symbol(7.0)&
depending on the length of the field .. . (X.0 ) will
supress the zeros
regards,
Vijay
11-13-2006 6:23 AM
11-13-2006 6:23 AM
11-13-2006 6:43 AM
Hi,
I would suggest you to make the data type of the variable to character instead of amount field and then do string operation rotate to make the negative sign to be the first character.
11-13-2006 10:18 AM
hi jake ,
for this scenario u need to handle with an Fm
1.
declare the variables in CHARACTERS ,
TYPE C
2. to put the sign in front ..
use this Functional module ..
CLOI_PUT_SIGN_IN_FRONT
check the code ..
REPORT zex3 .
data : p1 type p decimals 3 .
p1 = '123450.000'.
data: p2(13) type c.
write:/ p1.
*normal calculation
p1 = p1 * -1.
write:/ p1.
p2 = p1.
*with fm
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = p2.
write:/ p2.
note that this takes the input in character format and
o/p in character format ..
3. supress the zeros in the diaplay
&symbol(7.0)&
depending on the length of the field .. . (X.0 ) will
supress the zeros
regards,
Vijay