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: 

FM needed

Former Member
0 Kudos

Hi All,

I want to know is there any function module which will take dividend and divisor as input and give outputs are

quotient and remainder?

Regards

Jeetu

1 ACCEPTED SOLUTION

Former Member
0 Kudos

FUNCTION Z_SC_DIV.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(DIVIDEND) TYPE I DEFAULT 0

*" VALUE(DIVISOR) TYPE I DEFAULT 1

*" EXPORTING

*" VALUE(QUOTIENT) TYPE F

*"----


quotient = dividend / divisor.

ENDFUNCTION.

3 REPLIES 3

Former Member
0 Kudos

You can code yourself.

DATA a TYPE I

DATA b TYPE I

DATA divi TYPE I

DATA rem TYPE I

divi = a DIV b.

rem = a MOD b.

Former Member
0 Kudos

FUNCTION Z_SC_DIV.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(DIVIDEND) TYPE I DEFAULT 0

*" VALUE(DIVISOR) TYPE I DEFAULT 1

*" EXPORTING

*" VALUE(QUOTIENT) TYPE F

*"----


quotient = dividend / divisor.

ENDFUNCTION.

Former Member
0 Kudos

Hi,

TO my knowledge Z_SC_DIV is the only one FM present in ABAP to get the output as required or we can code a FM as per our reqirement.

Regards,

Azaz Ali Shaik.