Entering content frameProcedure documentation Part 6 - Test Data Containers Locate the document in its SAP Library structure

Use

Test data containers allow you to maintain data variants independent of test scripts. They contain data for use with the input parameters of test scripts.

Only the parameters specified in a test data container that have the same name and type as those in the test script will be accessible.

A test data container need not have the same number of parameters as the test script. Missing parameters will have default values supplied by the test configuration. Extra parameters are ignored.

You will now create a new test script and some test data containers that you will use latter in a test configuration.

Procedure

  1. Create a new test script. Name it XYZ_VARIANTS (where XYZ are your initials).
  2. In the parameter list, create five parameters of ABAP type C as shown in the table below:
  3. Parameter

    Value

    Visibility (I/E/V)

    Data Type in ABAP

    Length

    ALPHA

    1

    I

    C

    128

    BETA

    2

    I

    C

    128

    GAMMA

    3

    I

    C

    128

    DELTA

    0

    E

    C

    128

    OMEGA

    4

    V

    C

    128

  4. In the command editor, add the following instruction:
  5. DELTA = ALPHA + BETA + GAMMA + OMEGA.
  6. Save the test script.
  7. On Extended Computer Aided Test Tool: Initial Screen, select Test Data and enter a name for the test data container. In this case use XYZ_TD1 (where XYZ are your initials).
  8. Choose This graphic is explained in the accompanying text.
  9. The test data editor appears.
  10. Choose the Attributes tab, and maintain the attributes.
  11. Choose the Parameters tab. Observe that it is similar to the parameter editor in the test script editor. However, there is no Visibility of Parameter (I/E/V) field.
  12. Create the parameters as shown in the table below:
  13. Parameter

    Value

    Data Type in ABAP

    Length

    ALPHA

    11

    C

    128

    BETA

    22

    C

    128

    GAMMA

    33

    C

    128

    EPSILON

    44

    C

    128

  14. Choose the Variants tab.
  15. You see that the ECATTDEFAULT variant has parameters ALPHA, BETA, GAMMA, and EPSILON with the values that you entered on the Parameter tab. You can create other variants that have different values for these parameters.
  16. Create variants as shown in the table below:
  17. Variant

    ALPHA

    BETA

    GAMMA

    EPSILON

    ECATTDEFAULT

    11

    22

    33

    44

    V1

    1

    4

    2

    4

    V2

    7

     

    4

    6

    V3

    9

    3

     

    6

  18. Choose This graphic is explained in the accompanying text, and save as a local object.
  19. Create a second test data container. Name the new test data container XYZ_TD2, where XYZ are your initials. Make this test data container similar to the first, but use different values.

Summary

Data containers contain data variants. Only parameters of the same name and type as those in a test script will be usable with that test script.

 

Leaving content frame