In this blog, we would discuss the basic concepts regarding eCATT and how to develop a test script and test configuration to upload a test data file with a practical example.

What is eCATT?
eCATT (extended Computer Aided Test Tool) is an SAP Testing Tool used to automate & test business scenarios in SAP R/3. Each test that was executed will generate a detailed log that will give the test process and results. If the testing is successful without any errors log, we can say that the business scenario mapped in SAP is correct. If the test results shows error then the problem can be analyzed using the error log that is generated by the system.

So in short in this blog you will see what eCATT is, how we can use it; how we can load a test data from a file in ECC 6.0 with an example.

After reading this blog, you will have understanding about eCATT tool. And you will be able to create a test script and test configuration in which test data can be loaded from a file.

 

Prior to execute/create test configuration, we need to create a test script. In many cases, it is helpful to create a Test Data Container and/or a System Data Container but these will not be used in this example.

Transaction Code: SECATT

Step-1: Create Test Script

eCATT screen SAP eCATT Step by Step Guide

Click Create or F5 and the following screen will be displayed.

eCATT test script SAP eCATT Step by Step Guide

Enter Title as required and the Component as BC-TWB-TST-ECA and Click on the Pattern Button on the menu bar.
An Insert Statement dialog box appears.

eCATT insert stmt  SAP eCATT Step by Step Guide

Select Group as UI Control, Command as TCD (Record), Transaction code as MM01 and Press Enter. The system generates a default interface as a MM01_1.
Click the enter

System will start Record the function that you are attempting to perform i.e creation of Material Master.

eCATT create material SAP eCATT Step by Step Guide

Select the material views, organizational elements as required and follow the views of the material master. After creating material master system will be returned to the eCATT and prompt the alert box with message Do You Want to Transfer the Data, click on YES.

You will see the following screen:

eCAT test script SAP eCATT Step by Step Guide

Now double-click on the interface. In this example the interface was named MM01_1, you will get following screen

eCAT test script2 SAP eCATT Step by Step Guide

By using split screen now you can navigate through various screens you are recorded and replace the fixed values with variables.

eCAT test script3 SAP eCATT Step by Step Guide

This is done by opening the Dynpro menu and going through each numbered screen to review your input.
From the above screen print you can see the values Industry sector “M “and Material Type “FERT” as in input values i.e. VALIN. You must change it to a value as shown in the next screen.

eCAT test script4 SAP eCATT Step by Step Guide

The variable names   are MBRSH and MTART for industry sector and Material type respectively. Once you enter the variable name and press ENTER, the following screen will appear.

eCATT parameter SAP eCATT Step by Step Guide

The default parameter will be Local. You can change this to Import and click on the Yes button.
The screen will now look like the following screen. Note the eCATT icon SAP eCATT Step by Step Guide icon on screen 1 has changed from the Green Square. This icon indicates a variable is present.

eCAT test script5 SAP eCATT Step by Step Guide

Now you can change the all the variables in same process
Click on SAVE icon after completing and save as a local object or place in a development class to transport the eCATT.

eCAT test script6 SAP eCATT Step by Step Guide

eCAT test script7 SAP eCATT Step by Step Guide

Click on the SAVE icon you can see the message” Test Script: “………..” saved successfully is generated.

Step-2: Creating Test Configuration
Before executing eCATT first you need to create a Test Configuration. Use Transaction code SECATT to executing and entering a name for the Test Configuration and clicking on the Create icon. (In this Example I have given same name as Test Script)

eCATT test configuration1 SAP eCATT Step by Step Guide

eCATT test configuration2 SAP eCATT Step by Step Guide

Give Test Configuration a Name and Component and then click on the Configuration tab to see the following screen:

eCATT test configuration3 SAP eCATT Step by Step Guide

Enter the name of the Test Script you would like to execute.

eCATT download icon SAP eCATT Step by Step GuideDownload icon or just press ctrl+shift+F11. You will be prompted with a window “save as” dialog box. Accept the default name and directory and click save, here file will be saved in text format (ex: VAR_ECTC_Z_MATERIALMASTER_MM01.TXT)

After click on SAVE system will prompt the following alert box

eCATT variant data SAP eCATT Step by Step Guide

This appears since we did not create a Test Container. Click on the YES icon and you can see the message at the bottom of the screen “variants successfully downloaded”.

eCATT variant data2 SAP eCATT Step by Step Guide

Now click on the Variants tab and you should see the following screen:

eCATT test configuration4 SAP eCATT Step by Step Guide

We must now set the default mode for each time the Test Configuration is executed. Since you will always be running the script with an external file choose the External Variants /Path option.

eCATT configuration option SAP eCATT Step by Step Guide

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 below:

eCATT test configuration5 SAP eCATT Step by Step Guide

Now click on the SAVE icon and save as a local object or place into a development class (package) so that it can be transported.

The message eCATT save icon SAP eCATT Step by Step Guide appears at the bottom of the screen.

Now you are ready to execute your new eCATT Test Script via the Test Configuration. Open your .txt file and convert the file in to excel file (ex: VAR_ECTC_Z_MATERIALMASTER_MM01.xls) enter your variables.

eCATT xls data SAP eCATT Step by Step Guide

Convert the same Excel file to text file to upload during the execution. If you upload it in .xls format, then SAP will not be able to read it.
Now go back to SAP and run tcode SECATT and enter your Test Configuration and click Execute. You can see the below screen:

eCATT test configuration6 SAP eCATT Step by Step Guide

You can choose your Error behavior. Change it to “NO termination, Continue with Next Script Command”.
Click on the Variants tab and validate the mode and file path are correct.

eCATT test configuration7 SAP eCATT Step by Step Guide

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 the CATT the foreground method of execution is very helpful when trying to troubleshoot errors in the test script.

eCATT test configuration81 SAP eCATT Step by Step Guide

Then click execute and you are done.
eCATT display log appears:

eCATT log display SAP eCATT Step by Step Guide

eCATT log display2 SAP eCATT Step by Step Guide
Please send us your questions, comments or assistance, and our team would be glad to assist you.

By Gopichand Panghate. (on behalf of SAP Consulting Team)


architectSAP
SAP :: Streamlined

SAP ECC , SAP HR, SAP CRM, SAP SCM, SAP BW, Business Objects, SAP ABAP Development, SAP BASIS and SAP NetWeaver consulting, implementation, development and support services to SAP customers across diverse industries globally.
Have a question on SAP? Write to our SAP Architect.

(We promise a no-obligation consulting reply)