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

Hi

Former Member
0 Likes
526

I need a function module to divide two numbers.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

then you have to write a function module on your own

go to se37 and create a function module

check this link

http://www.saptechnical.com/Tutorials/ABAP/FunctionModule/page1.htm

then you have to write a function module on your own

go to se37 and create a function module

check this link

http://www.saptechnical.com/Tutorials/ABAP/FunctionModule/page1.htm

3 REPLIES 3
Read only

Former Member
0 Likes
508

then you have to write a function module on your own

go to se37 and create a function module

check this link

http://www.saptechnical.com/Tutorials/ABAP/FunctionModule/page1.htm

Read only

GauthamV
Active Contributor
0 Likes
507

hi,

if the requirement is so simple y u want func mod.

u can do it with simple code.

Read only

Former Member
0 Likes
507

Hi ,

You can create a z FM for the same IN SE37.

Go as follows:

import :

parameters A1,B1 , TYPE F , default <ur default valuse>

export

Parameter RES ,TYPE F

Source Code

function zmy_divide.

*"----


""Local interface:

" IMPORTING

" REFERENCE(A1) TYPE F DEFAULT 6

" REFERENCE(B1) TYPE F DEFAULT 4

" EXPORTING

" REFERENCE(RES) TYPE F

" EXCEPTIONS

" DIV_ZERO

*"----


if B1 eq 0.

raise div_zero.

else.

res = A1 / B1.

endif.

endfunction.

Reward if helpful

Manish