SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




CRM Companies List
Web Based CRM Software


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

ABAP Test Toolkit ATC Package Violation errors

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

ABAP package hierarchy for SADL_GW_EXPOSURE_MPC

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.

create use access in ABAP package definition

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.

try.
 call method /.../som_info_invoice_amdp=>get_invoice_list
 importing
  et_invoicelist_xl = gt_alv_xxl.
catch cx_amdp_error into data(amdp_error).
 data(lv_err) = amdp_error->get_longtext( ).
 data(lv_err2) = amdp_error->get_text( ).
endtry.

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.


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.

select
 vbrk~vbeln e~knumv e~kposn e~kschl e~kbetr e~kwert e~kinak
into table gt_tkonv
from vbrk
inner join prcd_elements as e on e~knumv = vbrk~knumv " KONV
for all entries in lt_vbrk
where vbrk~vbeln = lt_vbrk-vbeln.
* or
data s_prcd type prcd_elements.

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.






SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table








Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems