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: www.sdn.sap.com/irj/sdn/message?messageID=698815
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:
Now you are able to test and debug your function. The output should be like this:
[A, __cC_, B, C, __cC_, D, __cC_, E, __cC_, F]
You see the context changes as real entries in the list.
No comments:
Post a Comment