Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Runtime error :COMPUTE_BCD_OVERFLOW

Hi,

I am getting the run time error as "Overflow for arithmetical operation (type P) in program".

Here is the part of my code.

Types:  begin of ty_nriv,

         OBJECT    type NROBJ,

         SUBOBJECT type NRSOBJ,

         NRRANGENR   type NRNR,

         TOYEAR     type NRYEAR,

         minnumber   type NRFROM,

         maxnumber   type NRto,

         CurrentNumber type NRLEVEL,

         No_range type NRTO,

         useage   type P decimals 6, 

         M_dooms  type P decimals 4,

       end of ty_nriv.


data:g_object type nriv-object,
       tab_nriv type standard table of TY_nriv ,
       WA_NRIV TYPE TY_NRIV,
      GV_YEAR(4) TYPE N,.

*selection screen

select-options:  s_object for g_object .

*start-of-slection.

select  OBJECT

           SUBOBJECT

           NRRANGENR

           TOYEAR

           FROMNUMBER

           tonumber

           NRLEVEL

           from nriv

           into table tab_nriv

          where object in s_object

             and TOYEAR < GV_YEAR.
 

  loop at tab_nriv into wa_nriv.
 

    WA_NRIV-No_range = WA_NRIV-maxnumber - WA_NRIV-minnumber + 1 .
 

    wa_nriv-useage = ( ( wa_nriv-currentnumber - wa_nriv-minnumber + 1 ) / WA_NRIV-No_range ) * 100 .

 
    wa_nriv-M_dooms = 50 / ( ( ( wa_nriv-currentnumber - wa_nriv-minnumber + 1 ) / ( wa_nriv-No_range + 1 ) )

      / ( 1 - ( wa_nriv-currentnumber - WA_NRIV-minnumber + 1 ) / ( WA_NRIV-No_range + 1 ) ) ).

 
      modify tab_nriv from wa_nriv transporting  No_range useage M_dooms.

 
  endloop.

Please help me out in this issue.

Thanks,

*P.S- I have tried with increase the length of packed type of decimals 10 and with data element KTMNG.

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question