How To Create An Ecatt
How To Create An Ecatt
Applies to:
SAP ECC 5.0 and above
Summary
This is a step by step guide to create a CATT script in SAP ECC version 5 and upwards. It can be used by
beginners to create a basic CATT script.
Author(s): Biju Thantry Parasuraman
Company: Infosys Technologies Limited.
Created on: 25 April 2007
Author Bio
Biju Thantry Parasuraman is a SAP Consultant with Infosys Technologies Ltd. He has more than six years of
Domain expertise in the field of Hitech and Discrete manufacturing of which more than three years have
been as an SAP consultant.
© 2007 SAP AG 1
How to Create an eCATT?
Table of Contents
Click create or F5 and you will then see the following screen:
© 2007 SAP AG 2
How to Create an eCATT?
Enter title
Enter component
Click on Pattern button on menu bar
© 2007 SAP AG 3
How to Create an eCATT?
After backing out of the function you were recording you will be returned to the eCATT screen and you
should see a prompt asking if you want to transfer the data. Answer Yes. You should then see the following:
Now double-click on the Interface. In this case the interface was named PFCG_1.
© 2007 SAP AG 4
How to Create an eCATT?
Using the split screen you must now navigate through the various screens you just recorded replacing fixed
values with import variables.
© 2007 SAP AG 5
How to Create an eCATT?
This is done by opening the Dynpro menu and going through each numbered screen to review your input. In
this process my eCATT will change the description of a role. So I will have two variables: 1) the role name
and 2) the description.
From the screen print above you can see I located the Role Name on the first screen by double-clicking on
the menu node named “Field.” You must then move over to the third subscreen and tab over to the VALIN
column where you find the actual value you entered into SAP when recording the interface. In this case that
value is “ZP:FI:AM:DSP_RPT.” You must then change that to a variable as shown on the next screen.
© 2007 SAP AG 6
How to Create an eCATT?
The variable name is Z_ROLE_NAME. Once you enter the variable name hit the enter key and the following
screen will appear:
The default parameter type will be Local. You should change this to Import and click on the Yes button.
The screen will now look like the following screen. Note the icon on screen 1 has changed from the
green square. This icon indicates a variable is present.
© 2007 SAP AG 7
How to Create an eCATT?
Now change all the other variables in the same manner. When complete click on the save icon and save as
a local object or place in a development class if you desire to transport the eCATT.
Before you can execute the eCATT you must first create a Test Configuration. Do this by executing
SECATT transaction code and entering a name for the Test Configuration and clicking on the create icon.
This name can be anything in the customer name space
© 2007 SAP AG 8
How to Create an eCATT?
Give the Test Configuration a Name and Component and then click on the Configuration tab to see the
following screen.
© 2007 SAP AG 9
How to Create an eCATT?
Enter the name of the test script you would like to execute when you execute the test configuration. In this
case it is the test script of the same name. See below.
© 2007 SAP AG 10
How to Create an eCATT?
Now we need to create the Excel template file to store the variable data in. Do this by clicking on the
download icon or just press ctrl-shift-F11. You will then be prompted with a Windows “save as” dialog box.
Accept the default name and directory and click save.
This appears since we did not create a Test Data Container. Click on the Yes icon and you should see the
message at the bottom of the screen “variants successfully downloaded.”
© 2007 SAP AG 11
How to Create an eCATT?
Now click on the Variants icon and you should see the following screen.
We must now set the default Mode for each time the Test Configuration is executed. Since we will always be
running the script with an external file choose the External Variants / Path option.
© 2007 SAP AG 12
How to Create an eCATT?
Now click on the drop-down on the File and choose the variant file you just created in the previous step.
Your screen should look similar to the one shown here.
Now click on the save icon and save as a local object or place into a development class (package) so it can
be transported.
You are now ready to execute your new eCATT Test Script via the Test Configuration. Open your txt file and
populate with your data. Be sure and number each record in your data file or eCATT will not be able to read
the data correctly. When you are done it should look similar to this:
© 2007 SAP AG 13
How to Create an eCATT?
Save your Excel file but be sure to keep it as a plain text file. If you update it to the .xls format, then SAP will
not be able to read the file.
Now go back to SAP and run tcode SECATT and enter your Test Configuration and click execute. You will
be taken to this screen:
© 2007 SAP AG 14
How to Create an eCATT?
You can choose your error behavior. I normally change it to “S No Termination, Continue with Next Script
Command”.
Next click on the variants tab and validate the mode and file path are correct.
© 2007 SAP AG 15
How to Create an eCATT?
Next click on the UI Control and specify whether you would like to execute in the foreground or background.
The Test Configuration will normally default to the background. As with CATT the Foreground method of
execution is very helpful when trying to troubleshoot errors in the test script.
NOTE: If you are running the test script remotely you must create a system data container to store the name
of all the possible RFC connections you may potentially need when executing a script. These RFC
connections are taken from table RFCDES (see SM59). Then in the Test Configuration you reference the
© 2007 SAP AG 16
How to Create an eCATT?
System Data Container name and the specific Target System. This information is found under the Shared
tab in the Test Configuration.
© 2007 SAP AG 17