I am modifying an SAP standard script in which I called a subroutine pool program.
To the program, I am passing an amount value to perform some calculations. When I try to execute the form, I got a runtime error saying as below.
Runtime Errors CONVT_NO_NUMBER
Unable to interpret " 249,900.00-" as a number.
The value passed is from the table RF140-WRSHB.
Any inputs on how to resolve this issue will be highly appreciated.
Thanks for your reply!
I did not understand your response. Could you please explain more clearly?
The value I am passing to the program is an currency field (RF140-WRSHB) with 2 decimal places.
In the program I have declared a field as below. The below will be used for calculation.
DATA: LV_WRSHB TYPE RF140-WRSHB.
READ TABLE Z_USING WITH KEY NAME = 'RF140-WRSHB'.
IF SY-SUBRC EQ 0.
MOVE Z_USING-VALUE TO LV_WRSHB.
I am getting an error at the above place when I move the value to LV_WRSHB.
Any other inputs?
Based on the messge you got "Unable to interpret " 249,900.00-" as a number" I'd suggest you need to change your logic to be more like this i.e. cater for a negative in the character field (I've not got a SAP system on hand to syntax check this with so it might need a mod):
lv_wrshb type rf140-wrshb.
read table z_using
with key name = 'RF140-WRSHB'.
if sy-subrc is initial.
if z_using-value cs '-'. "then it's a negative in the character field
translate z_using-value using '- '. "so remove the minus sign at the end
move z_using-value to lv_wrshb. "now do the move
lv_wrshb = 0 - lv_wrshb. "make your currency field negative
move z_using-value to lv_wrshb.