Get Example source ABAP code based on a different SAP table
• VIA JOB NUMBER SUBMIT
SUBMIT>, job_options> Short Reference >
ABAP_SYNTAX ... $[USER user$] VIA JOB job NUMBER n $[LANGUAGE lang$] ...>
ABAP Addition 1 ... USER user> 2 ... LANGUAGE lang>
What does it do? 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: The addition VIA JOB> also loads the called program in a separate ABAP_ISESS > when the statement SUBMIT> is executed, and all steps located before START-OF-SELECTION>> are executed. This means the events LOAD-OF-PROGRAM>> and INITIALIZATION>> are raised, and selection screen processing> is performed. If the selection screen is not processed in the background because VIA SELECTION-SCREEN> is specified, the user of the calling program can edit it and schedule the called program in the background request using the function Place in Job>. If the user cancels selection screen processing, the program is not scheduled in the background job. In both cases, the ABAP_ISESS of the called program is terminated after selection screen processing and the calling program is resumed due to AND RETURN>. The program is then scheduled in the background task. After this, scheduling is carried out in the background task, where the selections specified by the user or by the additions for filling the selection screen are stored in an internal selection screen variant>. The actual execution of the program then takes place in a separate background session> as part of the background request. The current user and client of the current session correspond to the user and client of the background session. The user can be overwritten using the addition USER>. The language of the background session is either the current text environment language> or can be set using the addition LANGUAGE>. The program is now run completely. All events are raised, including those from selection screen processing, although the selection screen is processed in the background. The selection screen variant stored internally is passed to the selection screen between the events INITIALIZATION>> and AT SELECTION SCREEN OUTPUT>>. 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> 0Background task was scheduled successfully. 4Scheduling was terminated by the user on the selection screen. 8Error during the scheduling, that is during the internal call of JOB_SUBMIT>. 12Error during internal number assignment