Application Development and Automation 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: 
Read only

Type P question

Former Member
0 Likes
1,056

Hi...

I am awfully new on this abap thing and I got a question:

I got this data defined

example (5) TYPE p,

And I don't know if this means that I got 5 decimals after the point (1111,xxxxx) or something else.

Plus, is using "example DECIMALS X" the only way to specify que quantity of decimal my data will have?

And one final question... if I do not specify any DECIMALS that means my TYPE p will have no decimals?

Thank you so much!!!

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
977

In order to define a field with decimals, you must use the DECIMALS extension.

data: field type p decimals 5.

Here you have a field with 5 decimal places.

Regards,

Rich Heilman

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
978

In order to define a field with decimals, you must use the DECIMALS extension.

data: field type p decimals 5.

Here you have a field with 5 decimal places.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
977

Did you see the help, which gives you a example

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

suresh_datti
Active Contributor
0 Likes
977

you HAVE to specify DECIMALS n to display the decimals for TYPE P.

try this sample..

report zptest.

data p_1 type p value '100'.

data p_2(5) type p value '534.56'.

data p_3 type p decimals 2 value '345'.

write 😕 p_1,p_2,p_3.

~Suresh

Read only

Former Member
0 Likes
977

Jimmy,

p length is 16. default no decimals.

DATA: PP TYPE P.

like PP = '123456789123456'.

if you are giving decimals 2, including decimals length should be of 16 characters.

DATA: PP TYPE P decimals 2.

like PP = '1234567891234'.

you can give at max 14 decimals

DATA: PP TYPE P decimals 14.

like PP = '1'.

-Anu