cancel
Showing results for 
Search instead for 
Did you mean: 

Packed number is too small?

Former Member
0 Kudos

Howdy,

I have the following code that gives me an ABAP dump when the calculation prodcues a figure like 136.9778007


data: dc    TYPE p DECIMALS 13,

FORM calculate_dc USING  lv_matcostprice                    
lv_factor                  lv_rate                              
CHANGING lv_dc.                                                                                
lv_dc = lv_matcostprice / lv_factor * 
           100 / lv_rate.          
 ENDFORM.                    "cALCULATE_DC                 

Can anyone see why it would be doing this?

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Exactly what are the values that are being passed to this form.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Rich,

The values are:

lv_matcostprice = 255.51

lv_factor = 109.80

lv_rate = 1.54408

so following the formula:

lv_dc = lv_matcostprice / lv_factor * 100 / lv_rate.

we get a value of

lv_dc = 150.7078495

And this is the value that it has a problem with?

it works fine with other values below 100 but as soon as lv_dc is above 100 it dumps with:

"A value generated during processing is too large for

field "LV_DC" of program "ZCHES". "

Any ideas?

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Ok, in your data statement for DC, define the length.

Data: dc(12) type p decimals 12.

Regards,

Rich Heilman

Answers (0)