Author: Andrea Olivieri
Supported Releases: SAP ECC 6.0
Submitted: 20 September 2010
Code is presented in below pages:
- Job Steps Analysis - Get Report Name & Variant Name from periodic Scheduled Jobs
- Save Variant Data
- Variant Catalog Creation
General Flow and Pre-requisites
During a spin-off project of an Italian company in the automotive industry, the customer asked me to identify all the programs variants (of scheduled jobs) containing a defined value of company code ( i.e 'A001') in the selection screen.
In previous upgrade projects, basically for target release 4.70, I used a specific ASU tool, the restore variant tool,which allowed me to use the old variants again in the new release.
So I asked myself why should I have to implement a program from scratch if there is a standard one out there that does everything I need ?
So starting from the ASU variant restore tool, I cloned the source code of the following standard programs:
- RASUVCAT: Creates a catalog of all variants
- RASUVSAV: Storage of variant information
Since the goal is to identify job's variants containing the value A001 of the company code, I divided the process in the following operational steps:
- Get the program name and variant name from batch jobs
- Create Variant Catalog (For the specified program names)
- Save the variant Data (only parameters of type BUKRS)
Function Groups ASU2,ASU4 as well as the DDIC Tables TASUVCAT, TASUVEXT, TASUVSVD and TASUNSVO should exist in the system
How It Works
1 - Job Steps analysis (Optional)
I focused exclusively on programs scheduled as periodic jobs, so I implemented an additional ABAP program which reads the job definitions of all jobs with the following states:
After that, from the related steps, gets the following information:
- Job name,
- Program name,
- Variant name
The output is a raw list.
Copy and paste the column program name from the output list in the selection screen parameter Report(s) of the Variant Catalog Creation program. The snippet of the job steps analysis program could be found here.
2 - Variant Catalog Creation (Mandatory)
Due to performance reasons, first of all you have to create the variant catalog; it's better to restrict the selection to certain reports. is filled .
As result, after the program update run, the TASUVCAT table.
The variant catalog program works in "Delta Mode"; this means that only the variants that were not taken into account during the previous run are cataloged again. The snippet could be found here.
3 - Save Variant Data
Starting from the variant catalog, the current variant data and attributes are stored in both tables TASUVSVD and TASUVSVO.
The TASUVSVD table contains the variant data and TASUVSVO contains the technical field descriptions (TVARV variables, protected fields, and so on).
The program saves only the values of the parameters related to a data element with domain bukrs. The program checks following condition:
The snippet could be found here.
4 - Get The results
You can get the results immediately by the transaction SE16 (table TASUVSVD)