|
The Computer Aided Test Tool (CATT), not to be confused with CATS (Cross Application Time Sheet) was originally designed for testing purposes. It is a really useful tool for uploading data as well as repetitive configuration activities.
Before you can execute a CATT procedure, you need to ensure that 2 relevant settings are in place.
- You need to ensure that the CATT checkbox is ticked on your own user settings - bottom left hand side on the "default" tab.
- You need to ensure that the client in which you are working is enabled to allow the running of CATT procedures. Use transaction code SCC4 to check and change the attributes of the client. On the bottom left hand side, the CATT checkbox should be ticked.
To get to the CATT screen, use the transaction code = SCAT
You will be taken to the main CATT screen titled "Computer Aided Test Tool: Initial Screen"
Choose your file name - use the customer name range starting with Y or Z.
Click on the TCD icon
Enter the transaction code and hit the return key. Run through the entire transaction, making sure that you populate the minimum required data. If SAP defaults certain data, you need to overwrite it so that it is recorded on the CATT - assuming of course that you can enter data into this field. Each time you hit the return key, SAP records the screen - you will notice the clock on the bottom left hand side of the screen.
Once you have finished the transaction and saved the data, click on the green back arrow, until you get back to the same dialogue box where you entered the transaction code.
Click on the blue/red circle icon to stop recording.
You now have to specify the attributes of the CATT on the screen titled "Test Case Attributes: Display test case Zxxxx"
You will need to enter an application area. Choose the relevant area.
Hit the green back arrow icon. You will be prompted to enter a development class in the dialog box. If you do not wish to transport the CATT (i.e. you wish to use the CATT only in the development client) then click on the icon "local object". The development class will be indicated as "$tmp". If you wish to transport the CATT then choose a development class that has been set up to allow transports.
Remember that CATT procedures, like ABAP programs, are client independent - which means that you can create it in one client and run it on any other client on that instance.
Even if you save the CATT as a local object, you can still execute the CATT in another client on another SAP server. When executing the CATT, choose the "Remote Execution" icon. You will then be prompted to log on to the client you choose from the RFC destination drop-down. (RFC stands for Remote Function Call and is the technical name given when linking 2 SAP clients/systems - naturally the RFC connection needs to have been set up to allow you to use this method)
Note: you may be blocked from running the CATT in other system clients due to restrictions on the client or on your user ID.
Save the CATT and then click on the green back arrow - click on the save icon if prompted to save again.
You will now be taken back to the initial screen. You now need to stipulate which fields you need as variables. These are called parameters in a CATT procedure. Make sure that the radio button is on the "function" field on the initial screen.
Click on the "Change" icon. This will take you to the screen titled "CATT: Maintain Functions Test case Zxxxx"
You should have at least 1 function, which should have the function TCD. The object should be the transaction code that you used.
Click on the "Choose" icon (magnifying icon).
You will be taken to the screen titled "CATT: Function Details TCD Test Case Zxxxx". The different screen numbers are coloured red, whilst the descriptions should be in blue.
Double-click on the first entry or place the cursor in the field and click on the "Choose" icon.
You should be taken to a screen titled "Simulation of screen "SAPMPxxxxx" (1/n)" - where 1 refers to the first screen and "n" is the number of screen shots saved in the CATT.
Click on the field that you need to act as a variable and click on the Insert Import Parameter icon (Yellow T-square with 2 red arrows).
NB: Ensure that you choose the actual field and screen where you entered the data in SAP. Sounds like simple advice - but something that catches many users
At the bottom left hand side of the screen you should see "&xxxxx created" and the field contents on the screen should change colour.
Use the right arrow to move to the next screen. Once you have done this for all the screens where you have variables - use the green arrow to go back and save the CATT.
At the initial screen you can change the defaults used in the CATT. The defaults are held in the "parameters" attribute which you need to check. Click on the change icon to edit and view the entries which have been proposed as variables and the parameters and defaults that are to be used.
If you wish to return a blank value then use the value ' ' i.e. single apostrophe space single apostrophe.
At the initial screen for CATT procedures, use the menu path
Goto External Variants Export Defaults
Choose the required menu path and target folder, where the system will place the file. The easiest file type to use is a text file (.txt extension).
Open the file in Excel. You will be prompted with the import wizard. Ensure that the radio button is set to "delimited". You can click on the finish icon - as long as you do not have any fields which start with a leading zero. If you do then you need to ensure that these are marked as "text" fields during the import process.
You will see that the fields specified as variables are in different columns.
The 1st row holds the technical field name, the 2nd the actual field name and the 3rd row holds the default values that you entered. Line 4 lets you know that changing the default data will not have any effect on the CATT. If you need to change any data you need to do so on SAP and re-export the file.
Insert your data into the correct columns from row 5 onwards.
Save the file as a text file. When exiting out of Excel you will get a warning message along the lines of "... is not in MS Excel xx format", do you wish to save your changes... Remember to say no at this point.
You need to exit the file. The CATT will give you an error in loading the file if you still have it open in Excel while trying to run the CATT procedure.
Go back to SAP to the main screen for CATT. Choose you CATT and click on the execute icon.
Click on the Choose icon at the "External from file" option.
It is best to run it in foreground to test it for a few dummy runs or a small sample of the first few lines of the actual file. Just click on the enter key each time. The finished result gives you a log to reflect the successful results.
Run it in background mode when you are doing it "for real". You will still be able to retrieve the log by using the menu path: Utilities > Logs
|