2008 Nov 21 7:48 AM
I have a variable with type P
I need to prefix a negative sign to the variable, how can this be done.
2008 Nov 21 7:56 AM
Hi,
Do like this,,,
data ll type p decimals 2.
ll = '222.33'.
ll = - ll.
.
write ll.
and to get this '-' sign in front try like this..
data : ll type p decimals 2,
l(20) .
ll = '222.33'.
ll = - ll.
l = ll.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = l
.
write l.
Regards
Debarshi
I have a variable with type P
I need to prefix a negative sign to the variable, how can this be done.
2008 Nov 21 7:52 AM
Hi,
This can be done if you transfer the variable to a character type variable and concatenate '-' sign before it.
Regards
sandipan
2008 Nov 21 7:54 AM
2008 Nov 21 7:56 AM
2008 Nov 21 7:56 AM
Hi,
Do like this,,,
data ll type p decimals 2.
ll = '222.33'.
ll = - ll.
.
write ll.
and to get this '-' sign in front try like this..
data : ll type p decimals 2,
l(20) .
ll = '222.33'.
ll = - ll.
l = ll.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
value = l
.
write l.
Regards
Debarshi
2008 Nov 21 7:59 AM
REPORT ZSRK_074 .
DATA : L_AMT(16) TYPE P DECIMALS 2,
L_AMTC(16).
L_AMT = '-18.50'.
MOVE L_AMT TO L_AMTC.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = L_AMTC.
WRITE : / L_AMTC.