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: 

Remove of decimal point from the variable.

Former Member
0 Kudos

Hello There,

In my program I am using the currency conversion function module to convert the currency which is " BAPI_CURRENCY_CONV_TO_Internal".

When I pass the 100 value to the function module then it's returning the value 10000.00, But I want to display 10000 not the decimal point.

Is any function module to remove the decimal point ? or any other solution for this.

Please guide me in this issue..

4 REPLIES 4

Former Member
0 Kudos

take it in a type p variable.

data ; temp type p ."you can use decimals 0 also

temp = <originalval>.

write : / temp

regards

shiba dutta

Former Member
0 Kudos

data lv_value type p length 10 decimals 2 value 10000.

data lv_swap type char20.

write lv_value to lv_swap left-justified.

replace '.' with SPACE in lv_swap.

condense lv_swap.

READY

Former Member
0 Kudos

Do you want to show 10000 or 1000000 ?

SAP stores currency amounts with 2 decimal places, but if you output them with the CURRENCY qualifier, then it outputs correctly.

field = 12.34.

WRITE field CURRENCY 'USD' 12.34

WRITE field CURRENCY 'JPY' 1,234

Former Member

Hi,

Simply write like this,

data: a type p decimals 2 value '12.33'.

write a decimals 0.

Reward if useful!