Skip to Content

CURR (10,2) what values can go into this data type?

Hi All,

If I have a variable of CURR(10,2) what is the correct values that can go into this variable?

A.) 12 characters in total. 10 whole numbers with 2 decimal places.

B.) 10 characters in total. 8 whole numbers with 2 decimal places.

I have encountered this dump in our system:

Short Text
SQL error "SQL code: 1438" occurred while accessing table "/ACNLQD/NUMRANGE".

What happened?
Database error text: "SQL message: ORA-01438: value larger than specified
precision allowed for this column"

Per checking for values that didn't dump, there was a field in the table that had a value 8 whole numbers and 2 decimal places. But for the dump encountered, the variable/field had 9 whole numbers and 2 decimal places(a total of 11). Is this what's causing the dump in our system? Thank you.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jul 20, 2020 at 12:59 PM

    The correct is 10 characters, 8 whole numbers with 2 decimal places.

    Take a look in the help: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenddic_currency_field.htm

    The CURR type is stored like DEC type. The DEC type is stored as a packed number.

    Numeric data type for saving fixed point numbers with a fixed number of decimal places or a number saved in a similar way. The associated predefined ABAP type is p. The number of decimal places is a property of the data type and not (as withfloating point numbers) a property of the data itself. Calculations with packed numbers are made using fixed point arithmetic. The internal representation uses the BCD format.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2020 at 12:56 PM

    CURR(10,2) corresponds to a total number of 10 digits including the 2 decimals.

    But the ABAP variable occupies 6 bytes (10 half bytes + 1 half byte for sign = 11 half bytes = 6 bytes), so it may occupy up to 11 digits (including the decimals), the short dump happens when the 11th leftmost digit is not zero.

    SAP recommends (below SAP notes for instance) to never define packed fields with an even number of digits because of that (prefer CURR(11,2) or CURR(13,2), etc.)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 20, 2020 at 01:07 PM

    Katherine Darunday,

    The correct answer is option B.

    B.) 10 characters in total. 8 whole numbers with 2 decimal places.

    One simple way to check is create a test program with parameter and assign the necessary datatype (CURR 10,2). Now try entering the digits, when you enter 8 digits system does not throw any error and allot the remaining two places (.00) for decimal. Once you enter the 9th digit system will err.

    And yes your assumption on the dump is right, it is due to the value with 9 digits and 2 decimal places.

    Regards!

    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.