Supported by
Supported by Inetum

Test function module with data loaded from a file

images/thumbnail.jpg - Thumbnail

Transaction SE37 lets you test function modules. Sometimes these function modules use tables. And sometimes you need to load these tables with a lot of data records. But the only way to do it is manually. Or maybe not…

Here’s a trick to do it using a file.

1. In SE37 choose the FM you want to test and entre debug mode:

image

2. Create a break-point in function module RS_COMPLEX_OBJECT_EDIT:

image

3. Press F8 to continue. It should stop in the function with the break-point:

image

4. Inspect variable OBJECT (which is an internal table ) and enter into it with double click:

image

5. Press the tools icon to access the available tools:

image

6. Pick tool “Upload from file” and load the desired file (which must have the same structure as the table you’re populating):

image

7. The table is now populated with the content of your file:

image

8. Press F8 again to go back to the test screen, now with the table populated and ready for you to run your test:

image

Thank you Rui Couto for demonstrating this great trick.

Photo: MGI Construction Corp.

Greetings from Abapinho.