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


SAP Error Message - Details

  • 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:

    1. 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.
    2. 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.
    3. 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:

    1. Use DECIMAL Data Type: Instead of using FLOAT for monetary values or quantities, consider using the DECIMAL data type, which is designed for exact numeric representation and avoids rounding issues. DECIMAL allows you to specify the precision and scale, ensuring that calculations are accurate.
    2. Review Calculations: Check the calculations in your program or report to ensure that they are not inadvertently introducing rounding errors. If necessary, implement rounding functions to control how values are rounded.
    3. Adjust Configuration: If applicable, review the configuration settings in your SAP system related to number formats and rounding rules. Ensure that they are set up to handle the required precision for your business processes.
    4. Data Validation: Implement validation checks to identify and handle rounding errors before they cause issues in reports or transactions.

    Related Information:

    • SAP Notes: Check SAP Notes for any specific patches or updates related to this error message. SAP frequently releases updates that address known issues.
    • Documentation: Review SAP documentation regarding data types and best practices for handling numeric values, especially in financial applications.
    • Testing: Conduct thorough testing after making changes to ensure that the issue is resolved and that no new issues are introduced.

    By addressing the root cause of the rounding inaccuracies and implementing the suggested solutions, you can mitigate the impact of this error in your SAP environment.

    • Do you have any question about this error?


      Upgrade now to chat with this error.


Instant HelpGet instant SAP help. Start your 7-day free trial now.


Related SAP Error Messages

Click the links below to see the following related messages:

Click on this link to search all SAP messages.


Rating
ERPlingo's SAP support assistant is amazing. Saves me countless hours trying to solve complex SAP issues myself. It's a real game changer!
Rate 1
Thomas Michael
SAP Consultant, Author & Speaker