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
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

Package Violation - Error - The used object is not visible (NVIS).

When I execute ATC checks (ABAP Test Cockpit), results show errors titled "Package Violation - Error - The used object is not visible (NVIS)" with priority 1. Since there were a quite big number of ATC results with "not visible objects", I decided to take possible solutions as notes on this webpage.

Development object TABL PRCD_ELEMENTS is not contained in any (visible) package interface.

For example, on S/4HANA SAP systems KONV table where pricing conditions are stored is replaced with PRCD_ELEMENTS table.
In my ABAP developments, I replaced KONV with PRCD_ELEMENTS.
ATC checks listed those code blocks as errors under "Package Check for Source Code Objects and ABAP Dictionary Objects"

Here is an example case.

ATC Package Violation Error PRCD_ELEMENTS is not visible

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 /KODYAZ/ZDISPLAY_INVOICE is not contained in any (visible) package interface.

Unfortunately this error cannot be supressed by simply adding a pragma or pseudo-comment right after related ABAP code.

When I switched to ABAP source code where the error is triggered by pressing the link Object Name in ATC results list, I see that I used prcd_elements table in an OpenSQL query replacing KONV table.

ABAP code where PRCD_ELEMENTS is used in OpenSQL query

ABAP programmers can replace prcd_elements table with v_konv_cds view to get rid of above ATC check error.

So to summarize, I had a short story of changing data source between following ABAP data sources: konv => prcd_elements => v_konv_cds

But this update actually caused some other ATC check errors. For example, instead of using v_konv_cds ATC checks suggested me to Use the associated entity "V_KONV".
When I replaced v_konv_cds => v_konv then I have to convert old style OpenSQL to new syntax where comma is used between selected field list, using "@" in front of variables, moving INTO TABLE clause to the end of the SELECT statement, etc for successfully acctivating the ABAP program.

It is interesting that using V_KONV instead of PRCD_ELEMENTS caused another Package Violation - Error - The used object is not visible (NVIS).

So, I used the solution that my colleague has developed. Actually by creating a CDS view which selects all fields from the prcd_elements table works quite fine and resolves ATC check errors for package violation.

Here is the DDL source codes of a sample CDS view to replace table prcd_elements in your OpenSQL queries in ABAP programs.
Replace prcd_elements table name with DDL name of the CDS view.

@AbapCatalog.sqlViewName: 'Z_PRCD_CDS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK

// * Created For PRCD_ELEMENTS Table to prevent ATC Check errors
select * from prcd_elements

Another package violation error listed for prcd_elements was caused from the ABAP source codes where I used in data definitions section of a program.

DATA s_prcd TYPE prcd_elements.

Simply replacing above ABAP code line into following form by replacing prcd_elements with v_konv_cds solved my ATC check error for package violation.

DATA s_prcd TYPE v_konv_cds.


Install SAP Free
CRM Companies List
Web Based CRM Software

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.