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: 
Read only

Variable to find user-exit name???

Harsh_Jain2512
Participant
0 Likes
1,361

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...


8 REPLIES 8
Read only

Former Member
0 Likes
1,229

Hi Harsh,

Instead of sy-repid use SY-CPROG. This will give you correct include program name.

Regards,

Pravin

Read only

0 Likes
1,229

SY-CPROG gives program name, not include name.

Read only

kiran_k8
Active Contributor
0 Likes
1,229

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.

Read only

Former Member
0 Likes
1,229

I believe you meant putting a breakpoint at statement call customer-function.

Read only

kiran_k8
Active Contributor
0 Likes
1,229

Yes it is supposed to be "call customer-function".

K.Kiran.

Read only

Former Member
0 Likes
1,229

You can read the call stack to get include name.

Try FM SYSTEM_CALLSTACK or equivalent class.

Read only

former_member201275
Active Contributor
0 Likes
1,229

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.

Read only

0 Likes
1,229

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.