(DV-2305) SAP Report Definition

The SAP Report Test Case is a collection of Report Test Variants.

Report Variant Create/Change/Display Authorization!

To create, change, or display report variants, you need proper authorization. It is checked against Auth. Object /DVD/VVAR. Auth. Fields checked are Activity (01 - Create, 02 - Change, 03 - Display), Validate test type (REP - SAP Report), and then Variant testing object and sub-object (which in this case are report name and its variant). An authorization check is done during creating/updating/displaying of a single variant, variant generation, and Mass Edit.

The default /DVD/VALIDATE role allows you to create, change and display all reports whose names start with /DVD/, all report variants are allowed. At the moment Test Plan and Test Case are not checked.


Creation of SAP Report Test Case

After you click on Variants button a screen for Report Variants selection is displayed.

Report Variants Selection

SAP Test Case variant selection screen


Here you can create a new or add existing Report Variants into an SAP Report Test Case. All these functions are accessible from the toolbar menu.

Create New Report Variant 

The screen for creating a new Report Variant is displayed by clicking on the Create New Report Variant button (Ctrl + F3).


Create a new Report Variant screen


In this screen you can define:

  1. RFC Destination: RFC destination that will be used for Report Variant execution.

  2. Variant Description: Description of the new Report Variant. The following placeholders are allowed in the description:
    • <REPORT>: It is going to be replaced with the name of the report defined in this variant.
    • <VARIANT>: It is going to be replaced with the name of the report variant defined in this variant.
    • <DATE>: It is going to be replaced with the current date on the system.
    • <TIME>: It is going to be replaced with the current time on the system.
  3. Report (required): Technical name of the report to be used for image creation.

    SNP Validate creates before and after images from the report execution spool. Only reports that create such spools when executed in a background job should be used.

  4. Report Variant (ABAP Variant): Variant of the specified report to be used when the report is executed. These variants can be managed in transaction SE38.

  5. After Image Variant ID: ID of the Report Test Variant that is used for the after image creation. This allows you to compare the output of different Reports/Report Variants or outputs from different systems.

By clicking on Advanced Settings we can define comparison settings, that will be used at the comparison stage of the variant. If nothing is changed in comparison settings, the default Simple Report Comparator will be used. We can change the following settings:

  1. Ignore Date and Time: Each report comparator is capable of ignoring timestamps in several standard formats that often cause differences in the output of reports as they are executed at different times. Following date format patterns are recognized with all date notation (using delimiters '.', '/' and '-' ):   mm*dd*yyyydd*mm*yyyyyyyy*dd*mm, yyyy*mm*dd,  mm*yyyy, yyyy*mm. The following time formats are recognized:  hh:mm:ss, hh:mm.

    Each recognized date and time is internally not removed but replaced with a special character # in an appropriate character length, e.g.: 16.04.2020 with ##########, 04/2020 with ####### or 21:56:06 with ########.

  2. Compare Only Data: Each report comparator can ignore lines that do not contain any alpha-numerical character (0-9, a-z, or A-Z).

  3. Report Comparison Type: SNP Validate comes by default with five report comparators:
    • Simple Report Comparator compares the report output in B-image and A-image row by row so matching lines have to be in the same position. This comparison is suitable for auditing if frozen data was affected by some change in the same system after a time. 
    • Advanced Report Comparator searches for the exact match of a row from Before Image in After Image rows independent of the position of the row. Each row in the before image and after image is normalized before comparison. The process of row normalization depends on selected comparison attributes and defined mapping if chosen.
    • Report Comparator with Threshold compares each line of Before Image with each line of After Image and calculates their similarity. It evaluates if the line has a match according to the line similarity threshold with default value 1 which represents the exact match. The overall similarity of reports is calculated as the arithmetic mean of matched values. 
    • Custom BADI Report Comparator allows you to implement your own comparison logic. To create your own BADI comparator you need to create an implementation for BAdI /DVD/EQS_BADI_REP_COMPARE. Example BAdI implementation class /DVD/EQS_CL_BADI_REP_COMPARE is set by default with the same processing as used in Advanced Report Comparator.
    • BAdI Report Comparator Settings
    • Python Report Comparator uses the language Python on the application server layer to compare before and after image. To use this comparator there must be Python version 2.7 or higher installed on the application server (or remote application server) then an appropriate Python script loaded to the SNP Validate repository and finally some additional expert setup has to be done. This option of the comparator is switched off by default in SNP Validate Backend Settings. The Python comparator does the same as the Advanced Report Comparator using predefined mapping and custom-specific mapping but also with the option to propose (generate) mapping from deep analyses of before and after image report output. The alpha version of the Python comparator script is available on demand.  
    • Python Report Comparator Settings
    • Hierarchical Comparator is parsing the report output and in this output identifies individual values, consequently working with these values as structural data. This type of comparator can be used only on specific reports, for which the customizing is available. The added value of this comparator is that it is possible to use conversion rules similar to the process with database tables.

4. Use Predefined Mapping: This is used to match some of the known differences in standard report outputs caused by different versions of the SAP system. The option is available for all Report Comparator Types except Simple Report Comparator. 

5. Mapping Name: Input for the name of the custom-specific mapping. It allows you to define your own mapping to match some reports' specific differences in standard report outputs caused by different versions of the SAP system or caused by custom changes and setup. The option is available for all Report Comparator Types except Simple Report Comparator. A combination of predefined mapping and custom-specific mapping is allowed. In such a case, the predefined mapping is applied first on all rows. How to define custom-specific mapping is described in the section 14617145.

6. Line Threshold: Available only with Report Comparator with Threshold. It sets the threshold to evaluate the minimal similarity of the line from the before image to any line from the after image to consider it as a matched line. Valid input is a float value of range from interval 0.01 to 1. The default value is 1 which means the exact match of lines.

7. Report Threshold: Available only with Report Comparator with Threshold. It sets the threshold to evaluate the minimal similarity of report outputs to consider them identical. Valid input is the float value range from 0.01 to 1. The default value is 1 which means the exact match of report outputs.

8. Preset ID: Available only with Python Report Comparator. When choosing Python Report Comparator as the comparison type, Preset ID must be defined.


The last thing which can be defined is Execution Settings.

.

  1. Run as a different user: This allows you to execute the report variant as a different user. It supports both local and external execution. By default, this field is hidden and can be enabled by the expert setting REPORT_RUN_AS_DIFF_USER. If no user is specified, user scheduling variant execution will be used for report execution. A specified user must exist.

    Authorization needed for running as different user

    SAP standard authorization check S_BTCH_NAM (Background Processing: Background User Name) is performed if an user name is set to the field Run as a different user. The check is performed before saving the variant on the local system or on the remote system if the RFC destination is specified.

Report Test Variant is created after you click on the Continue button (Enter). 

Add Existing Report Variant 

The Add Existing Report Variant button displays all of the existing Report variants in the system and you can select one or more variants to be added to the current Test Case.

Add Report Variants of Run 

The Add Report Variants of Run button displays all of the SAP Reports that have been run in the system and you can select one of these variants to be added to the current Test case.

Copy Report Variants of Run 

You can create copies of Report variants by selecting multiple variants in the selection table and then clicking on  Copy Report Variants toolbar button. For each selected variant new variant is created with the same settings as the source variant. 

Message log from copying variants 

Add Variants of Test Case  By clicking on the Add Variants of Test Case button (SHIFT + F11) you can select the existing Test Case, and add all of the Report Variants used in this Test Case into the current Test Run.
Copy Variants of Test Case : By clicking on the Copy Variants of Test Case button (SHIFT + F12) you can select the existing Test Case, and add all of the Report Variants used in this Test Case into the current Test Run as copies. 

Generate Report Variants 

The screen for the generation of Report Variants is displayed after clicking on Generate Report Variants button (Shift+F7). 


In this screen you can define:

  1. SAP report name(s) with individual SAP variant name(s) for Before Image creation. You can use wildcards in the SAP variant name - * and +. These will get translated into proper SAP variant names after clicking on a Check or Continue button.
  2. You can specify the corresponding SAP report name(s) with SAP variant name(s) for After Image creation. If SAP report names for After Image are empty and After Image properties (description, RFC destination) are filled in, then the corresponding names of the SAP report and SAP variant from Before Images will be used.      
  3. Descriptions will be added as a description for all generated report variants. You can specify a different description for Before and After Images and you can use placeholders that will be translated to the corresponding values. Click on the information button to get all placeholder definitions.
  4. RFC Destination: This defines the system where report variants are located.
  5. Comparator Settings: Here you can define the type of comparison to be used and its related parameters.
  6. Execution Settings: Run as a different user: Different user may serve to check user authorizations to access data. When the field is left empty, the variant will be executed with the current user.

Description placeholders

Placeholders for report variant description


Report Test Variants are created after you click on the Continue button (Enter). You can also check entered data using the Check button. However, keep in mind that Check button will remove all incorrectly defined variants.

There is a possibility to import standard reports by clicking on the Import standard reports button.

Add standard SAP Reports with variants

The screen with the list of standard SAP reports is displayed after clicking on Import standard reports button.  


Import standard reports


In this screen you can define:

  1. SAP report variant name or pattern: For both before and after image. You can use wildcards * and + in them.
  2. Reports selection: List of currently supported standard reports in various SAP modules. Select the checkbox to get the report name to the generator's list.

After you click on the Continue button (Enter), Report Selection is sent to the screen for a generation of Report Variants, where you can check your Reports selection again. Test Variants are created after you click on the Continue button in the Report Generation screen. 

Create After Images as copies

Select multiple variants and create after image variants for them. To access this functionality, in the context menu of the selected variants choose Create After Images as copies. A dialog is then displayed where you can define the RFC destination that will be applied to all of the generated after image variants. All other settings are also copied from source variants.

Create After Image Variants as copies

Edit Report Variant

You can edit the existing Report variants by double-clicking on them in the table view. Only Variants that are not already in use in Test Runs can be edited. If a Report Variant is already used in the Test Runs, then the details can only be reviewed, but not changed. 
When variant details are displayed, you can check where this variant is used. By pressing the Where Used  button a table is displayed that contains all Test Plan/Test Case/Run ID information where this variant is used. 

Where Used List for Variant

Mass Edit Variants

You can edit more Report variants at once. Mass edit is done by selecting the required variants in the list and clicking on Mass Edit Variants  button, a Dialog for mass edit of variants is then displayed. 

These are settings for comparison and variants, which are applied to every variant user selected. Changes to these values are done after clicking on the Continue (Enter) button. By checking the Edit checkbox (on the left) only the values, which you want to be changed will be replaced in selected variants. Only variants that are not yet used in test runs can be changed by mass edit. Before the change, mass edit checks if the variant is used as before or after image in any test run. If the variant is not editable or has another problem, a warning/error message is displayed in the log.

Report Variant Editor

Variant editor

(DV-2305) Variant Editor provides a central location where you can manage all the backend-testing variants

Delete Report Variants

Deleting the existing Report Variants can be done easily by selecting the desired rows and clicking on the delete button in the ALV toolbar.

Any Report Variants that are still in use in the Backend Testing will be locked; therefore it is first necessary to delete these Report Variants from the given runs (or specific runs) before proceeding in deleting them permanently from the Report Variant Editor (i.e. system).

Transport Report Variants

It is possible to add the specified Report Variants to a transport to be transferred to another system (with SNP Validate installed). To specify which of the Report Variants are to be transported you need to select them from the list. There are options for filtering and sorting in the ALV table that can be used to select the specified Report Variants more easily. 

Selecting Report Variants to be transported


After selecting the desired Report Variants and clicking on the  Transport Report Variants button, choose your transport request. You can select the request and confirm the transport for the selected Report Variants. 
It is important to note that the Report Variants only carry information about SNP Validate-related items, and not the transformation structures themselves so they should be imported only to the system where SNP Validate is installed and the same SAP reports variants with the same structure exist.

Cleanup Report Variants

You can delete all unused Report variants by clicking on  Cleanup Report Variants button. The first screen with preselection filters of variants is displayed and you can restrict which variants should be checked for deletion. After you confirm this screen, a check is done to find all unused variants. A variant is unused if it is not assigned to any Test Case or Test Run.  

Report Variant Cleanup Preselection


All variants evaluated as not used are displayed in the dialog window. When you confirm the selection in this window variants are deleted from the system.

Define a mapping for report comparison

Mapping is maintained via transaction /DVD/VAL_REP_MAP or via Report Variant.