Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How could i debug FM which is running by Technical user.

former_member196331
Active Contributor
1,594

hi.
Need suggestions. I have created one FM. this is called by External system.
Some how, the output is not giving... it is having some condition inside..
Exactly where it is stopping not able to find. but this is run by Technical user. User type B system not dialog
so, even though if i put external break point with this user. I cannot debug it.
I try to check St12. I think by using St12 also. only normal user we can do the trace.
But i want to need to debug of Technical user. is there any way to do debug it.

12 REPLIES 12

DominikTylczyn
SAP Champion
SAP Champion
1,443

Hello newb

The tool that I like to use in situations like yours is the FBGENDAT report. It's described in the note 517767 - Generate test data for function modulesYou need to implement two changes in your function module to use it:

  1. include fbgenmac into the function group of your function module
  2. add fbgenmac '<name of your function>' at the very beginning of the function

Then you need to activate the test data generation by setting user parameter FBGENDAT to X. It needs to be set for the user with which the function is called.

Next, activate the generation for the function with FBGENDAT report. Those are the two fist points of the 517767 note.

When you activate like this, during next function call all the input data will be recorded in the test data directory of the function. So then, you can go to SE37, test your function and get the data with "Test data directory" button.

I've found this approach very useful and it helped me several times.

Best regards

Dominik Tylczynski

matt
Active Contributor
1,443

Is this recommended even in a production system?

1,443
matthew.billingham

I'm not aware of any SAP official recommendations here. But I can see no reason why that approach could not be used in production. Of course the test data generation should be deactivated when not needed, the test data should be deleted afterwards as it might be confidential etc. I have used that in production to pin point issues with interfaces.

matt
Active Contributor
0 Kudos
1,443

Do you know the parameters by which the FM is being called?

former_member196331
Active Contributor
0 Kudos
1,443

yes.. i know the inputs... if i pass same inputs in se37 it's working fine...
did not find any issue...

FredericGirod
Active Contributor
1,443

maybe a little STAUTHTRACE

Sandra_Rossi
Active Contributor
0 Kudos
1,443

or copy technical user to new temporary user TEMP, change to dialog type, connect with it, start external debug /HEXT ... (note 1919888), and debug with your own user (in case TEMP has no authorization to debug), and delete TEMP when you're done.

former_member196331
Active Contributor
0 Kudos
1,443

Some how got little bit progress.. added infinity loop at the beginning. then ask user to trigger the fm. then Sm50 i can able to see the fm calling , i debugged it. It is having conditions.. this condition is not met. this is the reason. Now got the problem... But.. biggest wonder. is. sm50..if i login.. i did not see the log of the z fm..but one of my colleague if he able to see sm50 he can able to see it. i did not understood. I took his credentials.. then open sm50 same from my system. issue. not able to see the log of z fm in sm50. How this happened i did not see. there is alv grid.. there is no filters also. System wise how differently behaving.. Anybody having What is the exact issue. Su53 also i opened in the next session. did not see any missing authorizations. I can able to see other users and technical useres logs. but one specific user(that z fm is calling that technical user i am not able to see) .Still no clarity.. Need answer. just for testing.. from my system. i called zfm. now fm having infinity loop. if i see sm50 i can able to see. but if somebody called from third party system. only to me. not able to see sm50 log. my colleague able to see it with his user credentials and with his system.

matt
Active Contributor
1,443

If you do not see the same SM50 as your colleague then your system most likely has more than one application server and you are on a different one from your colleague.
You can use SM51 to switch application servers and check them all.

To trace authorisations don't use SU53, use ST01, setting the filter to be the RFC userid. You need to do this on each application server.

SimoneMilesi
Active Contributor
0 Kudos
1,443

You can add an external breakpoint on the user's username and ask her to do the call so you can debug on the fly the code as she's running it.

former_member196331
Active Contributor
0 Kudos
1,443

this is running by technical user.Even if u try also.. it will accept.. it won't accept. I tried to put but. not taking..

Sandra_Rossi
Active Contributor
0 Kudos
1,443

that's not very clear 😄