The problem might be familiar to you: Something in your setup has changed, or someone has left the company, hence report variants need to be checked and/or adjusted.
This can be a quite cumbersome manual task, so I would like to share Report Z_VARI_SCAN, which is supposed to be something like RS_ABAP_SOURCE_SCAN for program variants, with you.
For example if you are doing some kind of refactoring and therefore want to find a certain value or pattern in all variants it could be your weapon of choice. Never again check variants manually!
The program is build around FM RS_VARIANT_CONTENTS, as already suggested in this blog years ago.
The program has a focus on performance an robustness. Under good circumstances the entire report repository can be scannend within minutes or less. Note that the program uses parallel processing, it will consume additional dialog tasks accoring to parameter “Max. number of tasks”, especially in a productive environment you should make sure that a sufficient number of dialog processes remains free.
Variant contents cannot easily be read from the database. Instead the FM RS_VARIANT_CONTENTS generates the reports (LOAD REPORT…) in order to retrieve the data. Various errors or delays can occur in this process, not catchable exceptions included. However even if a runtime errors occur within the execution of Z_VARI_SCAN, the main program will not be affected, only one task will be “lost”. Each report is examinend in a seperate task in order to minimize potential losses. Z_VARI_SCAN also comes with a default exclusion of potentially problematic (in terms of scanning) reports and packages, which is of course only a suggestion and adjustable in the selection screen.
Happy scanning 🙂