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

List of ABAP Executable Programs in a Package


To get list of ABAP programs in a package, developers can use the sources codes of a report given in this ABAP tutorial. By providing the ABAP repository name of the SAP package, developers can list executable ABAP programs in that given package.

For example, if you want to get the list of ABAP reports (executable programs) in package SABAPDEMOS, the program list will be as seen at the bottom of this tutorial.

Developers can query SAP transparent table TADIR (Directory of Repository Objects) for the list of objects belonging to a ABAP package. You can filter TADIR table data by applying a filter on DEVCLASS (Package) column.

Since the object type or the program type information is in TRDIR system table, we have to join TADIR and TRDIR using the object name fields.

Since I am looking for executable ABAP reports list in a given package, I used SUBC = 1 in WHERE clause of the SELECT query.

SUBC fields stores the data about Program type property of the repository object.
Other possible values of SUBC are:
F Function group,
S Subroutine Pool,
J Interface pool,
K Class pool,
T Type Pool,
X Transformation (XSLT or ST Program),
Q Database Procedure Proxy

And following is the source codes of the ABAP program that SAP developers can use for filtering system tables to get the list of ABAP reports in a specific package.

data lv_package type packname value 'SABAPDEMOS'.

select
 tadir~obj_name,
 tadir~object,
 tadir~author
 into table @data(lt_tbl)
from tadir
inner join trdir
 on trdir~name = tadir~obj_name
where devclass = @lv_package and
 subc = 1 . " 1 -> Executable

call method cl_demo_output=>display_data
 exporting
  value = lt_tbl
  name = | List of ABAP Programs in Package { lv_package } | .
Code

And the output list of ABAP programs within an package in ABAP Object Repository in SAP

display list of ABAP programs in SAP package



SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


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