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

ABAP Unit for Function Module(Function Group)

Former Member
0 Likes
1,011

Hi, Gurus:

Can we use ABAP Unit to test Function Module(Function Group).

If can, give me a simple example. how to create methods. Thanks.

Regards,

1 REPLY 1
Read only

Former Member
0 Likes
337

I'm a little unclear about your question, Yunfa.

Do you want to single-test a SE37 function-module? This can be easily done, just hit the F8 button, and it takes you to a single-test environment.

Do you want to test an FM using an ABAP-program? This too is easy to do. To code the FM-call, there's a button called Pattern, in the standard SE38 screen, where you can put in your FM name, and it inserts the relevant code in your program.

Note that if you're testing BAPIs using the single-test environment, the actual document posting will not happen, because that requires a BAPI_COMMIT_WORK call. So, the way to test BAPIs which post documents would be to write an SE38 program, which also calls the commit-bapi.

Hope this answers your question!