cancel
Showing results for 
Search instead for 
Did you mean: 

Number formats in SAPSCRIPT

Former Member
0 Kudos

Hi. I'm having an issue when using SAPSCRIPT where I'm getting a run-time error on my form printing if the dollar amount for the field being passed is greater than 1,000. Within my form I have a PERFORM command that calls a routine in a custom program. I am passing the value of &MSEG-DMBTR& into the custom program and if it's over $1,000 it passes with both the comma and the decimal place...meaning it passes 1,200.50. If the value is less than $1,000 (meaning no comma has to be sent) it works find. The error that I receive says:

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not

caught in

procedure "FETCH_PRICE" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

The program attempted to interpret the value " 2,479.60 " as a number, but

since the value contravenes the rules for correct number formats,

this was not possible.

Has anyone else faced this, and if so how was it resolved? I hope that my explanation is clear.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Always use the character variable for printing instead of using numeric variables. So ensure that the valus returned by your custom program is assigned to this character variable before using WRITE_FORM.

I hope this helps,

Regards

Raju Chitale