I have written an ABAP function module, which works fine if I execute it with my developer account.
If another user executes it, he gets an empty result. The other user is an RFC-account which cannot log in with the SAP GUI.
I am clueless how to debug this. How can I execute/debug a function module and pretend to be a different user?
I am using the Windows-native SAP GUI and transaction code SE80.
If the SAP user is defined as type "Dialog" or "Service" (transaction code SU01) then it's technically feasible to use the SAP GUI (log in with that user and debug).
If the SAP user is defined as type "Communication" or "System" then it's not possible at all.
You can see that as a security measure: if you have a Web Service which runs under a given SAP user, it should not be possible that this user is used for direct SAP GUI usage, to limit possible attacks.
So, I think the only reasonable solution is to use temporarily another SAP user of type "Service" for instance, or change the type of the SAP user, for the duration of the debug.
It's possible to debug another user by selecting the user to debug, either via Eclipse ADT debug properties, or via the ABAP Workbench ABAP Debug Settings, depending on the Integrated Development Environment you are using.
Another solution is, if you have the possibility to change your code temporarily, to add an endless loop (DO. ENDDO.), debug the running program via the transaction SM50, menu Administration -> Program -> Debugging, which should open a debug dialog which points at the loop, place the cursor on the line after the loop and press F12 to continue from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With