Thursday 8 October 2015

Chapter 19: SAP Jobs


Chapter 19: SAP Jobs


SAP Jobs 
SAP jobs let you run SAP workload.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.
You can define the following SAP jobs:
SAP Batch Input Session
Imports data from external systems to the SAP system.
SAP Business Warehouse (BW) InfoPackage
Transfers data from a data source to an SAP Business Warehouse system.
SAP Business Warehouse (BW) Process Chain
Creates Process Chains on the SAP system.
 SAP Connection Attributes


SAP Data Archiving 
Stores information in an SAP Archiving Object.
SAP Event Monitor
Monitors and triggers SAP events.
SAP Job Copy
Copies an existing SAP R/3 job.

SAP Process Monitor 
Monitors for a specific SAP process status.
SAP R/3
Schedules an SAP R/3 job on your SAP system.

SAP Connection Attributes 
The following connection attributes are common to SAP job types and may be required
in your job definitions:
sap_rfc_dest 
Specifies the SAP system to connect to. This value corresponds to the
destination@properties agent configuration file name containing the SAP
connection information. The sap_rfc_dest value overrides the
sap.default.destination configuration value in the agentparm.txt file.



sap_client 
Specifies the client number associated with an SAP instance. An SAP instance can
have multiple clients defined for it. Each client has its own data. Your agent
administrator can define a default SAP client number using the jco.client.client
property in the connection properties file.

sap_lang 
Specifies the language required to run a job. Your agent administrator can define a
default language using the jco.client.lang property in the connection properties file.

sap_target_sys 
Specifies the host name of an SAP application server where the job is to run.
Note: If the sap_target_sys attribute is not defined, the SAP system will select an
application server based on available resources.
Notes:
■ If a default value is not defined on the agent, you must specify the attribute in the
job definition.
■ For more information about these attributes, see the Reference Guide.
 SAP User IDs and Passwords



SAP User IDs and Passwords
All SAP user IDs and passwords must be defined on CA Workload Automation AE by
using the autosys_secure command. When you define an SAP job, specify an SAP user ID
using the owner attribute, or use the default owner value. The job runs under this user
ID.
Note: For more information about the autosys_secure command, see the Reference
Guide.

Define an SAP Batch Input Session Job
You can define an SAP Batch Input Session (SAPBDC) job to import large amounts of
data from external systems to the SAP system.
To schedule a BDC job, you first define an ABAP that creates a Batch Input Session (BDC
ABAP) on the SAP system. Next, you schedule an SAP Batch Input Session job in CA
Workload Automation AE to run the BDC ABAP on the SAP system. After the job runs,
the BDC job starts the data transfer.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPBDC
Specifies that the job type is SAP Batch Input Session.

machine
Specifies the name of the machine on which the job runs.
sap_job_name
Specifies the name of the ABAP job that creates the BDC session on the SAP
system.
sap_step_parms
Defines the SAP R/3 step specifications.
Note: We recommend that you limit the number of steps (ABAPs) to one per
job. If you run a job and one of the ABAPs fails, the job is marked as failed. If
the ABAP fails, you cannot re-run the ABAP without re-running the entire job.
 Define an SAP Batch Input Session Job

422 User Guide

2. (Optional) Specify optional SAP Batch Input Session attributes:
■ bdc_err_rate
■ bdc_ext_log
■ bdc_proc_rate
■ bdc_system
■ job_class
■ job_terminator
■ sap_client

■ sap_job_class
■ sap_lang
■ sap_office
■ sap_recipients
■ sap_release_option
■ sap_rfc_dest
■ sap_step_parms
■ sap_target_sys


3. (Optional) Specify common attributes that apply to all job types.
The SAP Batch Input Session job is defined.

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define an SAP Batch Input Session Job



Example: Define an SAP Batch Input Session Job
This example runs the ZBDCTEST ABAP that creates a Batch Input Session (BDC ABAP) on
the default SAP system defined to the agent. The job runs as soon as possible after the
job is defined. After this job runs, the BDC job starts the data transfer.
insert_job: bdcjob
job_type: SAPBDC
machine: sapagent
owner: WAAESAP@sapagent
sap_job_name: ZBDCTEST
sap_release_option: A
sap_step_parms: abap_name="ZBDCTEST"
Example: Define an SAP Batch Input Session Job with Step Parameters
This example runs the SAP Batch Input Session job named ZBDCTEST. When SAPBDC_job
runs, it releases ZBDCTEST immediately on the SAP system. If no free background
processing is available, the ZBDCTEST is not released and stays in the Scheduled SAP job
state.
insert_job: SAPBDC_job
job_type: SAPBDC
machine: localhost
owner: WAAESAP@sapserver
sap_job_name: ZBDCTEST
sap_release_option: I
sap_step_parms: abap_name="ZBDCTEST",banner_page=no,release=no,print_imm=no,
new_spool=no,footer=no Define an SAP BW InfoPackage Job

424 User Guide

Define an SAP BW InfoPackage Job
You can define an SAP BW InfoPackage (SAPBWIP) job to transfer data from any data
source into an SAP Business Warehouse system. When the job runs, the data is
transferred.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.
Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPBWIP
Specifies that the job type is SAP BW InfoPackage.
machine
Specifies the name of the machine on which the job runs.
sap_info_pack
Specifies the name of the Business Warehouse InfoPackage.

2. (Optional) Specify optional SAP BW InfoPackage attributes:
■ job_class
■ job_terminator
■ sap_client
■ sap_ext_table
■ sap_job_name
■ sap_lang
■ sap_rfc_dest
 Define an SAP BW InfoPackage Job



3. (Optional) Specify common attributes that apply to all job types.
The SAP BW InfoPackage job is defined.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define an SAP BW InfoPackage Job

426 User Guide

Example: Define an SAP BW InfoPackage Job
This example runs the Business Warehouse InfoPackage
0PAK_D2XZMZ1HD5WFVFL3EN1NVIT4V at the SAP destination, SM1.
insert_job: InfoBW2
job_type: SAPBWIP
machine: sapagent
owner: WAAESAP@sapagent
sap_job_name: InfoBW2
sap_rfc_dest: SM1
sap_info_pack: 0PAK_D2XZMZ1HD5WFVFL3EN1NVIT4V
Example: Define an SAP BW InfoPackage Job
This example runs the Business Warehouse InfoPackage
ZPAK_DIBX41NKYK0S7FB1FOV0FQ7BV on the SAP system.
insert_job: bwip_job
job_type: SAPBWIP
machine: localhost
owner: user@sapserver
sap_job_name: BI_BTCHSAP_TEST
sap_rfc_dest: mts
sap_info_pack: ZPAK_DIBX41NKYK0S7FB1FOV0FQ7BV
sap_lang: EN
sap_client: 001
job_class: a Define an SAP BW Process Chain Job


Define an SAP BW Process Chain Job
You can define an SAP BW Process Chain (SAPBWPC) job to run a sequence of
background processes on the SAP system. Some SAP processes trigger events that can
start other processes. An SAPBWPC job runs the individual processes in the chain as job
steps.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.
Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPBWPC
Specifies that the job type is SAP BW Process Chain.
machine
Specifies the name of the machine on which the job runs.
sap_chain_id
Specifies the name of the Business Warehouse Process Chain.
2. (Optional) Specify optional SAP BW Process Chain attributes:
■ job_class
■ job_terminator
■ sap_client
■ sap_lang
■ sap_rfc_dest
3. (Optional) Specify common attributes that apply to all job types.
The SAP BW Process Chain job is defined.
 Define an SAP Data Archiving Job

428 User Guide

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Define an SAP BW Process Chain Job
This example defines the SAPBWPC3 job that runs the DEMO_CHAIN1 Process Chain on
the SAP system. The language used to log in to the SAP system is English.
insert_job: SAPBWPC3
job_type: SAPBWPC
machine: sapagent
owner: WAAESAP@sapagent
sap_chain_id: DEMO_CHAIN1
sap_lang: EN
sap_rfc_dest: SM1
Define an SAP Data Archiving Job
You can define an SAP Data Archiving (SAPDA) job to store information described in an
SAP Archiving Object into an SAP data archive.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPDA
Specifies that the job type is SAP Data Archiving.
 Define an SAP Data Archiving Job



machine
Specifies the name of the machine on which the job runs.
arc_obj_name
Specifies the name of the archiving object.
arc_obj_variant
Specifies the name of the archiving object variant.

2. (Optional) Specify optional SAP Data Archiving attributes:
■ arc_parms
■ job_class
■ job_terminator
■ sap_client
■ sap_lang
■ sap_print_parms
■ sap_rfc_dest
■ sap_target_sys


3. (Optional) Specify common attributes that apply to all job types.
The SAP Data Archiving job is defined.

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define an SAP Event Monitor Job

430 User Guide

Example: Define an SAP Data Archiving Job
This example defines a job that stores information described in the BC_ARCHIVE
Archiving Object into an SAP data archive. The archiving object variant is
BC_ARCVARIANT.
insert_job: SAPDA_job
job_type: SAPDA
machine: sapagent
owner: WAAESAP@sapagent
arc_obj_name: BC_ARCHIVE
arc_obj_variant: BC_ARCVARIANT
sap_print_parms: dest=LP01,prt_arc_mode=PRINT
Define an SAP Event Monitor Job
You can define an SAP Event Monitor (SAPEVT) job to schedule workload based on the
activity of an SAP event or trigger an SAP event at the appropriate time in your
schedule.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPEVT
Specifies that the job type is SAP Event Monitor.

machine
Specifies the name of the machine on which the job runs.
sap_event_id
Specifies the name of the SAP event to monitor or trigger.
 Define an SAP Event Monitor Job



2. (Optional) Specify optional SAP Event Monitor attributes:
■ continuous
■ job_class
■ job_terminator
■ sap_client
■ sap_event_parm
■ sap_is_trigger
■ sap_lang
■ sap_rfc_dest


3. (Optional) Specify common attributes that apply to all job types.
The SAP Event Monitor job is defined.

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
 Define an SAP Process Monitor Job

432 User Guide

Example: Trigger an SAP Event
This example defines an SAPEVT job. The job triggers the SAP_TEST event and the SAP
job dependencies waiting on the SAP_TEST event are satisfied.
insert_job: SAPEVT_job
job_type: SAPEVT
machine: sapagent
owner: WAAESAP@sapagent
sap_event_id: SAP_TEST
sap_rfc_dest: BI1
sap_is_trigger: Y
Example: Monitor an SAP Event
This example defines an SAPEVT job. The sap_is_trigger attribute is set to N, so the job
monitors the SAP_TEST event and remains in RUNNING status.
insert_job: trigger_evt
job_type: SAPEVT
machine: localhost
owner: WAAESAP@sapserver
sap_rfc_dest: BI1
sap_event_id: SAP_TEST
sap_is_trigger: N
sap_event_parm: L L
sap_client: 001
sap_lang: EN
continuous: y
Define an SAP Process Monitor Job
You can define an SAP Process Monitor (SAPPM) job to monitor for a specific SAP
process status and end after detecting a process. You can also use SAP Process Monitor
jobs to set up predecessor or dependent job relationships with other jobs or SAP
processes.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPPM
Specifies that the job type is SAP Process Monitor.
 Define an SAP Process Monitor Job



machine
Specifies the name of the machine on which the job runs.
sap_process_status
Specifies the SAP process status to monitor (RUNNING, STOPPED, or WAITING).

2. (Optional) Specify the following optional attributes if sap_process_status is set to
RUNNING or STOPPED:
■ sap_abap_name
■ sap_proc_user
■ sap_process_client

3. (Optional) Specify optional SAP Process Monitor attributes:
■ continuous
■ job_class
■ job_terminator
■ sap_client
■ sap_lang
■ sap_proc_type
■ sap_rfc_dest
■ sap_target_sys


4. (Optional) Specify common attributes that apply to all job types.
The SAP Process Monitor job is defined.
 Define an SAP Job Copy Job

434 User Guide

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Define an SAP Process Monitor Job
This example defines an SAP Process Monitor job that monitors for the ABAP program
ZMYABAP to change to the RUNNING status.
insert_job: test_SAPPM
job_type: SAPPM
machine: sapagent
sap_abap_name: ZMYABAP
sap_process_status: RUNNING
sap_rfc_dest: BI1
owner: WAAESAP@sapagent
Define an SAP Job Copy Job
You can define an SAP Job Copy (SAPJC) job to copy an existing SAP R/3 job.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.

Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAPJC
Specifies that the job type is SAP Job Copy.
 Define an SAP Job Copy Job



machine
Specifies the name of the machine on which the job runs.
sap_job_name
Specifies the name of the SAP R/3 job to be copied.

2. (Optional) Specify optional SAP Job Copy attributes:
■ job_class
■ job_terminator
■ sap_client
■ sap_fail_msg
■ sap_job_count
■ sap_lang
■ sap_mon_child
■ sap_release_option
■ sap_rfc_dest
■ sap_step_num
■ sap_success_msg
■ sap_target_jobname
■ sap_target_sys


3. (Optional) Specify common attributes that apply to all job types.
The SAP Job Copy job is defined.
 Define an SAP Job Copy Job

436 User Guide

Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Define an SAP Job Copy Job
This example defines an SAP Job Copy job that copies the AM job with job count
11331500 and runs the new copy.
insert_job: SAPJC_job
job_type: SAPJC
owner: WAAESAP@sapagent
machine: sapagent
sap_job_name: AM
sap_job_count: 11331500 Define an SAP R/3 Job



Define an SAP R/3 Job
You can define an SAP R/3 job (SAP) to schedule an SAP R/3 job on your SAP system.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows
and CA WA Agent for SAP.
Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: SAP
Specifies that the job type is SAP R/3.
machine
Specifies the name of the machine on which the job runs.
sap_job_name
Specifies the SAP job name that identifies the workload in the SAP system.
sap_step_parms
Defines the SAP R/3 step specifications.
Note: We recommend that you limit the number of steps (ABAPs) to one per
job. If you run a job and one of the ABAPs fails, the job is marked as failed. If
the ABAP fails, you cannot re-run the ABAP without re-running the entire job.

2. (Optional) Specify optional SAP R/3 attributes:
■ job_class
■ job_terminator
■ sap_client
■ sap_fail_msg
■ sap_job_class
■ sap_lang
■ sap_mon_child
■ sap_office
■ sap_recipients
■ sap_release_option
■ sap_rfc_dest
■ sap_success_msg
■ sap_target_sys
 Define an SAP R/3 Job

438 User Guide

3. (Optional) Specify common attributes that apply to all job types.
The SAP R/3 job is defined.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.

Example: Define an SAP R/3 Job With One Step
This example runs the SAP R/3 job named BI_WRITE_PROT_TO_APPLLOG. The job runs
the SAP program (ABAP) named RSBATCH_WRITE_PROT_TO_APPLLOG. The owner is
defined in CA Workload Automation AE using the autosys_secure command.
insert_job: test_SAP
job_type: SAP
machine: sapagent
sap_job_name: BI_WRITE_PROT_TO_APPLLOG
sap_rfc_dest: BI1
sap_step_parms: abap_lang=EN,abap_name=RSBATCH_WRITE_PROT_TO_APPLLOG
owner: WAAESAP@sapagent Attributes with Default Values



Example: Define an SAP R/3 Job With Multiple Steps
This example runs an SAP R/3 job named SAP 3 STEPS_@#$. The job runs three steps.
Each step runs the same ABAP but with different parameters.
insert_job: TEST_1
job_type: SAP
machine: localhost
job_class: c
sap_job_name: "SAP 3 STEPS_@#$"
sap_release_option: I
sap_step_parms:abap_name=BTCTEST,variant=test,arc_printer=LP01,copies=2,prt_arc_m
ode=BOTH,arc_obj_type=ARCHIVE,arc_doc_type=ARCHIVE,arc_info=inf,num_lines=65,num_
columns=80
sap_step_parms:abap_name=BTCTEST,variant=test2,arc_printer=LP01,copies=3,prt_arc_
mode=BOTH,print_imm=N,release=N,sap_banner=Y,banner_page=Y,recipient_name=cyber,n
um_lines=65,num_columns=80,arc_obj_type=ARCHIVE,arc_doc_type=ARCHIVE,arc_info=inf
sap_step_parms:abap_name=BTCTEST,variant=test,arc_printer=LP01,copies=1,prt_arc_m
ode=BOTH,sap_banner=Y,banner_page=Y,recipient_name=cyber,num_lines=65,num_columns
=80,authorization=string2,arc_obj_type=ARCHIVE,arc_doc_type=ARCHIVE,arc_info=inf
Attributes with Default Values
Some attributes have default values that automatically apply to all job definitions. Your
agent administrator can also define default values in the agent's agentparm.txt file or
the SAP agent connection properties file. If a default value exists, you do not have to
specify the corresponding attribute in the job definition. However, you can specify the
attribute to override the default.

The following SAP job attributes have default values:
bdc_ext_log (SAPBDC jobs only)
Specifies whether to generate advanced logging of the Batch Input Session (BDC)
running on the SAP system.
Default: N (The job does not generate advanced logging.)

sap_client
Specifies the SAP client within the SAP system.
Default: jco.client.client connection properties parameter, if specified

sap_is_trigger (SAPEVT jobs only)
Specifies whether to trigger or monitor an SAP event.
Default: N (The job monitors an SAP event.)
 Attributes with Default Values

440 User Guide

sap_lang
Specifies a character code representing a valid language for SAP.
Default:
■ EN (The default language is English.)
■ jco.client.lang connection properties parameter, if specified. This parameter
overrides the default type (EN).

sap_mon_child (SAPJC and SAP jobs only)
Specifies whether to monitor children jobs.
Default: N (The job does not monitor children jobs.)
sap_office
Specifies whether to save outgoing documents to the SAPoffice outbox of the SAP
user associated with the job.
Default: N (The job does not save outgoing documents.)

sap_release_option (SAPBDC, SAPJC, and SAP jobs only)
Specifies the action to take with a job after it is defined.
Default: A (The job releases the job as soon as possible.)

sap_rfc_dest
Specifies the destination value for the Remote Function Call (RFC) connection and
gateway information.
Default: sap.default.destination agent parameter, if specified

sap_target_jobname (SAPJC jobs only)
Specifies the name of the target job to copy.
Default: The name of the source job
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.

 Email an SAP Job's Spool File



Example: Monitor an SAP Event and Override the Default Client ID
The sap_client attribute in the following job definition overrides the default client
specified in the agent connection properties file.
This example defines an SAPEVT job. The sap_is_trigger attribute is set to N, so the job
monitors the SAP_TEST event and remains in RUNNING status.
insert_job: trigger_evt
job_type: SAPEVT
machine: localhost
owner: WAAESAP@sapserver
sap_rfc_dest: BI1
sap_event_id: SAP_TEST
sap_is_trigger: N
sap_event_parm: L L
sap_client: 001
sap_lang: EN
continuous: y
Email an SAP Job's Spool File
You can email the SAP spool file for all steps in an SAP R/3 (SAP) job to recipients. A copy
of the spool file is emailed on job completion or failure. The recipient can be an email
address, an SAPoffice distribution list, or an SAP user.
Follow these steps:
1. Define an SAP R/3 job (see page 437).
2. Add the following attribute to the job definition:
sap_step_parms: abap_name=abap, sap_maillist=value
Specifies one or more recipients on a distribution list and the ABAP name.


3. (Optional) Add one or both of the following attributes:
sap_fail_msg
Specifies a string that indicates the job failed. If the string is found in the job's
spool file, the job is considered failed even if the job succeeds on the SAP
system.

sap_success_msg
Specifies a string that indicates the job completed successfully. If the string is
found in the job's spool file, the job is considered successfully completed even
if the job fails on the SAP system.
 Email the Spool File of a Single Step in an SAP Job

442 User Guide

4. (Optional) Add the following attribute:
sap_office
Specifies whether to save outgoing documents to the SAPoffice outbox of the
SAP user associated with the job.

5. Run the job.
The job's spool file is emailed to the recipients.
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.
Example: Email an SAP Job's Spool File
This example emails the SAP spool file for an SAP job to user1@example.com.
insert_job: test_SAP_1
job_type: SAP
machine: sapagent
owner: WAAESAP@sapserver
sap_job_name: BI_WRITE_PROT_TO_APPLLOG
sap_rfc_dest: BI1
sap_step_parms:abap_name=RSBATCH_WRITE_PROT_TO_APPLLOG,sap_maillist="user1@exampl
e.com",variant=TEST,banner_page=no,copies=1,release=no,recipient_name=cybermation
,prt_arc_mode=PRINT,print_imm=no,num_lines=65,num_columns=80,new_spool=no,footer=
no
Email the Spool File of a Single Step in an SAP Job
You can email the SAP spool file for a single step in an SAP R/3 (SAP) or SAP Batch Input
Session (SAPBDC) job to recipients. A copy of the spool file is emailed on step
completion or failure. The recipient can be an email address, an SAPoffice distribution
list, or an SAP user.
 Email the Spool File of a Single Step in an SAP Job



Follow these steps:
1. Define an SAP R/3 job  or SAP Batch Input Session job  .
2. Add the following attribute to the job definition:
sap_step_parms: abap_name=abap,sap_maillist=address
 [,sap_fail_msg=message]
 [,sap_success_msg=message]
abap_name=abap
Specifies the valid SAP system ABAP name. This keyword corresponds to the
SAPGUI ABAP Program Name field on the Create Step dialog.
sap_maillist=address
Specifies one or more recipients to send the spool list results to.

sap_fail_msg=message
(Optional) Specifies a string that indicates the failure of the step. If the string
matches the SAP ABAP output for the step, the step is considered failed even if
the step succeeds on the SAP system.
Note: This keyword does not apply to SAPBDC jobs.

sap_success_msg=message
(Optional) Specifies a string that indicates the success of the step. If the string
matches the SAP ABAP output for the step, the step is considered successfully
completed even if the step fails on the SAP system.
Note: This keyword does not apply to SAPBDC jobs.

3. (Optional) Add optional parameters to the sap_step_parms attribute.
4. (Optional) Add the following attribute:
sap_office
Specifies whether to save outgoing documents to the SAPoffice outbox of the
SAP user associated with the job.

5. Run the job.
The spool file of a single step is emailed to the recipients.
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.
 Using Success and Failure Messages within an SAP Job Definition

444 User Guide

Using Success and Failure Messages within an SAP Job
Definition
You can check an SAP job's output for specific text strings to determine whether the job
is a success or a failure. You specify the text string in the sap_success_msg or
sap_fail_msg attributes in the job definition. For example, suppose when you cancel an
SAP job you want it to complete to release its successor job. You can specify the text
string 'Job canceled' as a success message in the job definition. When you cancel the
job, the agent checks the job's spool file, finds a match for 'Job canceled' and marks the
job as complete.
You can also check the output of a step (ABAP) to determine whether the step is a
success or failure. You specify the text string in the sap_fail_msg=value and
sap_success_msg=value keyword value pairs in the sap_step_parms attribute.
Note: The sap_step_parms: sap_fail_msg and sap_step_parms: sap_success_msg
keywords do not apply to SAP Batch Input Session (SAPBDC) jobs.
For more flexibility, you can specify regular expressions instead of simple text strings
within the success message and failure message fields. For example, you can use a
regular expression to search for multiple strings at the same time. To compose a regular
expression, follow the rules for Java class java.util.regex.Pattern. You can find these
rules using a Google search for java pattern.
Note: To enable regular expression processing, you must configure the agent for the
following parameter: sap.useRegularExpressions=true.
Examples: Using Regular Expressions
■ This expression checks for "TEST" in the job output file. The first .* indicates that
any number of characters can precede TEST. The second .* indicates that any
number of characters can follow it.
.*TEST.*
■ This expression checks whether "not found" or "started" appears in the job output
file.
.*(not found|started).*
■ This expression checks whether "Job canceled" appears in the job output file.
.*Job\scanceled.*

No comments:

Post a Comment