‎2007 May 17 2:33 PM
Hi,
I am currently executing a report in background using JOB_OPEN SUBMIT and JOB_CLOSE. My cureent user-iD is 'NAXDD', but i am submitting the job using another user-ID.
For example : v_user is defined as follows :
data : v_user TYPE sy-uname VALUE 'PATPA'.
No I submit the job using v_user but the sy-subrc value that is returned is 8
but when i execute with my user id NAXDD, then it works fine.
SUBMIT ABC_analysis AND RETURN
USER v_user
VIA JOB p_c_a_corfor
NUMBER jobnummer
WITH jobnr = p_c_a_corfor.
Is it a problem with the v_user declaration? Or what could be the possible reasons? Please help....Points to be awarded to the best answer...
‎2007 May 17 4:15 PM
while defining that job p_c_a_corfor, in sm37, on the screen which u give the program name and variant etc, try changing user to PATPA.
i am sure, it will work perfect if that job is scheduled... not sure, what happens, when such a job is called using submit... .. just give a try
‎2007 May 17 3:11 PM
I think it basically work with Log in User name...
You can log in with another user name and then give ur own user name..then also it won't work..
PRa
‎2007 May 17 3:23 PM
Does the other user have the same permissions as you? It is possible that he or she does not have authorization to submit programs in that client.
- April King
‎2007 May 17 4:00 PM
Hi,
April King : The other user has the same authorization as mine.
Praneet : So how do we schdule with a specific user then? Is there any method to go about this as this is what our requirement is.
‎2007 May 17 4:24 PM
Instead of doing a SUBMIT, have you tried using the function modules JOB_OPEN, JOB_SUBMIT, and JOB_CLOSE? You can pass the user name to JOB_SUBMIT using field AUTHCKNAM.
- April
‎2007 May 17 4:15 PM
while defining that job p_c_a_corfor, in sm37, on the screen which u give the program name and variant etc, try changing user to PATPA.
i am sure, it will work perfect if that job is scheduled... not sure, what happens, when such a job is called using submit... .. just give a try
‎2007 May 17 4:18 PM
Hi debaprasad,
1. Ideally the user syntax should not create any problem.
2. The problem may be with the normal job scheduling,
using JOB_OPEN, Submit and JOB_CLOSE
3. Just remove the USER V_USER
(from your submit and then try)
regards,
amit m.
‎2007 May 17 4:22 PM
SUBMIT ABC_analysis AND RETURN
with logall = 'X'
USER v_user
VIA JOB p_c_a_corfor
NUMBER jobnummer
WITH jobnr = p_c_a_corfor.
Use above query ,you will get it now
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 17 4:48 PM
I tried with the JOB_SUBMIT FM, here too it gives a sy-subrc = 8. Also i tried with the logall = 'X'. But still it gives a sy-subrc = 8.
I think Praneet might be right, only that user can submit the job, although I am not very sure. (after trying all these options)...If there are please let me know so that I can try a few more.
‎2007 May 17 5:00 PM
I saw the Function module code ,
they are comparing sy-uname with ur passing user name..
if both are same then it will trigger
otherwise it gives error message
‎2007 May 17 5:24 PM
Try this..........
DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
L_RELEASE(1) TYPE c.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = 'ZTST1'
IMPORTING
JOBCOUNT = P_JOBCNT
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SUBMIT ZNTEST VIA JOB 'ZTST1' NUMBER P_JOBCNT
USER 'ELIGETV'
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
WITH DESTINATION = 'HPMISPRT'
WITH IMMEDIATELY = SPACE
WITH KEEP_IN_SPOOL = 'X' AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = P_JOBCNT
JOBNAME = 'ZTST1'
STRTIMMED = 'X'
PRDMINS = 15
IMPORTING
JOB_WAS_RELEASED = L_RELEASE
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2007 May 25 10:57 AM
Hi,
If the User does not have the authorization to execute other USERS, then he cannot submit jobs on their behalf.
Thus one should have the sufficient athorization to submit jobs (using one user ID) to execute with another USER. This setting can be taken care by the Basis guys.