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: 

Adding Decimals to a Type 'P' value

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi John,

Try this:-

DATA: num TYPE p DECIMALS 2.

Rgards,

loo

Former Member
0 Kudos

hi ,

while declaring packed data type declare its decimal places.

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

Former Member
0 Kudos

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

Get back if u have anymore queries.

Good luck.