Skip to Content
0
Former Member
May 02, 2006 at 09:50 AM

Error return from JOB_SUBMIT / SUBMIT when running with another username

509 Views

I am trying to run the program RSBDCSUB after setting up a BDC session.

Due to our authorisations in the production environment I have to run this program under a generic user (l_ernam) that has the authorisations as most users do not.

Here is the code I am using:

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = l_jobname

IMPORTING

JOBCOUNT = l_jobcount

CHANGING

RET = l_ret

EXCEPTIONS

CANT_CREATE_JOB = 1

INVALID_JOB_DATA = 2

JOBNAME_MISSING = 3

OTHERS = 4

.

Submit RSBDCSUB And Return

User l_Ernam

Via Job l_Jobname Number l_Jobcount

with mappe = l_mappe .

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = l_jobcount

jobname = l_jobname

STRTIMMED = 'X'

EXCEPTIONS

CANT_START_IMMEDIATE = 1

INVALID_STARTDATE = 2

JOBNAME_MISSING = 3

JOB_CLOSE_FAILED = 4

JOB_NOSTEPS = 5

JOB_NOTEX = 6

LOCK_FAILED = 7

OTHERS = 8

.

When I run this with a restricted user I get a return of 8 from the submit rsbdcsub - has anyone seen this before and can you offer advice on how to solve it?.

I have also tried using JOB_SUBMIT with the following settings instead

CALL FUNCTION 'JOB_SUBMIT'

EXPORTING

authcknam = l_ernam

jobcount = l_jobcount

jobname = l_jobname

REPORT = l_report

VARIANT = l_variant

EXCEPTIONS

BAD_PRIPARAMS = 1

BAD_XPGFLAGS = 2

INVALID_JOBDATA = 3

JOBNAME_MISSING = 4

JOB_NOTEX = 5

JOB_SUBMIT_FAILED = 6

LOCK_FAILED = 7

PROGRAM_MISSING = 8

PROG_ABAP_AND_EXTPG_SET = 9

OTHERS = 10

.

and in this case get a return of 3 (INVALID_JOBDATA) - anyone any ideas as to how to resolve this?.