Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

issue with decimal and integer part holding for a variable

Former Member
0 Kudos

Hi,

I want volume field to hold 10 digits at the integer part and 8 digits at the decimal part , please suggest what type can I use.

I know type P decimals 8 , but using this we can have only 6 digits at the integer and 8 digit at the decimal as the max is 14 digits.

Thanks,

RG

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

My 2 cents as Clemens would say: that's fun that nobody corrected what you said... If you just look at the ABAP documentation, you'll see that the default total lengh of a P field is 8 bytes, which means up to a total of 15 digits whatever the number of digits after the decimal separator, but you can extend it to 16 bytes, i.e 31 digits. So, if you define 8 digits after the decimal separator, you may have up to 23 digits before the decimal point. DATA packTYPE p LENGTH 16 DECIMALS 8. Or DATA pack(16) TYPE p DECIMALS 8.

9 REPLIES 9

Ashg1402
Contributor
0 Kudos

Hi,

Why don't you create a <ZFIELD> and domain.

Former Member
0 Kudos

This message was moderated.

pranay570708
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi ,

Thanks for your  replies , I am basically multiplying length width and height and passing it to volume, so I cannot operate using the integer part and decimal part separately.

Thanks,

RG

0 Kudos

This message was moderated.

former_member197916
Active Participant
0 Kudos

This message was moderated.

thanga_prakash
Active Contributor
0 Kudos

This message was moderated.

Clemenss
Active Contributor
0 Kudos

What is the business case fot this weird requirement?

Give some examples so maybe make it understood.

Regards Clemens

Sandra_Rossi
Active Contributor
0 Kudos

My 2 cents as Clemens would say: that's fun that nobody corrected what you said... If you just look at the ABAP documentation, you'll see that the default total lengh of a P field is 8 bytes, which means up to a total of 15 digits whatever the number of digits after the decimal separator, but you can extend it to 16 bytes, i.e 31 digits. So, if you define 8 digits after the decimal separator, you may have up to 23 digits before the decimal point. DATA packTYPE p LENGTH 16 DECIMALS 8. Or DATA pack(16) TYPE p DECIMALS 8.