ATC Package Violation Error Missing Use Access USEM
When I executed ATC checks on my recent SAP HANA developments, I see that in the ATC Result Browser I have "Package Violation - Error - Missing use access (USEM). ... ..." under title "Package Check for Source Code Objects and ABAP Dictionary Objects" listed as priority 1 items.
Here is a screenshot from one of the ATC statick code check errors.
You see this package violation error can not be hidden by using a pragma or a pseudo-comment.
ABAP developers somehow have to resolve this ATC issue
Here is the details of the error.
Package Check for Source Code Objects and ABAP Dictionary Objects
Package Violation - Error - Missing use access (USEM).
Missing use access for usage of CLAS CL_SADL_GTK_EXPOSURE_MPC.
The package /.../SOM_INFO_INVOICE of the client object CLAS /.../CL_SOM_INFO_INVLIST does not have sufficient use access to use the development object CLAS CL_SADL_GTK_EXPOSURE_MPC (package SADL_GW_EXPOSURE_MPC).
The hint here for ABAP programmer to solve this ATC error is access to use the development object CLAS CL_SADL_GTK_EXPOSURE_MPC (package SADL_GW_EXPOSURE_MPC)
So I started with ABAP package SADL_GW_EXPOSURE_MPC using SE80 transaction (ABAP Workbench). I followed the parent packages up to SADL_GW
When I display the package definition SADL_GW and switch to Package Interfaces tab, I see that SADL_GW_RT_PUBLIC package interface includes all the objects required by all implementors of SALD-based services.
So I thought if I can add this package interface to Use Accesses of my development package, I can resolve the ATC package violation error.
I added the package interface SADL_GW_RT_PUBLIC in my development package as follows:
Open the ABAP package in SE80 ABAP Workbench, go to definition and switch to "Use Accesses"
Click on Create button.
Type the package interface and press Enter, then save your own ABAP development package.
If you cannot add the package interface that you don't have use access, and if you have a superpackage then you can try to add the package interface in Use Accesses of the parent package. Then in subpackage, copy the Use Access from superpackage.
Please note that, after you run ATC check if you still experience the same error, you are probably using a wrong package interface that does not expose the required ABAP object. For example CL_SADL_GTK_EXPOSURE_MPC class in my case.
It is possible to see the ABAP objects that the package interface includes in its definition. If you drill-down the package interface you will see the ABAP objects list that the interface covers.
Another issue that you can experience during package violation error resolution is that you might be trying to use a package interface that cannot be used in your package.
Then you can experience an error message similar to one as follows:
Package interface ... points to a package that is too deeply nested
Try to select another package interface from the superpackage of the target package. In my case, I could not use package interfaces from SADL_GW_EXPOSURE_MPC package.
So I went up for parent package SADL_GW_EXPOSURE. Unfortunately it did not help.
So I tried its parent package SADL_GW_DT and tried its interfaces as a use access in my package.
Finally, I have the right package interface under SADL_GW package.
So be prepared to try and fail until you end up with a solution.
Package Violation - Missing use access for usage of CLAS CX_AMDP_ERROR
I experienced another package violation error where I called an AMDP (ABAP Managed Database Procedure) within a TRY-CATCH block catching the CX_AMDP_ERROR in catch clause.
The error is detailed in ATC result list as follows:
Package Check for Source Code Objects and ABAP Dictionary Objects
Package Violation - Error - Missing use access (USEM).
Missing use access for usage of CLAS CX_AMDP_ERROR.
The package /.../SOM_INFO_INVOICE of the client object PROG /.../SOM_DISPLAY_INVOICE does not have sufficient use access to use the development object CLAS CX_AMDP_ERROR (package SABP_AMDP_KRN).
I tried to use package interface SABP_AMDP_KRN_PUBLIC from SABP_AMDP_KRN package but I got below error when I tried to add it on Use Accesses tab:
Package interface SABP_AMDP_KRN_PUBLIC points to a package that is too deeply nested
To resolve this ATC Package Violation error, I used the package interface SABP_MAIN_PUBLIC_AMDP from ABAP package SABP_MAIN and added it in the Use Accesses tab in my ownn development package.
Package Violation - Missing use access for usage of CLAS CL_DEMO_OUTPUT
I found it handy to use ABAP class CL_DEMO_OUTPUT to display internal table data during programming. But I see that ATC check on my program also lists this object under "missing use access" package violations.
Package Check for Source Code Objects and ABAP Dictionary Objects
Package Violation - Error - Missing use access (USEM).
Missing use access for usage of CLAS CL_DEMO_OUTPUT.
The package /.../SOM_INFO_INVOICE of the client object PROG /.../SOM_DISPLAY_INVOICE does not have sufficient use access to use the development object CLAS CL_DEMO_OUTPUT (package SABAP_DEMOS_OUTPUT_STREAM).
In this case ABAP programmer can add package interface SABAPDEMOS from SABAPDEMOS package into Use Accesses list.
Missing use access for usage of FUNC CACS_SET_USER_PARAMETER
An other package violation error that I experienced is Missing use access for usage of FUNC CACS_SET_USER_PARAMETER where I used ABAP function module CACS_SET_USER_PARAMETER to insert a new user parameter or modify an existing user parameter into SAP table USR05.
Package Check for Source Code Objects and ABAP Dictionary Objects
Package Violation - Error - Missing use access (USEM).
Missing use access for usage of FUNC CACS_SET_USER_PARAMETER.
The package ZPackageName of the client object PROG ZProgramName does not have sufficient use access to use the development object FUNC CACS_SET_USER_PARAMETER (package CACSGC).
Cannot be hidden using a pragma or pseudo-comment
To resolve this ATC error, I added CACS10_INT package interface from CACS10 package which exposes function module cacs_set_user_parameter.
Missing use access for usage of DTEL RFCDEST (package SRCX)
Another package violation error that ABAP programmers have experienced probably is related with ABAP DDIC object RFCDEST data element.
Package Check for Source Code Objects and ABAP Dictionary Objects
Package Violation - Error - Missing use access (USEM). ... ...
Priority 1
Package /.../SOM_INFO_MATERIAL does not have sufficient use access.
The package /.../SOM_INFO_MATERIAL of the client object TABL /.../SCF_INFRFC does not have sufficient use access to use the development object DTEL RFCDEST (package SRCX).
Cannot be suppressed using a pragma or pseudo-comment
The data element RFCDEST is created under SAP package SRCX (from BASIS superpackage) and released for public use via package interface SRCX_PUBLIC. So I added the SRCX_PUBLIC package interface from SRCX package in the Use Accesses of my development package in order to resolve the ATC check finding.
If you develop RFC functions and call RFC functions from ABAP programs, developers can experience the same type of error for other related objects.
Missing use access for usage of TABL RFCSI.
The package ... of the client object FUGR ... does not have sufficient use access to use the development object TABL RFCSI (package SRCX).
Or
Missing use access for usage of FUNC RFC_VERIFY_DESTINATION.
The package ... of the client object FUGR ... does not have sufficient use access to use the development object FUNC RFC_VERIFY_DESTINATION (package SRCX).
To resolve this ATC finding again adding the SRCX_PUBLIC package interface from SRCX package in the Use Accesses of the development package will be enough.
Package Violation Error The used object is not visible (NVIS)
Another error that is related with package violation error I experienced was that:
Package Check for Source Code Objects and ABAP Dictionary Objects
Package Violation - Error - The used object is not visible (NVIS).
Object used, TABL PRCD_ELEMENTS, is not visible.
The development object TABL PRCD_ELEMENTS (package VF_PRC_DB) used in PROG /.../SOM_DISPLAY_INVOICE is not contained in any (visible) package interface.
The error was cause at ABAP code line where I executed an Open SQL SELECT command using PRCD_ELEMENTS table or referenced it as the type of an internal structure definition.
If a package violation exists in your code, these package violations are classified into below listed categories by the ABAP Test Cockpit (ATC)
HOME: the used object is a HOME object or a local object
USEM: missing use accesses
NVIS: the used object is not exposed in any (visible) package interface
SPNV: the used object of a superpackage is not visible (not allowed by the package concept)
NEXO: the used object does not exist
NEXP: the package of the used object does not exist
USEM: missing use access
USEI: incomplete use access
ERRO: general package violation error
WARN: package violation warning
GWEX: SAP_GWFND Component Check - Forbidden usage of external development elements
PINF: inconsistency of package interface elements
INFO: package check information message
EHPE: 'EhP Component Check' error message
EHPW: 'EhP Component Check' warning message
EHPI: 'EhP Component Check' information message.
As package violation category NVIS figures the object prcd_elements is not exposed in any visible package interface. So searching for a package interface to add to use accesses is unnecessary. I'm looking for a work-around for the solution of this type of package violation ATC check errors.