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: 

Change username using SUBMIT program USER via jobname command

Former Member
0 Kudos
1,106

Hi experts,

I have this scenario wherein the user is doing PGI cancellation in VL09, within the userexit I'm using CALL FUNCTION 'FB08' to reverse the FI document of the particular delivery order in process.

However, some users wont have any authorization for FB08.

Let's say user 'ABC' is doing the VL09, would this command: SUBMIT program USER 'BIZTALK' via jobname etc... actually change the username from user ABC(without authorization) to user BIZTALK(with authorization) so that no authorization failure would happen?

Thanks in advance!

2 REPLIES 2

ThomasZloch
Active Contributor
0 Kudos
85

It's worth a try. You can test in your DEV system and study the authorization trace afterwards (ST01).

Thomas

Former Member
0 Kudos
85

Hi,

You can try with similar piece of code as mentioned below to call VL09 report:

DATA: number TYPE tbtcjob-jobcount,

name TYPE tbtcjob-jobname VALUE 'JOB_TEST',

print_parameters TYPE pri_params.

...

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = name

IMPORTING

jobcount = number

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc = 0.

SUBMIT submitable TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

USER user

VIA JOB name NUMBER number

AND RETURN.

IF sy-subrc = 0.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = number

jobname = name

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.

IF sy-subrc <> 0.

...

ENDIF.

ENDIF.

ENDIF.

Thanks & Regards,

Harish