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

Difference between two amount fields

Former Member
0 Likes
2,272

Hi,

I have got two amount fields and I need to find the difference between those two.

They are in below formats

1.800,00

18,00

Is there any FM to find the difference.

Thanks,

ABAPer.

4 REPLIES 4
Read only

Former Member
0 Likes
1,043

Why do you need a FM for this simple mathematical function, when you can subtract one from another and store it in the resulting variable. Calling a FM will be more lines of Code.

-Aman

Read only

Former Member
0 Likes
1,043

hey,

Just subtract the first number from the second and then store its value in a variable.For this why do you need a FM.

Regards,

Midhun Abraham

Read only

Former Member
0 Likes
1,043

HI,

Simply subtract the two fields on the field.

The resulatant variable will have the result.

Read only

matt
Active Contributor
0 Likes
1,043

What if the two values are type c? So the commas etc. are really in the value. He'll have to convert to type P first, then subtract.

Again - it's programming that solves this - not "function module". How do you think function modules get written in the first place - by programming!