Pages

Download SAP Certification Material for FREE @ http://sap-ebooks-den.blogspot.com

Monday, May 5, 2008

Creating Background Jobs - Job Steps

 

¨ ABAP programs. With this option, you can specify the execution of ABAP reports as steps of a background job. Module pools or functions groups are not allowed for definition as steps.

 

¨ External commands. These are predefined commands that should have been previously defined by the system administrator. Normal users with the required authorization can schedule these job steps.

Since this is a way of executing programs or commands outside R/3, for security reasons users have to specify the operating system type and cannot change the predefined arguments.

 

¨ External programs. These programs are unrestricted operating system programs or shell scripts that require batch administrator privileges. There is no need to define these commands using transaction SM69. The requirement is that the computer must be reached from within the SAP server and have either remote shell support, a running SAP gateway, or a SAP instance that is on the reach of a SAP gateway.

 

 

Scheduling ABAP Programs as Job Steps

 

When scheduling ABAP reports as job steps, there are several type parameters which can be specified. The most important one is usually the selection criteria for the execution of the report as it would be normally specified when launching the report online. A group of selection criteria is saved in variants.

When an ABAP program is specified as part of a background job, if it needs selection criteria, the variant must have been previously created, otherwise you will not be able to save the ABAP step.

 

To define an ABAP program as a job step, from the initial job definition screen, press the Step button, and then click on the ABAP Program button on the Create step screen. Then proceed as follows:

¨ The User input field will be filled automatically with your own user name. But you can select another user name which will be used by the system to check the

    authorizations for the running job. You can only enter another user name if your own user is authorized to do so.

¨ Enter the name of the ABAP program in the Name input field.

¨If the ABAP program has selection fields, you must enter a variant in the Variant input field. If you don't know the name of the variant, click on the Variant list 

   button and select one. If you don't have any variant defined, you have to first define at least one variant, otherwise the system will not let you schedule the job. You

   can leave this field blank only in the case that the program does not require variants.

¨ Finally, in the Language input field, you can select a different language than the default, which is the one used when logging in to the system. Since SAP R/3 is a

    multilanguage system, there might be some language−dependent texts in the program which will be affected by the value of the language field.

 

 In the definition of steps with ABAP programs, you can also specify print parameters to instruct the system on where and how to print the job output.

When finished entering the needed information in the input fields, you can check your definition by clicking on the Check button. The system will display a message in the status bar if it finds any errors in the job definition. If there are no errors, click the Save icon to save your step.

 

 

Scheduling External Commands

 

Both external commands and external programs are executed by means of the sapxpg program. This program is called either by a remote shell (rsh, remsh, and others) or by the SAP gateway (the usual way under Windows NT systems).

External commands to be scheduled must have been previously defined by the system administrator (transaction code SM69).

 

¨To define these commands as job steps, first click on the External command push button on the Create step dialog box.

¨On the Name input field, click on the possible entries arrow to select one of the available external commands.

¨Only the commands available for the target operating system can be successfully executed.

¨The Parameters input field is used for specifying additional flags or parameters for the command.

¨Select Operating system from the available options, and the target host where the command will be executed.

¨Finally, verify the definition by clicking on the Check icon. If no errors are found, proceed by saving the step definition.

 

 

Scheduling External Programs

 

You can schedule external programs as job steps. These external programs can be of any type as long as they can be reached from the R/3 server and the host where the program resides can execute the program itself. It can be any compiled or executable program, shell script, and so forth.

 

The step definition for external programs allows you to include any parameters the program needs in a complete transparent way. The error messages generated by external programs are included in the log file for the background job.

 

To enter an external program as part of a job, when on the Create step screen, click on the external program.

The system will change the colors for the relevant input fields while graying out the field for the ABAP programs. Notice how the command buttons in the lower part of the screen change as well, depending on the type of program.

Enter the following information for the external program:

¨ Name. Enter the name and path of the external program. You should enter the path to ensure that the program can be found in the target system except if the

   program is in the search path of the SAP user with which the R/3 gateway was started (normally the <sid>adm user). For example: enter /home/dd1adm/copy.sh,

   instead of entering just copy.sh.

¨ Parameter. Enter here any parameters, flags, or options that the external program might need. For example, if the program /usr/bin/ps needs the option −eaf, enter

   this value in the parameter field.

¨ Target host. You have to enter here the hostname of the server where the external program is to be executed. This host must be reachable from the R/3 server.

 

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...