cancel
Showing results for 
Search instead for 
Did you mean: 

6 Decimal field only to but whould only like to display 2 decimals

Former Member
0 Kudos

I have quite a few elements on a UI ELEMET type : TABLE that have the following attributes:

DataType :DEC

Length :14

Decimal Places :7

This attributes are nessesary to work out percentage and amount for a increase and needs to be 7 decimals to be able to do the calculation from any angle :

Take $12 353.00 with increase of $588.00 then the persentage will be : 4.7599773%

we have to store 4.7599773% on the data base, *but whould only like to display 2 decimals* in WEB DYNPRO

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for the replies, but let me rephrase my query.

We have a Z-Table with a field that has 6 decimals places. we need this to make sure our calculations are correct. we then want to output this field in webdynpro , but it must only show 2 decimal places.

Regards

Former Member
0 Kudos

Hi,

G_DECIMAL_PLACES_GET

use above mentioned function module it you need to convert dec to currency then you need to use this function module.

or as per saran said u create the concept in function module then you can use that in Web Dynpro.

Thanks & Regards,

Srini.

saravanan_narayanan
Active Contributor
0 Kudos

I doubt whether webdynpro supports this functionality. But core ABAP does. Before populating the data into the context, you can do the conversion. For this you need to declare a local variable of type "P decimals 2" (data lv_percentage TYPE p DECIMALS 2). then you can assign the DB data into this variable and ABAP will do the implicity data conversion.


data lv_percentage type p decimals 2.
data lv_db_data type DEC. 
lv_db_data = 4.7599773.
lv_percentage = lv_db_data.

BR, Saravanan