Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Conversion Issue: CX_SY_CONVERSION_OVERFLOW

Former Member
0 Likes
18,247

Hi Experts,

We are having problem in one of our program.There is a conversion of data type P(length 11) to Data type I for one of the field(Key figure in SAP-BI).

The data is getting converted correctly when the field value is less than < 2,200,000,000.

But whenever the value of field is more than 2,200,000,000 it is giving

"Runtime Errors BCD_OVERFLOW".

Except. CX_SY_CONVERSION_OVERFLOW.

The reason for the exception is:

In the current arithmetic operation with operands of type P an overflow

has been detected. Possible causes are:

1. The result field of type P is too small to store the result.

2. The result or an intermediate result has more than 31 decimal places.

There is a problem in Converion routine.

Any help on this is hghly appreciated.

Regards,

Ashitosh.

8 REPLIES 8
Read only

Former Member
0 Likes
9,507

Hi,

It is because the field is too small to hold the value.

Get a field of a data type which can hold a large value.

Try using a data element whose domain is DECV23_2.

Regards,

Ankur Parab

Read only

RaymondGiuseppi
Active Contributor
0 Likes
9,507

From [Numeric Data Types|http://help.sap.com/abapdocu/en/ABENNUMBER_TYPES.htm]

The data type of integers, i, has a value range of -2.147.483.648 to +2.147.483.647

So your field will never be able to contain a value as large as 2,200,000,000

Regards,

Raymond

Read only

rainer_hbenthal
Active Contributor
0 Likes
9,507

2^31 is what? These are computer basics....

Read only

0 Likes
9,507

Yes from -2(32-1) to 2(32-1) - 1, old memories...

Read only

Former Member
0 Likes
9,507

Thanks Raymond for your valuable inputs.

Pls suggest the data type which will solve this issue.

There are further calculations with the help of this filed.Which data type will be a better choice for me to go with.This is a BI system.

Thanks in advance.

Read only

0 Likes
9,507

try to use type F (floating point)

to convert floating to type p you need to use an intermediate parameter of type c.

F > C then C > P

use 'FLTP_CHAR_CONVERSION' to convert floating value to Charac

Read only

0 Likes
9,507

Hi Jay,

Here conversion of data type from P to I is taking place.Now I need to look for other data type which will not effect my further calculations.

Can I use the data type P with some considerations like, I should not get decimals in my final value Initial value may contain decimals.

Pls suggest data type to resolve this issue.

Thanks in advance.

Read only

0 Likes
9,507

Follow SAP advocacy ([Numeric Data Types - Hints on Use |http://help.sap.com/abapdocu/en/ABENNUMBER_TYPES_HINTS.htm])

If you need whole numbers, use data type i.

If the [value range|http://help.sap.com/abapdocu/en/ABENBUILT_IN_TYPES_VALUES.htm] of i is too small, use [packed numbers|http://help.sap.com/abapdocu/en/ABENPACKED_NUMBER_GLOSRY.htm] without fractional portions. If the value range of the packed numbers is too small, use [decimal floating point numbers|http://help.sap.com/abapdocu/en/ABENDECFLOAT_GLOSRY.htm].

Regards,

Raymond