Monday, December 10, 2007

How can I test user advanced functions in NWDS?

When you work with User-defined functions in the graphical mapping tool, sometimes the functions become more complex and you want to test or debug these functions in a Java IDE like SAP NetWeaver Developer Studio.

We take this function as example:


This function works like the standard function formatByExample, which is not available beyond SP13. The function caches the whole queue. Therefore we have to deal with context changes.

First you need the library aii_mt_rt.jar. Look at this thread, where to find it:

Now you create a Java Class with a static method. The parameters of the method have to be the same as in the User defined funtion.

You define a main method in this class for testing purpose as well. For the test data you might need context change or suppress in the queues. This can be done with the constants ResultList.CC and ResultList.SUPPRESS.

See an example code here: