2014 Jul 16 6:13 AM
Hello everyone,
I have a simple query for user-exits. Suppose we are executing a main program SAPLZ*** which has multiple user-exits(ZXVV**02, ZXVV**03, ZXVV**04, ZXVV**05), Is there any standard variable defined to know the name of the user-exit currently running or executing?? I tried with variable sy-repid but it gives the name of the main program i.e. SAPLZ***, we are executing and not the name of the user-exit ZXVV**02/03/04...
Any help would be highly appreciated...
Hello everyone,
I have a simple query for user-exits. Suppose we are executing a main program SAPLZ*** which has multiple user-exits(ZXVV**02, ZXVV**03, ZXVV**04, ZXVV**05), Is there any standard variable defined to know the name of the user-exit currently running or executing?? I tried with variable sy-repid but it gives the name of the main program i.e. SAPLZ***, we are executing and not the name of the user-exit ZXVV**02/03/04...
Any help would be highly appreciated...
2014 Jul 16 6:43 AM
Hi Harsh,
Instead of sy-repid use SY-CPROG. This will give you correct include program name.
Regards,
Pravin
2014 Jul 16 7:20 AM
2014 Jul 16 6:48 AM
Harsh,
Not aware if any of the System fields that will capture FM name during the runtime,but through if you use CALL FUNCTION statement to debug then you can get to see all the FM's that are getting triggered including the User Exits.
K.Kiran.
2014 Jul 16 7:17 AM
I believe you meant putting a breakpoint at statement call customer-function.
2014 Jul 16 7:22 AM
2014 Jul 16 7:16 AM
You can read the call stack to get include name.
Try FM SYSTEM_CALLSTACK or equivalent class.
2014 Jul 16 8:14 AM
Not sure if i have misunderstood the question, but, if you want to know the name of the user exit currently running you would have to put a break point in it to stop it there. If it is not "currently running" then you won't have the name but if it is currently running, i.e. currently in the user-exit include then you would already have the name? As i say, may have not got the questoin, very early here and haven't had my first cup of coffee yet.
2014 Jul 17 6:58 AM
Thanks Glen, I actually want to know is the name of the exit is captured in any variable. As my motive here is I will be putting a SELECT query in that user-exit and the table will have entries for multiple user-exits. So when selecting the data from table I don't wants to hardcode the exit name in WHERE clause and hence looking forth that is there any variable which captures the exit name automatically, and I can use that variable.
tried with sy-cprog and sy-repid but they gives the name of the main prog, not useful here.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |