10-08-2007 12:31 PM
If i declare a variable with type p, is it can store a negative value? Thanks!
10-08-2007 12:35 PM
Hi,
Yes.
data v_num type p decimals 2 value '-234.00'.
data v_char(20).
move v_num to v_char.
write:/ v_num.
condense v_char.
write:/ v_char.
To put the negative sign before the value use the below function module.
call function 'CLOI_PUT_SIGN_IN_FRONT'
changing
value = v_char.
write:/ v_char.
Message was edited by:
Velangini Showry Maria Kumar Bandanadham
10-08-2007 12:36 PM
10-08-2007 12:38 PM
Hi,
It can hold negative values.
Ex :
data : temp type p decimals 2 value '-38.00',
temp1 type i value '12'.
temp1 = temp + temp1.
write : temp, temp1.
Thanks,
Rewards If Helpful.
10-08-2007 12:59 PM
But i need to display in sapscript. In my sapscript, i use internal-value(C), it can't display the negative value. Thanks
10-08-2007 1:02 PM
Hi,
In SAP SCRIPT, we have a special way to print the Signs ...
Left side --> &FIELD(<)&
right side --> &FIELD(>)&
and also check the length of the field.
Thanks,
Reward If Helpful.