(DV-2002) Query Definition

Query Test Case Definition

A Query Test Case consists of a number of Query Variants. If you click on the Variants button, a screen for the Query Variants selection is displayed.



Creation of Query Test Case



Query Test Case variant selection screen

The Query variants selection screen allows you to create new or add an existing Query Variants into a Query Test Case. All functions are accessible from the toolbar menu.  

Create new Query Variant

The screen for creating new Query Variant is accessible by clicking on the Create new Query Variant button (Shift + F1).


Creating new Query Variant

In this screen you can define:

  1. RFC Destination – RFC destination of the Query Variant. When the RFC destination is specified using F4 help, this will display the query name values from the specified destination system. RFC with F4 help is only available if the dialog RFC connection (does not need to be the same as the filled one) is available in the system in the specified RFC destination.
  2. Query name (required) – the technical name of a query. F4 help is available for this field.
  3. Query Variant Description – allows you to add a description for the new Query Variant.
  4. Set query variables  – allows you to specify the filtering values (if any) for a query. For RFC Query Variants there is the possibility to specify the filtering values that are available only if the dialog RFC connection (does not need to be same as filled one) is available in the system to the specified RFC destination. Validate is also installed on the RFC destination system.


Query Filters

5. After image variant – Query/Bookmark Variant ID enables you to compare the outputs for different queries or for the same query on a different system. This can be executed instead of the variant during the creation of an after image.

6. (hidden) Run as different user - click on the Advanced Settings, an option to run query as a different user is displayed. Query execution under different user may serve to check user authorizations to access data. When the field is empty, variant will be executed with the current user. Setting is hidden by default, visibility of this setting can be changed in expert settings.

To save, click on Continue (Enter) and the Query Variant is saved. Various checks are done to ensure the correctness of a variant definition before the variant is saved.

If different Query/Bookmark Variants are specified for the after image creation then the following rules apply, in order for outputs to be compared. Both of the compared query/bookmark variants must have exactly the same structure of columns/rows to allow Validate to compare them. If the structure of the variants differs, then the correctness of comparison cannot be guaranteed. 


By double clicking on created Query Variant, you can re-enter the dialog and edit the variant properties. However, it is not possible to edit variant properties, if this variant is already in use for another Test Run. 

Create New Bookmark Variant 



Create new Bookmark Variant


Screen for creating a new Bookmark Variant is accessible by clicking on the Create New Bookmark Variant button (Shift + F2). In this screen you can define:

  1. RFC Destination – RFC Destination of a system on which the bookmarked query is run on. Validate must be installed on the RFC destination system in order to successfully create a RFC enabled Bookmark Variants.
  2. Bookmark ID (required) – identification for the query bookmark. Bookmarks that were also created with data can also be used here. In such case, the bookmarked data is not being read from the bookmark; only the query is executed by using the bookmark structure information.
  3. Bookmark Variant Description – to specify the description for a new Query Variant.
  4. After Image Variant – Query/Bookmark Variant ID that is executed during the creation of after image. This allows you to compare outputs for different queries or even the same queries on different systems.

The Query Variant is saved when clicking on Continue button (Enter); before saving is complete, various checks are performed to ensure the correctness of variant definition.

Add existing Query Variant 

By clicking on the Add existing Query Variant button, a list of all the existing Query Variants in the system is displayed. Here you can select your set of variants and by using the Copy button (Enter) these are added into the list of selected variants. Please note that each Query Variant can only be used once for each Test Case.

Add Query Variant from Test Run ID 

By selecting a test run and clicking the Add Query Variants of Run button a list of all existing Query Test Runs is displayed and you can add all the variants used in the selected run into to the Test Case variant selection.

Copy Query Variant from Test Run ID 

By selecting a test run and clicking the Copy Query Variants of Run button, a list of all existing Query Test Runs is displayed and you can add all variants used in the selected run into to the Test Case variant selection as copies.

Generate Query Variants from HM (Optional) 

This option is enabled only if you have HeatMap Query Statistics present in the system and allows you to generate new Query Variants automatically. 

This functionality is available, only if the HeatMap Query Statistics are already installed on the system. After clicking on the button Generate Query Variants from HM (Shift + F6), the screen is displayed where you can define which InfoProvider and Query selection are to be searched for in statistics. 


Specification of filter for queries search


After a filter is specified (optional), you can click on the Continue (Enter) button. The next screen displays the information about queries that are present in HeatMap Statistics and the number of times the query was executed in the system. 
You can generate the Query Variants from these statistics by selecting queries and specifying the number of variants to be created for each of the selected queries. This number only specifies the maximum number of variants that are to be generated. If there are not enough distinct (in terms of used filters) query executions in the statistics, then fewer Query Variants are generated. Variants are then generated after clicking on Continue button (Enter). 


Generation of Query Variants

Create Based on Web Template 

You can also create Query Variants for all of the queries used in specified Web Template. To do this you can click on Create Based on Web Template button (Shift + F8). 


Selection of Web Template

In this screen you can define the Web Template ID and after clicking on Continue button (Enter) the Web Template is searched for all used queries. These queries are presented in a table afterwards (Figure 128) and in this table you can choose the queries to be generated for the Query Variants by using the checkboxes. 



Queries of web template

For each selected query you are presented with the standard Create New Query Variant screen where you can define or change the pre-filled variant values.

Generate Web Template Bookmark Variants 

To create Query Variants based on Web Template Bookmark you can click on Gen. Web Template Bookmark Variants button.

You can create Query Variants based on a specified Web Template Bookmarks by clicking on Gen. Based on Web Template Bookmark button (Shift + F12). The Screen for Web Template Bookmark ID selection is then displayed (Figure 129). 


Selection of Web Template Bookmarks for Query Variant generation


Afterwards, click on Continue button (Enter); each Web Template Bookmark selected is searched for all used queries. For each query found, a new Query Variant is created. All Query Variants filters are filled with the corresponding filtering values from Web Template Bookmark they were found in. 

 If a change was done in Web Template regarding the drill down in query results (i.e. change in displayed columns/rows) this change is also reflected in the output of query in backend testing.


Once the Query Variants have been selected, click on the Continue button (Enter), to save the Variants selection for the Query Test Case and click on the OK button (Enter) in the Test Management.
By selecting the variants from the list and from the context menu, additional options are displayed where you can access following functions:

Add Variants of Test Case 

By clicking on the Add Variants of Test Case button, a list of all existing Query Test Cases is displayed and you can add all the variants used in the selected Test Case into to the Test Case variant selection.

Copy Variants of Test Case 

By clicking on the Copy Variants of Test Case button, a list of all existing Query Test Cases is displayed and you can add all the variants used in the selected Test Case into to the Test Case variant selection as copies.

Create After Images as copies

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


Create After Image Variants as copies

Compare Settings

You can compare the chosen settings for variant with its defined after image variant (if there is one). Select the requested variants and choose Compare Settings option from the context menu. 


Compare settings of before and after image variant

It is possible to check the settings and you can choose what should be compared between variants. After you confirm the selection, the check is done and the table with compare status messages is displayed.

Copy Settings

You can copy settings of variant to its defined after image variant. After the selection of variants is done, you can choose Copy Settings context menu option. A dialog is displayed where you can define which settings should be copied and the source variant for after image variant (if there is any). 


Copy settings of variant to its after image variant

After you confirm the selection, the specified settings are then copied and a message table is displayed with information about updated variants.

Copy Query Variants

You can create copies of Query variants by selecting multiple variants in the selection table and clicking on  Copy Query Variants toolbar button. For each selected variant a new variant is created with exactly the same settings as the source variant. If a copied source variant has a different after image variant specified a copy of this would also be created. The copied after image variant is then assigned to copied source variant as its after image variant. 


Copy Variants

Generate Query Variants from HeatMap Statistics

This functionality is available, only if the HeatMap Query Statistics is already installed on the system. After clicking on the button Generate Query Variants from HM (Shift + F6), the screen displayed is where you can define which InfoProvider and Query selection are to be searched for in statistics. 


Specification of filter for queries search


After a filter is specified (optional) you can click on the Continue (Enter) button. The next screen displays the information about queries that are present in HeatMap Statistics and the number of times the query was executed in the system. 
You can generate the Query Variants from these statistics by selecting queries and specifying the number of variants to be created for each of the selected queries. This number only specifies the maximum number of variants that are to be generated. If there are not enough distinct query executions (in terms of used filters) in the statistics, then fewer Query Variants are generated. Variants are then generated after clicking on Continue button (Enter). 



Generation of Query Variants

Create Variants of Web Templates

You can also create Query Variants for all queries used in specified Web Template. To do this you can click on Create Based on Web Template button (Shift + F8). 



Selection of Web Template


In this screen you can define the Web Template ID and after clicking on Continue button (Enter) the Web Template is searched for all the used queries. These queries are presented in a table afterwards (Figure 128) and in this table you can choose the queries to be generated for the Query Variants by using the checkboxes. 



Queries of web template

For each selected query you are presented with the standard Create New Query Variant screen where you can define or change the pre-filled variant values.

Generate Web Template Bookmark Variants

You can create Query Variants based on a specified Web Template Bookmarks, click on Gen. Based on Web Template Bookmark button (Shift + F12). The Screen for Web Template Bookmark ID selection is then displayed (Figure 129). 



Selection of Web Template Bookmarks for Query Variant generation


Afterwards, click on Continue button (Enter); each Web Template Bookmark selected is searched for all used queries. For each query found, a new Query Variant is created. All Query Variants filters are filled with corresponding filtering values from Web Template Bookmark they were found in. 

If a change was done in Web Template regarding the drill down in query results (i.e. change in displayed columns/rows) this change is also reflected in the output of query in backend testing.

Copy Query/Bookmark Variants

To create a copy of existing Query/Bookmark Variants, select the rows with the variants you want to copy and then click on Copy Query Variants button in toolbar of the table. For each selected Query/Bookmark Variant a copy is then created.

Edit Query/Bookmark Variant

You can edit existing Query/Bookmark variants by double clicking on them in the table. Only Variants that are not used in other Test Runs can be edited. If Query/Bookmark Variant is already used in another Test Run, its details can be only 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


By clicking on  Copy Settings to After Image button. you can copy specified settings of this variant into its after image variant if it is specified.

Mass Edit Variants

You can edit more Query/Bookmark variants at once by selecting required variants from the list and clicking on the Mass Edit Variants  button. Dialog for mass edit of variants is displayed. 



Mass Edit Of Query Variants


You can define new values for the before and after image RFC destination. Changing of these values is done by clicking on Continue (Enter) button. By marking the Edit checkbox, only the values that you specify to be changed, will be replaced in selected variants. If Query/Bookmark variant has a different after Image specified, the after Image RFC destination will be replaced in that variant otherwise there won't be any change. Only variants that are not yet used in test runs can be changed by mass edit.

You can also change filter values used in selected Query variants with the following steps:

  1. Select checkboxes to confirm that you want to apply changes to the selected variants. Click on a Filter Values button to define new values of the InfoObject filters which are used in the queries.
  2. This functionality enables you to define various change rules for before and after image query variants. You need to define required mapping of filter values based on InfoObjects.
     
  3. Confirm the execution of mass editing by clicking on Continue button.
  4. This step adjusts the filter values of queries based on the specified rules.

Important notes for mass edit of Query variants filter values:

  • Query filter values are changed based on an InfoObject. When a query contains two variables which are based on the same InfoObject, in the case of mapping, both will be changed.
  • Filter values of queries are changed on a value level. If a Query variant contains for example a range selection (I BT 2006 2007) and mapping is defined for value 2007 => 2008 only the upper boundary of range filter will be changed (I BT 2006 2008). If the same mapping would be used but the previous range filter would change to (I BT 2006 2010) mapping would not be applied.  
  • Mapping values of filters should be defined in a user readable format (the same format as it is used by executing queries in RSRT transaction). The functionality automatically applies correct conversion exits to convert the mapping values to a machine readable format. 
  • Already used query variants in other runs can't be changed using this functionality, as they can't be changed manually. 

Additional options available from (DV-2002) Variant Editor:

Variant editor

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

Transport Query/Bookmark Variants

It is possible to add specified Query Variants to a transport so they can be transferred to another system (with Validate installed). To specify which Query/Bookmark Variants should be transported you need to select these from a list as shown on next Figure. Options for filtering and sorting in ALV table can be used to select specified Query Variants more easily. 



Selecting Query Variants to be transported


After selecting desired Query Variants, click on the  Transport Query Variants button. A dialog is displayed, where you can select a request and confirm the transport for selected Query Variants.

 

Export Query Variants Request Dialog


It is important to note that Query Variants carry information about query names and filtering values, but not the query structures themselves; therefore these should be imported only to a system where Validate is installed and where the same queries with the same structure exist.

Delete Query/Bookmark Variants

To delete an existing Query/Bookmark Variants, select the rows and then click on the delete button in the ALV toolbar. 

Any Query/Bookmark Variants that are still in use in the Backend Testing will be locked; therefore it is necessary to delete the Query Variants from the run before deleting them permanently from the Query Variant Editor.

Cleanup Query Variants

You can delete all unused Query variants by clicking on  Cleanup Query Variants button. The First screen displays a pre-selection of filters of variants where you can restrict which variants should be checked for deletion. After you confirm this screen, a check is performed to find all unused variants. A variant is unused if it is not assigned to any Test Case or Test Run. If a variant is used in another variant as an after image variant and that variant is used in any Test Case or Test Run, it is then evaluated as used on not presented for deletion. 




Query Variant Cleanup Pre-selection



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