How To Fix R7B136 - Rounding inaccuracies occur with data type FLOAT for AMOUNT and QUANTITY


R7B136 - Overview

  • Message type: E = Error

  • Message class: R7B - BW Metadata (InfoCube, InfoObject, InfoObject catalog)

  • Message number: 136

  • Message text: Rounding inaccuracies occur with data type FLOAT for AMOUNT and QUANTITY

  • Show details Hide details
  • What causes this issue?

    ABAP data type FLOAT is an implementation of the IEEE data type DOUBLE.
    In most databases<(>,<)> this data type is also implemented according to
    the IEEE specification.
    This data type is a floating point data type with mantissa and exponent
    encoded in base 2. Because the conversion from base 10 to base 2 is
    technically not possible without loss of accuracy for many numbers,
    using FLOAT always results in rounding inaccuracies. Examples include
    0.15, 25.5 and many more. They cannot be expressed exactly as FLOATs.
    SAP Note 2798 describes some of the effects of this behavior. A decimal
    shift can cause rounding inaccuracies for example.
    All arithmetic operations on FLOAT cause additional inaccuracies. A
    simple addition of 2 values has an inaccuracy in the last digit (15).
    For 10 additions<(>,<)> you lose 1 digit in accuracy. For 100 additions
    <(>,<)> 2 digits are lost, and for 1<(>,<)>000,000 additions 6 digits
    are lost. The result of database aggregation SUM on 1 million records
    has a remaining accuracy of 8 digits instead of 14 digits. Aggregating 1
    billion rows means that only 5 digits will be correct.
    Data type FLOAT is therefore not suitable for business-relevant data
    like amounts and quantities<(>,<)> where exact results are required (for
    example financial key figures).

    System Response

    The system raises a warning if this key figure is defined. The key
    figure is used as defined.

    How to fix this error?

    Check the key figure definition and change it if used in
    business-relevant scenarios. Suitable data types are the ones that the
    system proposes by default when you create a key figure. These types use
    decimal packed numbers and do not have the specific rounding
    inaccuracies of FLOAT.

    Procedure for System Administrators

    The system issues an error message and will not allow you to continue with this transaction until the error is resolved.


    Error message extract from SAP system. Copyright SAP SE.


Smart SAP Assistant

  • What is the cause and solution for SAP error message R7B136 - Rounding inaccuracies occur with data type FLOAT for AMOUNT and QUANTITY ?
    The SAP error message R7B136 indicates that there are rounding inaccuracies occurring with the data type FLOAT for AMOUNT and QUANTITY fields. This issue typically arises due to the way floating-point numbers are represented in computer systems, which can lead to precision errors when performing arithmetic operations.
    
    Cause: Floating-Point Representation: The FLOAT data type uses binary representation, which can lead to rounding errors, especially when dealing with decimal values. This is because some decimal fractions cannot be represented exactly in binary form. Arithmetic Operations: When performing calculations (like addition, subtraction, multiplication, or division) on FLOAT values, the results may not be precise, leading to discrepancies in the final output. Data Conversion: If data is being converted from one type to another (e.g., from FLOAT to DECIMAL), inaccuracies can occur if the conversion does not handle rounding correctly.
    Solution: Use DECIMAL Data Type: Instead of using FLOAT for monetary values or quantities, consider using the DECIMAL data

    Already have an account? Login here!




Instant HelpGet instant SAP help. Sign up for our Free Essentials Plan.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
The AI Support Assistant is great. It provides comprehensive assistance even on the most difficult issues. I highly recommend this service.
Rate 1
John Jordan
SAP Consultant & Author