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

how to test a function module?

Former Member
0 Likes
8,599

how to test a function module?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,440

Hi,

Go to SE37

enter FM name.

pass input parameters and table values where required and press F8.

this will show result in output parameters.

8 REPLIES 8
Read only

Former Member
0 Likes
4,440

by executing the function module and giving the required fields as input.

Read only

Former Member
0 Likes
4,441

Hi,

Go to SE37

enter FM name.

pass input parameters and table values where required and press F8.

this will show result in output parameters.

Read only

anversha_s
Active Contributor
0 Likes
4,440

Hi,

go to SE37.

give the function module.

click DISPLAY.

Execute the FM.

give proper values.

Test it.

regards

Anver

if hlped pls mark points

Read only

Former Member
0 Likes
4,440

Hello,

In SE37, Press F8 and give the required inputs...

Vasanth

Read only

Former Member
0 Likes
4,440
Read only

Former Member
0 Likes
4,440

Click on the debugger(F8)

Read only

Former Member
0 Likes
4,440

You should use the test environment in the Function Builder to test new function modules before releasing them for general use. You can also use the test environment to examine functions written by other developers before calling these modules from within your own programs. The library's testing options let you determine if a function performs as it should and shows you if the module returns expected results. To run a test:

Choose Test from the Function Builder initial screen.

Specify the data you want to transfer from your program to the function module.

Choose Execute

The Function Builder contains more test options than simply running a function module. You can also run a test in the debugger or create a runtime analysis performance file for a function. To investigate a function module in debugging mode:

Choose Test from the Function Builder initial screen.

Specify the data you want to transfer from your program to the function module.

Select Debugging.

The system executes the function module in debugging mode. You can step through the function's code and use all the options offered within the Debugger

Have a lok at below link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/801f36454211d189710000e8322d00/content.htm

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
4,440

hi there,

ur query is quite old and i think some1 may hav answers it but still i feel this might help you if ur query is still unanswered.

its a total description of how to create a fuction module and executre the same

its a simple example and might help you to understand what and how the things are happening.

see this might be of some help.

to create function module you have to create a a function group.

and then you create function module.

in function module you have to give IMPORT , EXPORT PARAMETER and EXCEPTION.

and also the SOURCE CODE without which the function module will be sytaxtically correct but you will get processing error.

here is the procedure of creating Function Group and Function Module

FOR Group

goto SE37

move to GOTO and the to function groups and create .

just fill the fields poped up.

FOR Module

now in the se37 screen put the name of the function module you want to create and press create .

there will be a pop asking for function group name now here put you function group name which you have created.

now after pressing save you will have a screen in which you have to enter the import, export,exception and the source code.

in import parameter you can put this(for example)

parameter type associate type

num1 type i

num2 type i

export parameter

parameter type associate type

res type i

exception

parameter type associate type

not a valid entry.

source code

res = num1+num2.

if num1 eq 0

raise not a valid entry.

end if

save activate .

and exicute(press8)

award pionts only if helpful

anuj