cancel
Showing results for 
Search instead for 
Did you mean: 

What is the difference between Length, Decimal Places, Output Length?

yalcin_mete
Participant
0 Kudos

Hi Masters,

Does "Length" or "Output Length" determine the maximum length that a variable type can have?
Does Output Length mean including the value after the comma (decimal)? Or is it length?
What is the maximum value I can give for this domain? Can I show the value 1234567891234.12?
Where should I look for the integer part?

 

yalcin_mete_1-1715870102970.png


yalcin_mete_2-1715870138277.png

 

yalcin_mete_3-1715870154817.png

 

Thanks

 

 

DominikTylczyn
Active Contributor
0 Kudos

deleted

Accepted Solutions (1)

Accepted Solutions (1)

DominikTylczyn
Active Contributor

Hello @yalcin_mete 

Length is the domain length including decimal places excluding format characters.

In your case, the domain is WERT11, length 11, decimal places 2. It means you can store there 9 digits of integer part. 

Output length is 14, which includes format characters i.e. thousands separator and decimal point:

  • 123.456.789,00
  • 123,456,789.00

depending on your decimal notation setting.

Best regards

Dominik Tylczynski

yalcin_mete
Participant
0 Kudos
Thank you 🙂

Answers (2)

Answers (2)

nitschket
Advisor
Advisor

To add to it in a broader context:

  • Length - as explained - is the maximum length as you might know it from other programming languages. There are examples for packed numbers in the other comments but it is also valid for character-like domains, for example. SSTRING 10 would mean you can store a maximum of 10 characters in a string. CHAR 10 would mean a character sequence of 10 characters (exactly 10, by the way).
  • The output length has been introduced in times where SAPGUI was the main user interface technology. The value is used in the screen painter to determine how much space must be provided on UI. For the packed numbers the examples can be understood. But there is another use case: domains may carry conversion exits translating the internal representation of a variable to a UI representation - and the latter could have a different length. Even nowadays, the information is used by SAP Gateway to determine the MaxLength facet of a type in an OData service.  
TuncayKaraca
Active Contributor

Hi Yalçın,

"Length" determines the maximum length that a variable type can have. So in your example field NETPR(11,2) with CURR type can hold value max 11 like 123456789.12 or 123456789.00 *

"Output Length" is determines the length for the display including thousand and decimals separators. For examples above like 123,456,789.12 or 123,456,789.00 which are 14 length. *

*Just corrected examples with Sandra's warnings. Thanks.

Regards,
Tuncay

Sandra_Rossi
Active Contributor
No, NETPR(11,2) means a total of 11 digits maximum, of which 2 are decimals.
TuncayKaraca
Active Contributor
@Sandra_Rossi You are right. I read what I wrote it carefully. What I meant for "Length" and my examples don't match! Thanks for the warning!