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

Adding Decimals to a Type 'P' value

Former Member
0 Likes
1,620

Hi,

How do I add 2 Decimal places to a Type 'P' value?

I cannot do this in the data declaration step, because of the following:

1. Once the number is determined, there will be another field that will define the number of decimal places.

2. For example, say the value is '1200'. In the other field, it shows us the value '2', which means 2 decimal places. '1200' will have to become '1200.00'.

Please help.

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
872

Hi John,

Try this:-

DATA: num TYPE p DECIMALS 2.

Rgards,

loo

Read only

Former Member
0 Likes
872

hi ,

while declaring packed data type declare its decimal places.

e.g. DATA: P1 type p decimal 2.

Read only

Former Member
0 Likes
872

U can use the command 'CREATE DATA' which is used for dynamic declaration of data.

Get back if u have anymore queries.

Good luck.