Test function module with data loaded from a file
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:
2. Create a break-point in function module RS_COMPLEX_OBJECT_EDIT:
3. Press F8 to continue. It should stop in the function with the break-point:
4. Inspect variable OBJECT (which is an internal table ) and enter into it with double click:
5. Press the tools icon to access the available tools:
6. Pick tool “Upload from file” and load the desired file (which must have the same structure as the table you’re populating):
7. The table is now populated with the content of your file:
8. Press F8 again to go back to the test screen, now with the table populated and ready for you to run your test:
Thank you Rui Couto for demonstrating this great trick.
Photo: MGI Construction Corp.
Greetings from Abapinho.