Skip to Content
author's profile photo Former Member
Former Member

Overflow when converting from "1.09425e+11"

Hi Everyone,

this is an urgent issue, I have certains whose datatype is Packed decimal.

For certain numerical calculations i.e to calculate the variable to the power of 30 and power of 365 it throws up this abap runtime error.

All the variables have declared as packed decimal with 2 decimal places.

How can I fix this issue. Can anyone help me please,

Its really urgent.

Thanks in advance,

Prashant.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 06, 2006 at 10:44 PM

    hi kumar,

    for performing scientific operations like power etc it is alwayz prefer to use type f instead of type p.so jus replace all your type p with type f.

    Cheers,

    Abdul Hakim

    Mark all useful answers..

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      you can try this ....

      i just added to Neils suggestion....

      changed the EXCEPTION name.

      data a(15) type p.
      data b(15) type p value 20000000000000.
      data max_value(15) type p value 999999999999.
      
      CATCH SYSTEM-EXCEPTIONS <b>COMPUTE_POW_RANGE</b> = 1.
      a = b ** 365.
      ENDCATCH.
      IF sy-subrc = 1.
      a = max_value.
      write:/ sy-subrc,a.
      endif.

      Regards

      vijay

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2006 at 07:05 PM

    Hey Guys,

    See As how u have suggested I have given the code but still it doesn't pop up a message based on the checkbox.

    I perform this only when a checkbox for year is pressed and based on this I have to pop up a message saying it is huge cannot be displayed and get back to the screen. how to I achieve this.

    Any help will of great use to me.

    if year = 'X'.

    CATCH SYSTEM-EXCEPTIONS COMPUTE_POW_RANGE = 1.

    a = b ** 365.

    ENDCATCH.

    IF sy-subrc = 1.

    a = max_value.

    MESSAGE a001.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 06, 2006 at 09:47 PM

    Is changing the variables to a float out of the question?

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.