Contributed by: Sérgio Serra, SAP ABAP Developer at RTL Group, Luxembourg.
Today, we would look into a very useful tip in ABAP which I did not know in my more than a decade-long SAP career. As we keep on saying, no one can know everything in ABAP. If someone claims s/he knows almost everything in ABAP then either s/he is lying or s/he is GOD! Reverve her/him. 🙂
The other day, one of our end user reported an issue in one of our application program in our pre-production system. Everything worked properly and as per business need in development and quality system. But something went wrong in pre-production. I did not have the authorization to execute the t-code/program in my pre-production system (as it was the copy of actual production system). Being a developer, I had debug access and wanted to debug and see what was going wrong but I could not as I did not have the authorization to execute the t-code/program. The other problem was, the user being an end user, did not have authorization to Debug.
This was a catch 22 situation. The user can execute but cannot debug. I can debug but cannot execute. And the user was on the west coast of the country and at that time I was at the eastern part of our country.
The easiest alternative would have been to raise a service request to get authorization for me to execute the t-code in pre-prod. But it would have taken some time to get the approvals from all departments.
Luckily one of my friends told me he read something about /hext user = username somewhere. This gives the person who executes this command to allow the other user mentioned in the command line to take over his/her session and debug.
Confused?? Let us take a real example with real names.
Say Business end user’s name is Karyn (sap user id 00217) and Developer’s name is Sergio (sap user id 00951).
Since Karyn has the authorization to execute the t-code, she will put the command as /hext user = 00951 in her system in SAP sitting far away on the west coast. Important to notice here is, she put the user id of Sergio, not herself. This means she would like Sergio to do the Debugging. She would just enable the debugger and execute the session.
PS: There should be a space between /hext and user and = and username.
Since Sergio wants to debug he needs to put an external break point in his system.
Since Sergio wants to debug a session of Karyn, he needs to maintain Karyn’s id in the External Debugger username as shown below.
If you get the message “You are not authorized for the external debugging of user 00217” while trying to save the other user’s id, then go to the bottom of this post for another trick. Bonus Trick. 🙂
Now ask Karyn (end user) to execute the t-code and enter the command /hext user = 00951.
In the above screen shot check at the bottom right, it has Karyn’s user id (00217) and in the command, we wrote Sergio’s user id (00951).
She will get a below pop up message. Basically, it is a warning to the user that his/her session would be debugged by someone else.
Ask her to press ok and execute the program. The moment she hits the execute button.. abracadabra…
You would see a debugging session on your screen far away on the east coast as shown below. 🙂
Check at the bottom right of the below screenshot, it has Sergio’s user id (00951).
Now, you are a happy ABAPer. Debug, get the root cause and provide the solution. No need of screen share, not need to get special approval to execute the program and no need to be on the same machine/system and no need to be in the same location. How convenient. Isn’t it? 🙂
The end user, Karyn should not cancel the session in her machine when Sergio is debugging. If she cancels or exits from it, then the debugging session will end at Sergio’s end. In case, Karyn really wants to forcefully exit, she can put the command /hx and both of them would exit.
Now the bonus tip for today which we promised above. If you ever get the error message “You are not authorized for the external debugging of user XXXXX”, go to se37 and open FM “SUSR_CHECK_DEBUG_ABILITY”. Put a debugger as shown below.
Do your activity again, i.e assign another user and hit OK.
It will stop at the breakpoint in the FM. Just change the SY-SUBRC to 0. You are done. 🙂
Of all the power give to ABAPers, I think, Debug with Replace is the strongest one. This is key to any closed doors for the ABAPers.
But as Spiderman said, “With great power comes great responsibility”. So it is our duty to not misuse it but use it responsibly.
Viva os ABAPers (Long live the ABAPers in Portuguese)!!
We put a lot of effort in conceptualizing, testing and writing each and every article. If you could pass this link to at least 5 colleagues/friends who you think would benefit from our post, it would be a great favor to our team. We want our articles to reach to as many audiences as possible so that everyone would benefit and our team would remain motivated and our work does not get lost in this huge ocean of the internet.
Please, please share our post in your professional and social media and introduce your friends/colleagues/co-workers to our blog page.
Also, check our popular step by step tutorials on some of the important topics of SAP ABAP.
1. ABAP for SAP HANA Tutorials
2. ABAP Web Dynpro Tutorials
3. GOS Tutorial
4. OOPs ABAP Tutorial
5. HANA Tutorial
6. SAP Netweaver and OData Tutorial
7. SAP Adobe Form Tutorial
8. SAP Fiori Tutorial
9. SAPUI5 Tutorial
10. SAP Screen Personas Tutorials
About the Author: Sérgio Serra
Sérgio is SAP Certified Consultant who was pursuing a Computer Sciences Engineering Degree at the reputed Instituto Superior Técnico, Portugal. He has more than 11 years of IT experience and loves to adapt to the spirit of the client.