When you try to test a function module via SE37 you get runtime error, but it works fine when incorporated in a...
This happens especially after an upgrade. The table EUFUNC which contains test data gets corruped for some unknown cause. The solution is one of two:
1. Clear the EUFUNC table (to be done by a BASIS person)
2. Remove the affected entry of the table EUFUNC with:
SE37, Function Module -> Test environment -> Delete test data.
Then test the function module. It will work just fine.