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

FM needed

Former Member
0 Likes
630

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
Read only

Former Member
0 Likes
611

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
Read only

Former Member
0 Likes
611

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.

Read only

Former Member
0 Likes
612

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.

Read only

Former Member
0 Likes
611

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.