03-12-2007 12:09 PM
Hi Experts
I am getting a value in variable and that is negative. I am using
REPLACE ALL OCCURRENCES OF '-' IN abtmnt WITH ''. But I am getting an error which states that:
"OCCURRENCES OF '-' IN ABTMNT" is not expected.
Can anyone tell me the reason for this error.
Regards
Vishal
03-12-2007 12:33 PM
Hi,
use fm PREPARE_STRING
or
write f1 to f2 no-sign.
Message was edited by:
Andreas Mann
03-12-2007 12:32 PM
These <b>replace , translate , shift</b> all funcitons work for character type fields onli...
These wont work for fields other than character type fields..
Do one thing move that variable into a sufficient sized variable of type 'N', then u wont get any '-' sign there...!!
Try executing this sample code ,,,,,
data w_i type i value '-234'.
data w_n(4) type n.
move w_i to w_n.
write : / 'w_i', w_i, / 'w_n', w_n .
<b>****************************************
output : w_i -234
w_n 0234.
****************************************</b>
<b>reward points if it helps u...</b>
sai ramesh
03-12-2007 12:33 PM
Hi,
use fm PREPARE_STRING
or
write f1 to f2 no-sign.
Message was edited by:
Andreas Mann
03-12-2007 1:14 PM
Hi Andreas
Thanks for your response.
I am using:
data: abtmnt like konv-kwert,
abtmnt1 like konv-kwert.
write abtmnt to abtmnt1 no-sign.
The value in abtmnt is 1078.37- but what I am getting in
abtmnt1 is 13037382>3.33
I will appreciate if can give some idea why this is happening.
Regards
Vishal
03-13-2007 1:44 AM
Hi vishal,
just execute this and check.
data: abtmnt like konv-kwert,
abtmnt1 like konv-kwert.
select single kwert from konv into abtmnt where kwert < 0.
write abtmnt .
write abtmnt no-sign.
WHy are u using write abtmnt to abtmnt1. u can eliminate the sign by just using no-sign.
reward if it helps.
keerthi.
03-15-2007 9:14 AM
Hi Keerthi
Keerthi, I am assigning this abtmnt somewhat like this:
wa_item-abt_per_unit = abtmnt no-sign.
but I am getting this error.
%CODE1 Incorrect arithmetic or bit expression: Instead of "NO-SIGN", an operator (+, -, *, /, ... or BIT-AND, BIT-XOR, BIT-OR) was expe
Can you suggest something on this.
Regards
Vishal
03-15-2007 9:21 AM
you cannot use no sign while assigning a field , you can only use that with write statement
move the amount to one charater field and use this FM
use this FM CLOI_PUT_SIGN_IN_FRONT
03-12-2007 12:36 PM
use this
TRANSLATE ABTMNT using '- '.
and if u want use REPLACE
REPLACE ALL OCCURRANCES OF '-' IN abtmnt WITH ' '.