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

Error return from JOB_SUBMIT / SUBMIT when running with another username

Former Member
0 Likes
1,710

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

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

4 REPLIES 4
Read only

Former Member
0 Likes
1,068

Hi,

Looks like JOB_OPEN itself has failed because of which the subsequent functions are failing. Does JOB_OPEN is giving the JOBCOUNT.

Regards,

Ravi

Note - Please mark the helpful answers

Read only

0 Likes
1,068

Hi Ravi,

JOB_OPEN does return a jobcount number and a sy-subrc

of 0.

Thanks

Caroline

Read only

0 Likes
1,068

Hi,

I think it should give a JOBCOUNT. However, I am not sure why it is giving a sy-subrc as 0. The Jobcount is required by the subsequent functions.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
1,068

Hello Caroline,

I do not know whether this issue is resolved at your end. I faced a similar problem and found that User Type for the generic user(l_Ernam) was the cause.

We had initially defined User Type for the generic user as a 'Communication' and it was giving return code 8 after SUBMIT.

We later changed the User Type to 'System' and it worked as intended. Job was created under the name of the user who executed the main program and the steps added using the generic user(l_Ernam).

Please note that the user who is running the main program will need authorization to add job steps using the generic user.

With Kind Regards,

Jatin.