‎2008 Apr 07 1:59 PM
Hello I am using following to create a background job.
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'METZ: INVOICING FROM SHIPMENT',
print_parameters TYPE pri_params.
data vari LIKE varid-variant.
data shipm LIKE vttk-tknum.
data use LIKE btch2170-username.
vari = '3350_1' .
shipm = p_shipment.
use = 'K5_BATCH'.
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 Z5L_START_INVOICING with p_shipm = shipm
with p_vari = vari
with p_submit = 'X'
USER use 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.
I am using the addition USER but the job gets started with user who is log on or who is using this trasaction.
It should start with user 'K5_BATCH' but it is not...........
Please help........
Edited by: Alvaro Tejada Galindo on Apr 7, 2008 1:00 PM
‎2008 Apr 07 2:07 PM
Hi,
Question: Does the following userid 'K5_BATCH' existe on your system ad withcorrect authorizations ?
Regards
‎2008 Apr 07 2:10 PM
‎2008 Apr 07 2:18 PM
I found the following info:
Open Job Scheduling Without Dialog (Including COMMIT WORK)
Use JOB_OPEN to create a background job. The function module returns the unique ID number which, together with the job name, is required for identifying the job.
Once you have "opened" a job, you can add job steps to it with JOB_SUBMIT and submit the job for processing with JOB_CLOSE.
I think you will first have to use the JOB_SUBMIT statement like mentioned above
‎2008 Apr 07 2:33 PM
JOB_SUBMIT is done internally when you write Submit.....with....USER....VIA JOB....
Currently job is working fine but with Sy.uname and not with user i am specifying in SUBMIT statement.
‎2008 Apr 07 2:42 PM
Well if you think that everyting is ok. the last thing that you could do is to debug your application and see why your specific user id is not taken into account.
Good luck with debugging
Regards