Skip to Content
Author's profile photo Lars Gerrit Meyer

save test data for function module via debugger

This document describes how to save test data via debugger for function modules. There is already a similar document posted here:

https://wiki.scn.sap.com/wiki/display/CRM/Saving+test+data+with+New+ABAP+Debugger But I think, it is hard to find and in this document it looks like a CRM specific feature which is not the case.

Background:

It is often useful to reproduce the behaviour of function modules. It happens often that they are called very deep in call stack and reproduction can be very hard. Besides often you want to change e.g. import parameter (to test if one parameter setting is the reason) which is not possible in Debugger. For these reasons it is good to save test data for later use.

How To:

In Debugger:

1. Click on tools symbol

/wp-content/uploads/2016/04/4_929106.png

2. Click on “save data as test data”

/wp-content/uploads/2016/04/2_929107.png

3. Enter a name

/wp-content/uploads/2016/04/3_929108.png

4. If you call the function module via SE37 and click on “test data directory” your new test data are displayed and can be used

/wp-content/uploads/2016/04/5_929109.png

/wp-content/uploads/2016/04/13_04__2016_14_49_15_929110.png

Assigned tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Arto Pihlaja
      Arto Pihlaja

      Any idea why it's not available in the Class Builder?

      I also discovered that import parameters are truncated to 200 characters, which is way too short for, say, json or xml.

      Author's profile photo Lars Gerrit Meyer
      Lars Gerrit Meyer
      Blog Post Author

      Hello Arto,

      I have no idea. I also would like to have the feature to save test data for methods/classes.

      Author's profile photo Sue Morton
      Sue Morton

      Learned something new and very useful from this.  Thank you for pointing out this feature.