Friday, 16 March 2018

How eCATT Executes the Commands TCD and SAPGUI

SAPs Extended Computer Aided Test Tool (eCATT) offers in its language two interesting commands – TCD and SAPGUI – to executes some recorded activities. In this blog post I describe how the commands works, from the recorded XML file to the BCD respectively to the OLE interface of the SAP GUI Scripting.

TCD


You can with the TCD eCATT command record very easily activities and executes it as batch data communication.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Press the pattern button of the toolbar and choose UI Control with TCD (Record), define the TAC and the interface name. Now your TAC is open and you can do your activities. When you are done quit the TAC and you will get a request.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

If you say yes your script looks e.g. like this and you can execute it.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

But what happens in the background?

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

The eCATT line interpreter executes your script and calls the method EXECUTE_TCD, which calls the function CAT_TCD_CAL and this runs your activities as batch data communication CALL TRANSACTION command.

SAPGUI


Batch data communication offers not all possibilties. In this case you can use the SAPGUI command. It records your activities also easily and executes it via the SAP GUI Scripting interface.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Press also the pattern button and choose SAPGUI (record).

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Define your transaction code and start the recording. Now an additional dialog pops up.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

If you are ready with your activities press stop recording and your script looks like this.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

Here we see now very good the difference between BDC and SAP GUI Scripting. But much more interesting is the background processing.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

The eCATT line interpreter executes your script and calls the method EXEC_SETGUI. The REPLAY_SAPGUI method calls the SAPGUI_INTERNAL_REPLAY method which starts the transaction code. After the methods SAPGUI_REPLAY_PROCESSED_SCREEN and SAPGUI_REPLAY_USERCHANGES shares the methods SAPGUI_THROW_COMMAND and SAPGUI_THROW_GUI_ELEMENT. Both use last but not least the OLE commands GET and SET PROPERTY as well as CALL METHOD.

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

With this knowledge is it now very easy follow the process from the eCATT script to the final OLE command call.

The eCATT script files itself are stored as XML files, here an example section:

SAP ABAP Development, SAP ABAP Testing and Analysis, SAP ABAP Tutorials and Materials, SAP ABAP Certifications

No comments:

Post a Comment