Summary: this section describes how to use the CAST SAP Extractor to extract ABAP source code ready for analysis with CAST. Please ensure you have installed the CAST SAP Extractor and have read CAST SAP Extractor NG - User Guide - 8.3.x - 8.2.x - 8.0.x.

Introduction

If you are extracting ABAP source code, the following menu will be displayed. This section explains all of the fields and options that are available in this menu:

Extraction Result Target

Extraction storage repository

Before using the CAST SAP Extractor, you first need to define where to store the result of each extraction - this menu option enables you to do so. Each extraction will create one ZIP file.

The storage location configuration is common to both ABAP source code extraction and Tables and Views extraction.

Output to ALL11 Repository

The ZIP file containing the extraction results can be output to a server level of a SAP instance, via the SAP transaction AL11. You should chose this option when the extraction scope is very large. This option is also the default setting: the file path will be set to the /TMP/ standard repository. If you prefer to specify a specific repository, simply provide a file path where the resulting ZIP file should be stored, as shown below:



When you run an extraction using this storage option, the extractor will:

  • Show either an error message if the extraction failed, or the following success message:

  • Create a new ZIP file entitled "CASTExtract_XXX_ExtractionID.ZIP" where XXX corresponds to the system ID on which the extraction was executed and ExtractionID corresponds to the unique ID of the new extraction and store it at the selected location:

  • You can then download the ZIP file on to your local machine using the standard function module ARCHIVFILE_SERVER_TO_CLIENT.

Output to local path

The ZIP file containing the extraction results can be output direct on to your local machine if required. You should chose this option when the extraction scope is small and will not take too long to complete - i.e. for testing purposes. To use this option, select it and then choose a path to the local machine where you would like the resulting ZIP file to be stored, as shown below:


When you run an extraction using this storage option, the extractor will:

  • Display an error message if the extraction failed, or a success message showing the size of the ZIP file that has been output locally. In the example below, a ZIP file of 2.040 bytes has been output to the local folder "C:\Users\sadek\Desktop\Tests\CAST_TEST":

  • Create a new Zip file entitled: "CASTExtract_SID_DATE_TIME.ZIP" where SID, DATE and TIME correspond to the system ID, execution date and time respectively.
  • Store this ZIP file and store it at the selected location: "C:\Users\sadek\Desktop\Tests\CAST_TEST":

Sending Extraction result to Master

This option enables you to output the CAST SAP Extractor results to the Inventy Connector - this requires that the Inventy Connector has been installed and configured (please contact CAST for more information about this).

Source code extraction scope

This menu offers various various options for restricting the scope of the extraction. As shown below, the scope is divided into various sections:

  • Main Source Code Extraction Scope Options
  • Additional Source Code Extraction Options
    • Local source code extraction and User Exit Extractions
    • Dependencies Extraction Options
    • Time based options (Creation/Modification Date and Version Management)

The following paragraphs will explain each of these sections in detail.

Note that the Main Source Code Extraction Options input fields are controlled by a group of radio buttons, therefore, this means that you can define your scope based on one criteria at a time i.e. on  Application Components, Packages, Objects etc. You can then restrict the extracted objects based on additional fields such as:
  • Creation and/or modification dates
  • Version type (Active or inactive version on system, to extract)

Main Source Code Extraction Options

Select Application Components

This option defines high level objects in the SAP application hierarchy for example: Basic Components, Financials, Enterprise Portal etc. You can extract all ABAP source code elements related to Application Components. To do so, select the corresponding radio button and then choose the Application Component names in the corresponding selection screen:

To see all Application Components available in the system, you can either use the match code that comes with selection field "Application Component" or navigate in the "Repository Browser" via the SAP Transaction code SE80:

Select Packages

You can also extract the entire source code of one or multiple packages (reports, transactions, includes, function modules, class methods…). To do so, enter the packages' names in the corresponding selection field:

A match code is available to choose the correct package(s) you would like to use for the extraction among all the packages that are available on your SAP system. When the "Select Packages" option is active, the check box "Check Existence of Packages" will also become available:

You can use this option force the extractor to check for the existence of each package mentioned in the selection scope, before proceeding with the extraction. This is just a safety measure. 

Note that this additional safety measure does not have a major impact on the process duration runtime.

Example

Let's suppose that you would like to extract all the specific developments on your SAP instance. For this purpose, you can simply enter Z* and Y* in the Package selection field as shown below:

When the extraction completes, the results will be stored in a ZIP file and each ABAP Source Code element will be written into a text file (.ABAP for main source code, .FLOW for screen flow logics) or into an XML file (for the Web Dyn Pro details for example).

Select Objects (Prog, Fugr, Class)

You can choose to extract the source code of one or many ABAP objects (ABAP reports and corresponding screen information or related transaction data, function groups, classes…) To do so, enter the name of each of these objects in the corresponding selection field:

Note that you can enter:

  • A set of report names
  • A set of function group names
  • A set of class names

All ABAP Source Code corresponding to the chosen input will then be extracted.

Select transaction code

Use this option to extract the source code of ABAP reports which are related to SAP transactions, based on the transaction code itself. In addition, a .LIST text file will be extracted to display information related to each of these transactions. To do so, enter the Transaction Codes in the corresponding selection field: 


Example

 If for example, you would like to extract the source code of the CAST SAP Extractor itself, you have two possibilities:

  • Either you can use the name of the program (/INVY/CAST4SAP_MAIN_EXTRAC_R) in the selection field corresponding to the ABAP object names as described in the previous paragraph:

  • Or, you can directly use the related transaction code (/INVY/CAST_EXTRACTOR) of the same ABAP report (/INVY/CAST4SAP_MAIN_EXTRAC_R) in the selection field corresponding to the Transaction Codes:

In both cases, the extraction result should be the same, and will consist of a ZIP file such as shown below:

The ".LIST" file which gathers all the information about the input transaction (/INVY/CAST_EXTRACTOR) is stored in a folder - in this example, this transaction is part of a package named "/INVY/CAST4SAPCONNECTOR_REM_P", thus we need to open the folder "_INVY_CAST4SAPCONNECTOR_REM_P" to find the ".LIST" transaction file:

As shown below, the ".LIST" file contains additional details about each transaction:

  • related report name
  • transaction type
  • transaction description etc.

Note that based on the type of SAP transaction, it can either point directly to an ABAP report or call another SAP transaction:

Example of a transaction that points directly to an ABAP report: Input transaction "SPRO" chosen by the user

In this case, the ABAP extraction files will be stored in a folder that has the same name as the development package of the chosen transaction:

Therefore the .LIST transaction file is stored as shown below:

:

Example of a transaction that calls another SAP transaction: Input transaction "LMDB" chosen by the user

In this case, CAST will fetch the first called transaction that points to a real ABAP report: In our example, CAST will choose transaction "WDYID", which is called by LMDB and which points to a real ABAP report:

In this case, the ABAP extraction files will be stored in a folder that has the same name as the development package of the called transaction that points to a real ABAP report:

The .LIST transaction file will be downloaded and stored in a folder that has the same name as its own development package. Hence, in our example ("LMDB" is the input transaction on the selection screen), all the ABAP source code objects that have been extracted correspond to the program "SAPLWDY_PRGN_NODES", used by transaction "WDYID", which is called by the "LMDB" transaction. These files will be stored in a folder called "SWDP_PRGN_NODES" (which corresponds to the package name of the report related to the called transaction "WDYID")

The .LIST transaction file will be stored in another folder, called "AI_LMDB_MISC" (this corresponds to the name of the package to which the transaction "LMDB" belongs to):

In this case, the .LIST file recalls that the input transaction LMDB chosen by the user, calls another transaction WDYID:

Select CTS Project ID

You can use this option to extract all the ABAP source code elements belonging to one or several CTS Project(s).  To do so, enter the CTS Project IDs in the corresponding selection field:

SAP standard Change and Transport System (CTS) is a tool that helps you to organize and customize development projects in the ABAP Workbench - you can then transport the changes between the SAP Systems in your system landscape. Therefore, each of these ABAP Workbench elements (reports, function modules, includes…) are organized into one or several transport requests, which are gathered into one or several CTS projects - in other words, each CTS Project ID is a set of transport requests. Using this option, the CAST SAP Extractor will fetch all the transport requests that belong to the CTS Project IDs chosen by the end user and run the extraction based on the overall Source Code elements of each of these transport requests.

Select request/task

Use this option to extract all the ABAP source code included in Workbench transport requests or tasks.  To do so, select the "Select Request/Task" option, then two further choices are available:

  • You can either mention the Request/Task names in the corresponding range field:

  • Or you can enter the name of a file which is stored at server level (AL11) and contains a list of transport request and/or tasks to consider during the extraction process:

In this case, the CAST SAP Extractor is able to open a file (.TXT, .CSV etc.) stored in the AL11 repository, read its content, fetch the transport requests mentioned in the file and extract the related ABAP Source Code objects.

If you would like to use a file stored at AL11 to extract ABAP objects within transport requests, be sure to respect the following rules:

  • A .TXT file is the preferred input type. CSV files can also work
  • You need to write one transport request/task per line
  • You can enter a description after each transport request if you wish. In this case, transport requests/tasks should be separated from their descriptions by a semicolon" ; "

Here for instance an example of a file that can be used to extract ABAP source code objects (programs, function groups, includes, classes) that it contains.

You can use the standard function module ARCHIVFILE_CLIENT_TO_SERVER to upload the above file from your local machine to a server repository of your choice.

Extraction example 1

Let's try to extract all the ABAP source code that is contained in the file that you can see above and which is entitled "TR_REQ_FILE_CAST.TXT". For this purpose, we need to start by uploading the file from the local machine to the server level using for instance standard function module ARCHIVFILE_CLIENT_TO_SERVER:

Once complete, you can check at server level that the file has been successfully uploaded to the chosen repository (".\" in our example):

Now you can run the extraction report as shown below:


 

Extraction example 2

Let's suppose that you would like to extract all the ABAP Source Code objects related to the following list of transport requests:

  • SSDK500901
  • SSDK500902
  • SSDK500903

Two solutions are possible:

  • You can either simply enter the names of the three transport requests SSDK500901, SSDK500902 and SSDK500903 into the  "Select Request/Task" selection fields:

  • Or you can also use the following selection field "Transport Request File (AL11)":
    • Create a text file on your machine with a simple text editor and fill it with the name of the three transport requests to use for the extraction: SSDK500901, SSDK500902 and SSDK500903. We have created a text file with Notepad on a local machine running on Windows:

    • Save the file on your local machine. In our example, the file was entitled "Transport_Request_File_Test.txt" under local path "C:\Users\sadek\Desktop\Tests\CAST_New\".
    • Upload this local file to server level using the standard function module ARCHIVFILE_CLIENT_TO_SERVER. In this example, we uploaded the file stored earlier, in server repository "."

The file has been uploaded successfully on server level, in repository ".\":

We can also open the file at server level to check its content:

To retrieve all the Source Code elements related to the content of this file stored at server level, you simply need to enter its name in the corresponding field as shown below:

Select where used transport request

The option will extract ABAP elements using custom tables and views stored in one or several Transport Requests. 

Extraction example

Let's imagine that a consultant has modified SAP standard table BKPF by customizing it. Once the customization is complete and stored in a transport request, the CAST SAP Extractor can be used to find all the ABAP Source Code using the BKPF SAP table. To do so, click the "Select Where Used Transport Request" option and enter the name of the required custom requests:

Restrictions

Please note the following restrictions and limitations of using this option:

  • Only SAP objects of type clusters, views and tables are taken into account when using the "Select where used transport request" feature. In fact, a SAP cluster is a set of views, which is itself a set of tables. The objects selected for the "Select where used transport request" of type other than: TABU, TDAT, CDAT, VDAT, will be ignored.
  • The CAST SAP Extractor will run the "Select where used transport request" feature by fetching for the objects listed below:
    • ABAP reports and related screens
    • ABAP function modules
    • ABAP class methods and interfaces
    • Web Dynpro Components and controllers
    • Table types

This simulates running "SAP standard Where Used" button on the following options:

When running a "Where Used" extraction type, what's known as"neighbor ABAP objects" will be extracted even if they do not belong to the calling stack. For instance, if a function module is used within a call stack; then it will be extracted as well as its function pool and other function modules (within the same function group) - same applies to Class Pools and methods. This allows CAST AIP to work properly as pools are required.

ST03N statistic based extractions

ST03N is a standard SAP transaction, known as the workload monitoring tool and can be used to review SAP workload distribution in terms of what reports and transactions were used over a specific time period. The CAST SAP Extractor is able to study ST03N data to extract ABAP Source Code for the reports or transactions that were the most used on a SAP system. This feature functions as follows:

  • The CAST SAP Extractor will go through the data available in transaction ST03N
  • The extractor will fetch either for a list of reports or a list of transactions that were the most recently used on the current SAP system
  • The extraction will then be executed based on these reports or transactions

If you would like to use this feature, please follow these instructions:

  • First you need to decide whether you need to fetch ST03N statistics for :
    • The most used SAP transactions : in this case, check the following box:

    • Or the most used ABAP programs : in this case, you need to check instead this box:

  • Now click the button "Get Statistics from ST03N" which is available on the main selection screen of the CAST SAP Extractor:

  • A pop up will be displayed asking you to enter some additional selection fields:

  • Enter a start and an end date: this will describe the time period for which ST03N statistics will be retrieved. 
  • Enter a minimum number of steps: as you can see in the workload monitoring screens of the ST03N transaction, each entry corresponds to a number of "Dialog Steps". You need to use this information as an input in the CAST SAP Extractor selection screen to filter the results to fetch from database (this number should be greater than 0):

  • Validate your choice by clicking on

When you have filled in the above input fields, the popup will close. The CAST SAP Extractor will fetch from the database all the Transactions or Report names which correspond to the selections you made (time interval and minimum number of steps)

Extraction example

Let's suppose that a user would like to find the transactions that were used during the last month and to run the extraction engine based on this selection. First the check box "Select transaction code" need to be checked in this case, so that to tell CAST to "copy" ST03N transactions to this input field:

ST03N popup needs to be filled in with the correct time period as well as a minimum number of steps:


Now, validate the selection. If all goes well, a success message will be displayed:

In addition, the transactions that have been found will be copied from ST03N statistics, to the corresponding selection field:

The user can click to check the number of transactions that were extracted from ST03N to CAST selection screen. In our example, 109 different transactions were found:

The CAST SAP Extractor can be started now based on the transactions retrieved from ST03N.

Additional Extraction options

The CAST SAP Extractor enables you to extract other objects on which the processing may depend:

  • Local ABAP sources

  • Standard repair based User Exits

  • The Includes that are called by the ABAP objects that are part of the source code extraction scope
  • The Tables/Views that are used in the ABAP objects that are part of the source code extraction scope
  • The related sub code elements

The following paragraphs will explain these additional features in details.

Please note that the option "Extract only from these packages" is deactivated unless you check at least one of the following check boxes:

  • Extract Dependent Includes
  • Extract Dependent Tables/Views
  • Extract Sub Code elements

When the "Extract only from these packages" option is available, you can maintain the select option with a list of packages from which you would like to restrict the extraction of the dependent objects (includes, tables/views, sub code). This means that only dependent objects that belong to one of the packages mentioned in "Extract only from these packages" input field will be extracted.

Please also note that extracting dependent includes or sub code objects cannot be filtered based on creation or modification date fields:

This means that even if a dependent include does not match with the information that you can enter in the Creation and/or Modification fields, the ABAP source code will still be extracted. The same is true for Dependent Sub Code elements.

Local ABAP source extractions

The CAST SAP Extractor allows you to choose whether to extract local ABAP sources (those belonging to the package $TMP) By default, local objects are excluded - the  “Exclude local sources ($TMP)” is checked automatically:

Therefore if you would like to extract local ABAP source code, you simply need to uncheck the check box shown above.

User Exits Extraction Options

SAP has always provided various enhancement techniques to provide its customers with innovative ways to add new rules and modify the process workflows. Throughout SAP releases, new techniques have been implemented. The very recent techniques in this context, are the Business Add in and the enhancement spots. The oldest standard modification techniques are known as “Form User Exits”.

The CAST SAP Extractor can extract standard repair based user exits. To do so, you only need to check the corresponding box:

Therefore the CAST SAP Extractor is capable of extracting:

  • “Condition and Copy Form User Exits”: These includes can be created by the customer through some customizing tasks and contain several forms that will be called during SAP standard processing. Modifying these includes requires a reparation key since they are stored in SAP standard packages. Usually the name of such includes ends with a three digit string, i.e.: “RV64A973”

  • Application-Specific User Exits (or “Form User Exits”): These includes can be created by the customer and contain several forms that will be called during SAP standard processing. Each one of these forms is untitled “USEREXIT_<do_something>” where <do_something> is the action for which the form will be responsible. SAP has provided these includes in a very old release, and has maintained them with a bench of forms which are empty. When a customer would like to add his own rules, he only needs to implement these forms and fill them with the suitable code. Modifying these includes requires a reparation key since they are stored in SAP standard packages, even if implemented by the customer. Usually the name of such includes ends with “ZZ” or “ZY” (i.e.; Exit: “RV60AFZZ”) but this convention has not always been respected by SAP unfortunately.

Notes

  • When the CAST SAP Extractor locates a user exit, the latter will be tagged with the following sentence “USER_EXIT_NAME” as shown below:

  • You cannot simply extract User Exits from a system and keep all the main source extraction options blank. This is not very coherent. Extracting User Exits is only an additional option. Thus, you need to maintain at least one input for the source extraction options (package, program name, transaction..) when fetching for user exits.
  • Some additional user exits are also handled by CAST, for instance:
    • Business Add-ins (BADIs)
    • User Exits of “Exit Function Modules”: an Exit Function Module is a function module provided by SAP whose name starts with “EXIT_”. Each Exit Function Module calls an include which is prefixed with “ZX” and which does not exist on the system. If the customer would like to add his own rules, he only needs to create this “ZX” include and to maintain it with the required code. Implementing these includes does not require any reparation key, and the corresponding include will be stored in a custom development package. Here is an example of such Exit Function Module (the user exit in this case is “ZXMCDU01”. SAP’s naming convention for such User Exits is as follows: each of these includes should be untitled “ZXaaaUyy” where Xaaa is the name of the Exit Function Group (to which the Exit Function Module belongs) and y is a digit):

Example

Let’s imagine that a developer would like to extract his own developments encompassed in package “ZCAT” and to also extract the system user exits. Thus, the CAST SAP Extractor should be run such as shown below:

The result of this extraction is a Zip file which contains custom package ZCAT, but also a handful of standard packages. Each one of the standard packages encompasses several user exits of type Condition and Copy Form User Exits or Application-Specific User Exits.

Dependent Includes extractions

An ABAP source code element (report, function module…) can make use of other includes belonging to other SAP packages. Such includes are called "Dependent Includes". A check box is available to force the CAST SAP Extractor fetch these dependent includes related to the ABAP Source Code objects. These dependent includes can belong to different packages.

Extraction example using the Dependent Includes with no restriction

Let's imagine that a developer is interested in extracting the ABAP source code of the SAP standard report "CRM_DNO_SERVICE_MONITOR", as well as all its related dependent includes. For instance, if you display this report source code, you can see that it includes "CRM_DIRECT".

To include the dependent include in the extraction, simply click the "Extract Dependent Includes" option:

Running the CAST SAP Extractor as follows will not only extract ABAP source code for the report "CRM_DNO_SERVICE_MONITOR" but also the code of all its related includes, such as "CRM_DIRECT" in our example:

When the "Extract Dependent Includes" option is enabled, the CAST SAP Extractor will handle onlt the first level of hierarchy. Where a dependent include calls another dependent include(s), the latter will not be extracted. This is a security measure to avoid huge extractions and very long run times. The result of this extraction is a Zip file which contains multiple packages such as shown below:

The "CRM_DIRECT" include is located in the folder with the same name as its related devclass "CRM_ORDER". All the other dependent includes are found and stored in the correct folders.
 

Extraction example using the Dependent Includes with an additional restriction

Let's imagine that a developer is interested in extracting the ABAP Source Code of the SAP standard report "CRM_DNO_SERVICE_MONITOR", as well as its includes which are only part of the SAP package "CRM_BILLING". To do so, the "Extract only from these Packages" option should be selected with the name of the new scope restriction: "CRM_BILLING" as shown below:

The result of this extraction is a ZIP file which contains only the packages of the main extracted object "report: CRM_DNO_SERVICE_MONITOR" as well as the dependent includes that are part of the package "CRM_BILLING". All the other includes belonging to the other Development packages have been ignored from this extraction:

Extract Dependent Tables/Views

An ABAP Source Code element (report, function module…) may use database tables and/or views. A check box is available to force the CAST SAP Extractor to fetch all these tables and views.

Note 1

When you choose to extract "Dependent Tables/Views" from ABAP source code, this will ask the CAST SAP Extractor to:

  1. Extract all the ABAP Source Code respecting the scope chosen by the user (which corresponds to the information that has been entered in the selection screen "Main Source Code Extraction Options"
  2. Fetch all the Tables and/or Views used in the ABAP source code elements found in step 1.

As you can see, when the check box "Extract Dependent Tables/Views" is checked, the selection fields of tab "Main Tables & Views Extraction Options" will be deactivated:

However, the fields in the tab "Addition Tables Extraction Options" are still available, even if you would like to extract the Dependent Tables/Views from ABAP source code:

Note that in CAST SAP Extractor NG ≥ 8.3.x, an additional check box Consider CDS will be available - this is active by default:

Note 2

Based on what you would like to extract, you can follow the instructions below:

"Dependent Tables" Extraction Scope

Check box "Extract Dependent Tables/Views" ticked?

Check box "Consider Tables" ticked?

Check box "Consider Views" ticked?

Check box "Consider CDS" ticked?

I need to extract "Dependent Tables" and "Dependent Views"

(tick)

(tick)

(tick)

(tick)

I need to extract ONLY "Dependent Tables"

(tick)

(tick)

(error)

(error)

I need to extract ONLY "Dependent Views"

(tick)

(error)

(tick)

(error)

(tick)(error)(error)(tick)

I do not need to extract "Dependent Tables" nor "Dependent Views"

(error)

N/A

N/A

N/A

Extraction example using the Dependent tables/views feature with no restriction

Let's imagine that a developer is interested in extracting ABAP Source Code of the SAP standard report "CRM_ORDER_READ", as well as all the information related to the tables and views that it uses. For instance, if we display this report, we can see that it tries to select data from the following SAP tables: TADIR, DM40V, CRMD_ORDERADMH, FUPARAREF…

Running the CAST SAP Extractor with the "Dependent Tables/Views feature" will force the extractor not only to extract the ABAP Source Code of report "CRM_ORDER_READ" but also to build two XML files:

  • A first XML file encompassing all the tables' data, if any.
  • Another XML file encompassing all the views' data, if any.

The additional XML files that will be created in this case are detailed below:

  • A first XML file will be generated under the following title: "SAP_tables_001.SAP.XML" and can be found in the root node of the whole Extraction Zip file result. The following screenshot displays an extract of the XML file that should be obtained if standard table TADIR has been used by an ABAP Source Code object:

As shown in the capture above, each table that has been extracted corresponds to an XML tag attached to a parent XML node corresponding to the SAP package to which the table belongs to.

  • Another XML file will be generated under the following title: "SAP_views_001.SAP.XML" and can be found in the root node of the whole Extraction Zip file. The following screenshot displays an extract of the XML file that should be obtained if standard view DM40V has been used by an ABAP Source Code object under extraction:

When we run the CAST SAP Extractor with the selection screen shown earlier, the result would resemble as follows:

Since extracting the dependent tables had no restriction (input field "Extract only from these packages" was kept blank), the XML file "SAP_tables_0001.sap.xml" contains all the names of all the dependent tables as well as their related packages to which they belong:

Another XML file will be generated under the following title: "SAP_CDS_Views_001.SAP.XML" and can be found in the root node of the whole Extraction Zip file:

Extraction example using the Dependent tables/views feature with an additional restriction

Let's imagine that a developer is interested in extracting ABAP Source Code of the SAP standard report "CRM_ORDER_READ", as well as all only the used tables and views which belong to package SFUNC. To do so, select the "Extract only from these packages" option and enter the name of the new restriction, which is package "SFUNC". The report should be run as shown below:

The result of this new extraction looks like the previous extraction, which was done without any additional restriction for the dependent tables:

The XML file "SAP_tables_0001.sap.xml" contains in this example, only the tables which are used in report "CRM_ORDER_READ" and which belong to Package "SFUNC":

Note 1

This additional feature allows the user to combine two different aspects:

  • ABAP Source Code Extractions
  • Tables & Views used in this ABAP source code

Unfortunately, using this feature can make the extraction run time longer, especially if the check box "Extract Number of Rows" is ticked (avoid ticking this to reduce the extraction run time)

Note 2

When the "Dependent Tables/Views Extractions" feature is enabled, only views of type "Data base views" and "Projection Views" will be extracted. All other views of types Maintenance, Help View etc. cannot be extracted with the CAST SAP Extractor. The following screenshot highlights the view types that are taken into consideration by the extractor:

Extract sub code elements

An ABAP Source Code element (report, function module…) can call other SAP objects (includes, function modules, class methods…) for further processes. Therefore, the called SAP object is a type of "Sub Code element" for the parent ABAP Source Code. The CAST SAP Extractor is able to extract not only the ABAP code of the parents, but also all of their sub code elements. This feature works in a recursive manner to retrieve all the "Source Code children" of a parent ABAP code, until the database is reached. 

Extraction example using the Sub Code Extraction feature with no restriction

Let's imagine that a developer is interested in extracting the ABAP Source Code of specific report "Z_CAST_TEST" as well as all the information related to its sub code. Let's also suppose that report Z_CAST_TEST calls:

  • Standard method: DESCRIBE_BY_DATA of SAP class CL_ABAP_TYPEDESCR
    • This method does not call any other sub code.
  • Function module : SXV_GET_CLIF_BY_NAME
    • This function module calls another function module: SXV_ADD_PREFIX
      • SXV_ADD_PREFIX itself calls an additional function module SX_NAME_SPACE_SPLIT, but this module does not call any other sub code.

Running the CAST SAP Extractor on this report while enabling the "Sub Code Extraction" feature will provide the user not only with the ABAP Source Code of the report itself, but also with the code of all its sub code elements that are called recursively (method: DESCRIBE_BY_DATA as well as modules: SXV_GET_CLIF_BY_NAME, SXV_ADD_PREFIX and SX_NAME_SPACE_SPLIT). In addition, a new XML file will be generated to display the hierarchy between the initial Source Code elements and the ABAP code they call recursively. This additional Sub Code XML file has the following properties:

  • The XML file will be generated with the following file name: "SAP_Subcode_XML_LOG.XML" and can be found in the root node of the extraction ZIP result file
  • The following image displays an extract of the XML file that will be obtained

  • As shown in the image above, each sub code element that has been extracted corresponds to an XML tag attached to a parent XML node corresponding to the caller ABAP code.

Note 1

Similar to what was described earlier with the extraction of the "Dependent Includes" and the "Dependent Tables/Views", the check box "Extract only from these Packages" is available if the "Extract sub code elements" option is selected. In this situation only Sub code elements belonging to these devclasses will be extracted.

Note 2

Sometimes an ABAP object calls itself (because the algorithm is recursive). In these cases, do not be surprised if you see the exact same tag in the Sub Code xml file. For example, the function module ABAPLIST calls itself as shown below:

Therefore if ABAPLIST is part of the ABAP source code to be extracted, and if the check box "Extract Sub Code elements" has been ticked, we can see the same XML tag twice in the sub code logs:

This is not a bug or error, but instead means that the same function module calls itself.

Note 3

When going through the Sub Code XML log, you may encounter some parent/child nodes where the attributes are not mentioned. Instead of finding the name of the required information, a question mark "?" will be displayed instead. For instance, in this example, while extracting sub code elements, the subroutine pool "RSDYNSS0" has been encountered. As shown below, we can see that this ABAP object calls:

  • Function module ICON_CREATE
  • Another ABAP element that CAST could not determine ("?" is displayed):

This is not a bug or error in the CAST SAP Extractor - you will encounter such situations each time an ABAP object calls a Sub Code in a dynamic way. Therefore, in our example, we can go through ABAP source code of "RSDYNSS0" and we will see that a dynamic function call was used, which explains the question mark "?" that has been written in the XML Sub Code log file. The dynamic statement lies at line 229 of the corresponding source code, with variable L_CONV_FB_OUTPUT, as shown below:

Note 4

When going through the Sub Code XML log, you will not find what are called "neighbor objects" which are ABAP objects that are extracted but that do not belong to the calling stack. For instance, if a function module is called within the stack; then it will be extracted and displayed in the XML Log - but its function pool and other function modules (within the same function group) will also be extracted; but not displayed in the XML Log. This allows CAST AIP to function properly as pools are required. The same is true of classes and their methods.

Time Based selection fields

The CAST SAP Extractor is able to retrieve ABAP elements based on different time inputs, either by:

  • Using a range of creation dates
  • Using a range of modification dates
  • Using the Version Management feature

The following paragraphs explain these three time-related extraction features.

Extractions based on Creation Dates

The CAST SAP Extractor allows the end user to restrict the extraction scope by adding a filter on the "Creation Date" of the ABAP Source Code objects.

Note 1

You cannot extract ABAP source code only based on a creation date range. You always need to choose at least one additional field:

After choosing a main extraction criteria among the ones shown in the capture above, you can then enter a creation date range:

Note 2

Note that "Creation Date" input field can be used to restrain the user selection scope in terms of objects to extract, packages… but not in terms of transactions, i.e. we do not extract transactions based on creation dates.

Extraction example

Let's imagine that a developer would like to extract all the ABAP Source Code elements included in a specific package entitled "Z_NEW_DEV" and created between the 03rd of September 2014 and the end of December 2014. To do so, the user needs choose "Select Packages" with the devclass name and the add the correct time interval in the Creation Date section:

Extractions based on Modification Dates

The CAST SAP Extractor allows the end user to restrict the extraction scope by adding a filter on the "Modification Date" of the ABAP Source Code objects.

Note 1

You cannot extract ABAP source code only based on a modification range date. You need always to choose at least one additional field and then enter your modification dates:

Note 2

Note that "Modification Date" input field can be used to restrict the user selection scope in terms of objects to extract, packages… but not in terms of transactions, i.e. the CAST SAP Extractor cannot extract transactions based on modification dates.

Extraction example

Let's imagine that a developer would like to extract all the specific (Z*, Y*) ABAP developments that were modified after the 03rd of September 2014. To do so:

  • enter the two entries (Z* and Y*) into the "Select Packages" option
  • enter the "Modification Dates" with the required time interval and operator (in our case, the operator would be "Greater or Equal Than"). Double click on the input date field to access the operators:

In our example, the CAST SAP Extractor can be run with the following extraction options:

Version Management Source Code Extraction

This feature allows users to extract old ABAP versions of source code (for programs, function modules and groups, classes and methods, dynpros…) Best practice dictates that when developers are working on their development objects, they usually create different versions of their reports/function modules etc… Each one of these ABAP elements evolves step by step before reaching a final version (active version). All of these versions are stored in the SAP instance system as well as the corresponding time and date of creation. You can use the "Version Management" button available in the "Utilities" menu to identify the various versions of an ABAP object on your SAP instance (depending on the ABAP object, this information is available through SAP transaction SE37, SE38, SE80 or SE24…):

The various versions of the chosen ABAP object (in this example, it is a specific report entitled Z_DOWNLOAD_FILE_FROM_SERV) will then be displayed:

As you can see above, the latest and most recent version is the only one that is "Active" on the system. All the other versions are "Inactive". The CAST SAP Extraction Engine is pre-configured to extract by default the Active versions of the various ABAP Source Code. That's why, when you launch the  CAST SAP Extractor, you can see that box "Extract Active version" is already ticked:

An additional option is also available for the users to extract the Inactive versions of the same objects. For this purpose, you need to check the "Extract Inactive Version from Period" box:

When this check box is active, the corresponding selection field becomes available. Make sure you enter a time period into this input field: this corresponds to the period for which CAST will extract the most recent inactive version of the ABAP source code. If you keep this date selection field blank but keep the checkbox "Extract Inactive Version from Period" active, the CAST SAP Extractor will fail to execute you will encounter this error message:

 

Extraction example without the Version Management feature

Let's imagine that a developer is working on a report entitled Z_DOWNLOAD_FILE_FROM_SERV. As shown above, in our SAP system, different versions of this report are stored in the system. However, our developer is interested in extracting the ABAP Source Code of the Active version of this report:

In order to extract the Active version of the report, our developer only has to run the CAST SAP Extractor without the Version Management feature. To do so, enter the report's name, and tick the "Extract Active Version" option:

Extraction example with the Version Management feature

Let's imagine that our developer, working on the same report Z_DOWNLOAD_FILE_FROM_SERV, is now interested in the version of the code he wrote in the past, around the 25th of August 2014. In order to extract the corresponding version, our developer simply has to enable the "Version Management" feature while running the CAST SAP Extractor. To do so, enter the report's name, and tick the "Extract Inactive Version from Period" option. Once this box is checked, the user can enter a range of dates around the 25th of August 2014 in the "Version Management Period" selection field:

Running the CAST SAP Extractor with the selection scope mentioned above, will ask the engine to extract code for the most recent inactive version of report Z_DOWNLOAD_FILE_FROM_SERV on the system, whose generation date is between the 24.08.2014 and the 30.08.2014. Hence, the extractor will choose the ABAP version highlighted in the screenshot below:

Note 1

Sometimes, multiple inactive versions are stored in the system and all of them fulfill the input date range entered in selection field « Extract Inactive Version from Period ». The CAST SAP Extractor will only extract the most recent inactive version. Let's imagine that for the same above example, our developer would like to extract the inactive version of his report Z_DOWNLOAD_FILE_FROM_SERV, written on the 1st August 2014. The version management options will be as shown below:

The CAST SAP Extractor will thus extract the code for the inactive versions of report Z_DOWNLOAD_FILE_FROM_SERV generated on the 1st August 2014. However, there are two different inactive versions of this report whose generation date corresponds to 01.08.2014:


So which one of these two inactive versions will the CAST SAP Extractor retrieve? The one generated on the 1st August 2014 at 15:44:11 or at 18:46:21? Or both? The answer is simple: first of all, the CAST SAP Extractor will not extract both of these inactive versions. Instead, the extractor will fetch the most recent inactive version which corresponds to the user selection scope. In our case, this means that the CAST SAP Extractor will only retrieve the ABAP Source Code of the inactive version 00002 generated on the 01.08.2014 at 18:46:21 highlighted below:

Note 2

As explained above, the version management feature will extract inactive ABAP source code of various SAP objects. Here is the exhaustive list of all the ABAP objects whose inactive versions can be extracted from the past:

  • Reports
  • Includes
  • Function Groups (and all its includes: Function modules as well additional includes)
  • Classes (and all its includes: methods as well private section, public section and prohibited section information)
  • Interfaces
  • Dynpros (inactive flow logic of screens can be extracted by CAST, from the past. This will be stored in .LIST files)
  • Web Dyn Pro applications (inactive ABAP source code of the methods, event handlers, actions… among the multiple controllers of a Web Dyn Pro application, can be extracted from the past. This will be stored in an .XML file)

Unfortunately, extracting ABAP sources from the past has a limitation: if an ABAP object existed in the past, but does not exist any more in the current system, CAST will not be able to find the inactive ABAP source code of this object. In fact, this information is cleansed from SAP standard tables, when the corresponding object is deleted from the system.