Back in July of 2022 we published an article highlighting some of the support and guidance tools that can be used during an implementation project to identify errors before full deployment, or to troubleshoot an issue when identified in a productive system. One such tool that we briefly touched upon was the ABAP Test Cockpit (ATC).
There are times when customer implementations require not just standard SAP coding, but also custom ABAP coding tailored to specific customer requirements. The ATC is a central quality assurance toolset through which users can create static functional, performance and security code checks as well as ABAP Unit tests for ABAP programs. To make sure migrations go smoothly and provide comparable check results throughout the company, the ATC is compatible with SAP’s Code Inspector, SAP’s tool for the static analysis of ABAP programs and other SAP repository objects. This means that custom Code Inspector checks and variants can be reused in the ABAP Test Cockpit.
Prior to the SAP S/4HANA 2022 release, there were no SAP TM specific checks available in the toolset. However, with the new release, SAP has delivered 11 TM checks. Currently the ATC checks are available only on embedded and decentral On Premise or Private Cloud SAP S/4HANA systems from release 2022 on. SAP plans to offer downports in upcoming months.
Demo of Delivery Query ATC results
The first step is to activate the ACT checks for TM (see below):
When activated the checks can be found in the TM folder (see below):
The currently available ATC checks for SAP TM are (ATC checks were ported into older versions as well):
1. Check for TM buffer super class (/SCTMS/CL_CI_BUFFER_SUPER)
This check class verifies the correct usage of the TM Buffer Variants Dispatcher in the TM BO’s (Business Objects). It is checked if the buffer dispatcher of a BOPF BO doesn’t inherit from the class /SCMTMS/CL_BUFVAR_DISPATCHER. And if the DO Delegation Class in a BOPF Dependent Node doesn’t inherit from Class /SCMTMS/CL_BUFVAR_DODEELEGATION. (available from release SAP S/4HANA 1909 SP08)
2. No logflag set in data element (/SCTMS/CL_CI_CHANGEDOC_FLAG)
This check class is relevant for BOBF BO’s which have a Change Document object. It is checked if all relevant data elements of the BO are marked for Change Document and leaves a warning if a relevant data element, which is not part of the exclusion list, is not marked.
The following data elements are usually excluded from the check: GUIDs of generic type /BOBF/CONF_KEY; admin data, like Last Change User/ Last Change Timestamp, where the change information is already contained in the relevant DB fields; explicitly excluded data elements. (available from SAP S/4HANA 2020 SP06)
3. Check Change Documents for BOPF Business Objects (/SCTMS/CL_CI_CHECK_CHANGE)
This check class is relevant for Business Objects (BO) which have a Change Document Object (CDO) assigned. It compares the list of database tables in the BO and CDO for inconsistencies like a missing assignment of a BO to a CDO with an existing Cross BO Association to the Change Document BO in the BO. It also compares if the CDO doesn’t contain all database tables of the related BO or if the CDO contains database tables which are not in the related BO. (available from release SAP S/4HANA 1909 SP08)
4. Check for duplicate elements in BOPF Business Object Meta Models (/SCTMS/CL_CI_DUPLI_ELEMENTS)
This provided check class checks BO Meta Models for duplicate BOBF Elements. Duplicates of the elements can occur, when deleting or recreating parts of the Meta Model and then implementing a Support Package/ SAP Note which contains BO Meta Model updates for the manually recreated BO Element.
At runtime, only one of duplicate elements is used (random, but stable per system). (available from release SAP S/4HANA 1909 SP08)
5. Check for locking action super class (/SCTMS/CL_CI_LOCK_ACT_SUPER)
This ATC check verifies the correct usage of the TM Locking Superclass in TM BOs. It is checked that a BO lock/unlock action implementation class doesn’t inherit from the /SCMTMS/CL_LIB_A_FLOCKO class. And it also checks that a BO lock/unlock action doesn’t have an implementation class. (available from release SAP S/4HANA 1909 SP08)
6. Check if sy-tabix and sy-index is used correctly (/SCTMS/CL_CI_LOOP_SYNTAX)
This ATC check is relevant for ABAP classes. It checks for the right usage of SY-TABIX and SX-INDEX in LOOP- and DO-ENDDO-branches.
In the following situations the check will return a warning: SY-INDEX is used within a LOOP-ENDLOOP branch/ after READ TABLE statement; SY-TABIX is used within a DO-ENDDO branch. (available from release SAP S/4HANA 2021 SP04)
7. Check Mergeability of Determinations(/SCTMS/CL_CI_MIN_DET)
With this ATC checks it is checked if there are determinations defined, which can be merged. The BO performance is influenced by the number of determinations in the same BO. Therefore, the determinations for the same Business Object should always be merged. (available from release SAP S/4HANA 2023 FPS1)
8. Check Mergeability of Validations(/SCTMS/CL_CI_MIN_VAL)
This provided check class checks if there are validations defined, which can be merged. The BO performance is influenced by the number of validations in the same BO. Therefore, validations for the same action/consistency validations for the same Business Object should always be merged. (available from release SAP S/4HANA 2023 FPS1)
9. Check usage of TM determination superclass(/SCTMS/CL_CI_TST_DET)
This ATC check verifies the correct usage of the TM Determination superclass in TM Business Objects. It is checked whether the determination class doesn’t inherit from /SCMTMS/CL_D_SUPERCLASS class and/or the determination doesn’t have a class implemented. (available from release SAP S/4HANA 1909 SP08)
10. Check usage of TM query superclass(/SCTMS/CL_CI_TST_QUER)
This ATC check verifies the correct usage of the TM Query superclass in TM Business Objects. It is checked whether a query class doesn’t inherit from /SCMTMS/CL_Q_SUPERCLASS class, a query overwrites the /BOBF/IF_FRW_QUERY~QUERY() method and/or the query doesn’t have a class implemented. (available from release SAP S/4HANA 1909 SP08)
11. Check usage of TM validation superclass (/SCTMS/CL_CI_TST_VAL)
This ATC check verifies the correct usage of the TM Validation superclass in TM Business Objects. It is checked whether the validation class doesn’t inherit from /SCMTMS/CL_V_SUPERCLASS class and/or the validation doesn’t have a class implemented. (available from release SAP S/4HANA 1909 SP08)
For guidance on how to write an ATC check please refer to the blog article “Remote Code Analysis in ATC – How to write an ATC check” which acts as a central repository for all manner of ATC related guidelines and setups.
In case you have questions or are curious to find out more on how to create checks for the Code Inspector, you can read about it the guide “How to Build a New Check for the Code Inspector”.
For more details about the involved roles (developers, quality experts, admins) please take a look at the corresponding Getting Started guides:
For more information about SAP Transportation Management, please follow us on social media, our YouTube channel or our community pages:
SAP TM Community:
SAP Transportation Management | SAP Community
SAP Digital Supply Chain Channel:
https://www.youtube.com/channel/UCELmE2CEAkcwqpBLnuZHufA
TM LinkedIn Community:
SAP Transportation Management | Groups | LinkedIn
Release information and restrictions of TM on SAP S/4HANA 2022:
S/4HANA 2022 Release/Restrictions Information
In case you do not find your specific question there, feel free to post your question via the following form:
https://answers.sap.com/questions/ask.html?primaryTagId=01200615320800000705