We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
... $[USER user$] VIA JOB job NUMBER n $[LANGUAGE lang$] ...
1. ... USER user
2. ... LANGUAGE lang
This addition schedules the execution of the called program as a background task with the number n in the background request job. The number n for a background request job must be obtained using the function module JOB_OPEN from the function pool BTCH. The complete program is not processed directly but in a background session in accordance with the parameters for the background request and is not processed directly. The addition VIA JOB can only be used together with the addition AND RETURN.
The called program is scheduled and executed in three steps:
If a basic list is created in the called program, a
spool request
should be created with explicitly passed spool parameters by specifying TO
SAP-SPOOL at the same time. Otherwise, the addition VIA JOB creates a spool request implicitly
that derives its spool parameters from standard values, some of which are taken from the user defaults, and are not necessarily consistent.
System Fields
sy-subrc | Meaning |
0 | Background task was scheduled successfully. |
4 | Scheduling was terminated by the user on the selection screen. |
8 | Error during the scheduling, that is during the internal call of JOB_SUBMIT. |
12 | Error during internal number assignment |
Scheduling of a program demo_submitable as a background task with the number number in a background request name. After scheduling, the background task is completed by the function module JOB_CLOSE and released immediately, providing the user has the relevant authorization.
The following code snippet shows, how the background task can be analyzed.
... USER user
The optional addition USER can be used to specify a user name user of the type sy-uname under whose name the logon to the background session takes place and whose authorizations are used to execute the background task. If USER is not specified, the user name of the current user session is used.
... LANGUAGE lang
This addition sets the logon language of the background session in which the called program is executed. If the addition LANGUAGE is not specified, the text environment language of the current internal session is used.
lang expects a character-like data object that contains a language key with a length of one character in the first place and this value must be contained in the column SPRAS of the database table T002. If the data object lang contains a blank at the first position, the logon language of the current user is used.
If the function module JOB_SUBMIT is called internally, its optional parameter LANGUAGE is passed the first position of lang.
This statement
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
LANGUAGE langu
AND RETURN.
has the same effect as the following function module call:
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = number
jobname = name
language = langu
priparams = print_parameters
report = 'SUBMITABLE'.
Leave us your contact details and we will call you back. Fields marked with * are mandatory.
We offer holistic SAP solutions from a single source to shape digital change and develop new business areas.
Switzerland
Schaffhausen
Germany
Mannheim, Düsseldorf, Munich
USA
Haverhill
Greece
Thessaloniki