Monday, February 8, 2016

Select job streams with / without Carry Forward (CF)

Selecting a job stream with carry forward on / off is a bit challenging as there is no out of the box option, the simplest method is to use direct SQL queries as below:
       
alter session set current_schema=<TWS DB user>;

SELECT DISTINCT WKS.WKS_NAME, STREAM.AJS_NAME, CF.JST_CARRY_FORWARD
   FROM WKS_WORKSTATIONS WKS, AJS_ABSTRACT_JOB_STREAMS STREAM, JST_JOB_STREAMS CF
WHERE WKS.WKC_ID=STREAM.WKC_ID AND WKS.WKS_NAME like '%<FTA name>%' AND 
      STREAM.AJS_ID=CF.AJS_ID AND CF.JST_CARRY_FORWARD = 'N'


where:
<TWS DB user> --> the DB user for TWS schema
<FTA name> --> FTA name (eider full or partial, % is a wild card like @)
CF.JST_CARRY_FORWARD = 'N' --> jobs streams without CF, and 'Y' with

Thursday, September 3, 2015

TWS for Apps, SAP configuration

SAP side configuration:

Copy the 4 correction and transport files from the Tivoli Workload Scheduler home directory to the SAP R/3 server and import them into the SAP R/3 database, as follows:

     1. On your SAP R/3 database server, log on to the SAP R/3 system as an administrator.

     2. Copy the control file and data file from the <TWA_home>\methods directory to the following directories on your SAP R/3 database server:
copy  control_file to /usr/sap/trans/cofiles/
copy data_file to /usr/sap/trans/data/
The names of control_file and data_file are different for releases and are located in <TWA_home>\methods with the following names and formats:
      For SAP R/3 releases earlier than 6.10:
control_file: K000xxx.TV1, K900xxx.TV2
data_file: R000xxx.TV1, R900xxx.TV2
      For SAP R/3 releases 6.10, or later:
control_file: K9000xx.TV1, K9007xx.TV1
data_file: R9000xx.TV1, R9007xx.TV1
where xx is a digit generated by the SAP system

Specifically, for Tivoli Workload Scheduler for Applications version 8.5 the following files are used:
      For SAP R/3 releases earlier than 6.10:
for standard jobs scheduling: K000538.TV1, R000538.TV1
for IDoc monitoring and job throttling: K900294.TV2, R900294.TV2
      For SAP R/3 releases 6.10, or later:
for standard jobs scheduling: K900044.TV1, R900044.TV1
for IDoc monitoring and job throttling: K900751.TV1, R900751.TV1

TWS side configuration (on the server where TWS for Applications was deployed):

After a new TWS4APPS installation, if you try to start a SAP job, you will get missing library error(s), to fix the problem, take the following steps:
      1. Check the LINK and search for SAP Remote Function Call libraries, to see which RFC libraries are needed – check the OS type where TWS4APPS is installed and look it to the .pdf table.
      2. The libraries should be available on SAP WebSite (help from SAP team may be needed, to download them).
      3. The libraries are compressed in car format, with file extension .sar, once you uncar them, copy the content of lib directory to the agent there TWS4APPS is installed in the <TWA_home>\methods folder.

Example of how to uncar the .sar file:
RFC_7-10009745.SAR
SAPCAR_315-20010450.exe
Place the SAPCAR and the CAR file in the same directory
./SAPCAR_315-20010450.exe -xvf RFC_7-10009745.SAR
Copy the content of lib directory, from the newly created directory tree, to the agent where TWS4APPS is installed, in the <TWA_home>\methods folder.

Monday, August 10, 2015

Remote CLI .. Windows PC set-up

TWS remote CLI for a personal PC advantages:
  • You can skip using the TDWC which in is slow and hard to use for big / massive changes.
  • No need to connect to any host.
  • Configure and personalize the editor (which for local CLI is the OS default one).

Once the remote CLI software was deployed (it also can be copied from an already installed source, installation is not mandatory) perform the following tasks for a better view and easier access:

    1. Create a *.cmd (e.g. TWS_CLI_Start.cmd) file that is setting up the global variables before launching the composer, and use it to start the remote CLI (more details can be found HERE):

@echo off set MAESTRO_OUTPUT_STYLE=LONG set MAESTROLINES=0 set MAESTROCOLUMNS=520
"%CD%\bin\composer.exe"
   2. Adjust the localopts file, personalize tp make sure there wont be any confusions to which TWS environment are you connected / working on (all the lines can be removed except the below ones):

e.g. TWS1 env.

############## Attributes of this Workstation: ############## composer prompt    =TWS1> ############## Attributes for CLI connection ############## HOST   =   TWS1.company.com  PROTOCOL   =   https PORT   =   31116 TIMEOUT   =   3600 IS REMOTE CLI = yes
e.g. TWS2 env.

############## Attributes of this Workstation: ############## composer prompt    =TWS2> ############## Attributes for CLI connection ############## HOST   =   TWS2.company.com  PROTOCOL   =   https PORT   =   31116 TIMEOUT   =   3600 IS REMOTE CLI = yes
I personally have multiple versions of localopts files and i'm overwriting the localopts file based on the needs. (e.g. localopts_TWS1, localopts_TWS2 and based on which TWS env. i want to connect i'm copying its localopts_XXX file over localopts)

     3. Once the user password expired you need to re-add it (as per first use), the first step that needs to be performed is to remove the useropt file from the user profile home and this can be automated by creating a *.cmd, file using the below commands:

@echo off del "%USERPROFILE%\.TWS\useropts" "%CD%\TWS_CLI_Start.cmd"
     4. You can adjust the default Windows editor which will be used in editing composer modify commands:

     X. To take full advantage of the remote CLI I recommend to use Windows PowerShell rather the default command line.