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

Organizing source code for Unit Tests of a function group

michael_habermueller
Product and Topic Expert
Product and Topic Expert
0 Likes
426

Hello,

I want to use abap unit to test a group of function modules contained in a fucntion group.

Actually I do add the local class definition and implementation to the top include of the function group, because I do have problems in creating a new include containing the test classes.

What is the recommendation for organihzing unit test for a function module. How can I name the include correctly ?

Best regards

Michael

1 REPLY 1
Read only

former_member183804
Active Contributor
0 Likes
309

Hello Michael,

the top include of a function group must contain definition only! It is highly recommended not to put there any executable code as forms, methods whatever.

Just add an include to the function group and put test class definition and test class implementation into this new include.

Best Regards

Klaus

One can add an include by the following procdure.

  • double click on the function group in SE80 => a popup will appear

  • confirm the popup => the function group main include will be opended in the edior

  • there should be some include statetments and some standard comments for adding includes with a certain naming pattern

  • uncomment such a line and complete the pattern (adding 2 digits)

  • save, double click on the new line => a warning (see bottom line) will be raised

  • confirm the warning by pressing RETURN => new include gets created and opened in editor