Application Development 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: 

To identify the user running the job at runtime

Former Member
0 Kudos

Hi All,

My requirement is to develop a program which need to send mail only if a particular user runs the job.

I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at runtime.

Please suggest me the possible ways of identifying the user running the job at runtime.

Thanks in advance!!!

Regards,

Dinesh.

4 REPLIES 4

former_member201227
Active Participant

Hi Dinesh,

Please check in table TBTCP with the Background Job Name.

The fields SDLUNAME and AUTHCKNAM store the user names.

0 Kudos

You can also check table TBTCO, field SDLUNAME.

~lokesh

former_member201275
Active Contributor

In table TBTCP you can see the job owner (SDLUNAME) and step owner

(AUTHCKNAM) of all batchjobs.

alexander_bolloni
Contributor
0 Kudos

"I need to read the user who runs the job at runtime, i tried with SY-UNAME but it holds the user name of the person who created the job at runtime."

This is not true if your program/form/method is called inside the ABAP report which is executing in the batch job step. There, the active SY-UNAME is the user entered in SM36 as the job step user. It is not the user who planned/scheduled the job.

It is unclear from your description where your program is actually running. Is it another (ABAP) step belonging to the same job or is it actually some routine called within the same job step that you are checking or is it a program totally unrelated to the batch job in question (in that case, check out the other answers about TBTCO/TBTCP)

- Alex