Variant Substitution - UNIX

Variant Substitution - UNIX

This example demonstrates the use of variant substitution.

When Universal Connector is using pre-defined SAP jobs as template jobs (rather than USAP job definition files), it may be necessary or desirable to replace the variants specified in the template job with variants more appropriate for the current job run. In this case, Universal Connector's TARGET_VARIANT option can be used to accomplish the variant substitution.

This example is comprised of three steps:

  1. Step one modifies SAP variant SBT1.
  2. Step two modifies SAP variant SBT2.
  3. Step three runs a new SAP job that is created using a pre-existing SAP job as a template.

Variant substitution is performed on the newly created job. As a result, the newly created job will run using the variants that were modified in steps one and two.

Executing this example will:

  1. Modify variants SBT1 and SBT2 with values required for this job run.
  2. Submit a new job to the SAP system using a pre-existing SAP job as a template.
  3. Perform variant substitution on the newly created job. The newly created job will now use variants SBT1 and SBT2 for steps 1 and 2, respectively (regardless of what variants were defined in the template job).
  4. Wait for the job to complete.
  5. Return the job log.
  6. Return the spool list.

Note

This job assumes (and requires) that a job already exists on an the SAP system with:

  • Job Name: VARSBST1
  • Job ID: 12345678

Step One

This step modifies SAP variant SBT1.

The following figure illustrates the variant definition file for variant SBT1.

 /* Variant Header statement. */
 VARIANT_NAME   = "SBT1"
    REPORT      = "RSUSR002";
 
 /* User */
 SELNAME        = "USER"
    KIND        = "S"
    SIGN        = "I" 
    OPTION      = "CP" 
    LOW         = "STONEBRANCH"
    HIGH        = "";


The following figure illustrates the command line to modify variant SBT1.

usap -dest CF5 -client 800 -userid sapuid -pwd sappwd 
     -modify vardefFile1


Step Two

This step modifies SAP variant SBT2.

The following figure illustrates the variant definition file for variant SBT2.

 /* Variant Header statement. */
 VARIANT_NAME   = "SBT2"
    REPORT      = "RSUSR002";

 /* User */
 SELNAME        = "USER"
    KIND        = "S"
    SIGN        = "I" 
    OPTION      = "CP" 
    LOW         = " STONEBRANCH1"
    HIGH        = "";



The following figure illustrates the command line to modify variant SBT2.

 Usap -dest CF5 -client 800 -userid sapuid -pwd sappwd 
      -modify vardefFile2


Step Three

This step submits, starts, and monitors a new job - using variant substitution.

Note

The pre-defined job must have ABAP program RSUSR002 defined in Step One and Step Two.

The following figure illustrates the variant definition file for variant SBT2.

 usap -dest CF5 -client 800 -userid sapuid -pwd sappwd 
      -run -jobname VARSBST1 -jobid 12345678 
      -target_variant 1,SBT1;2,SBT2


Command Line Options

Command line options used in this example are:

Command Options

Description

-dest

Named set of connection parameters (destination) 'CF5'. These connection parameters are used for communications with the SAP system.

The "destinations" are stored in file saprfc.ini, which must be in the current directory, or its full path must be specified in environment variable RFC_INI.

-client

SAP client number that the Universal Connector will communicate with.

-userid

Remote user ID with which to execute the command.

-pwd

Password for the user ID.

-sub

Specification that Universal Connector will issue the SUBMIT command.

-start

Specification that Universal Connector will instruct the SAP system to start the submitted job.

-targetserver

Target server for the SAP job to run on.

-wait

Specification that Universal Connector will monitor the started job until it completes.

-joblog

Specification that Universal Connector will return the SAP log for the started job.

-spoollist

Specification that Universal Connector will return any spool lists created by the started job.

Components

Universal Connector for SAP for UNIX