Summary: this section describes how to use the CAST SAP Extractor to extract SAP tables and views 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. Please note that the extractor only supports the extraction of the following SAP views: Data base views and projection views. All other views such as Maintenance, Help View etc. cannot be extracted with the tool.

Extraction storage repository

Before using the CAST SAP Extractor, you first need to define where to store the result of each extraction - the Extraction Result Target option enables you to do so. Each extraction will create one ZIP file. Please see CAST SAP Extractor NG - ABAP source code extraction - 8.3.x - 8.2.x - 8.0.x where this section is explained in more detail. The storage location configuration is common to both ABAP source code extraction and Tables and Views extraction.

Table/View Extraction Scope

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

  • Main Tables and Views Extraction Options
  • Additional Tables Extraction Options


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

Note that you can define your scope based on one or multiple criteria. If you choose multiple criteria, the extraction results will be the conjunction of all the criteria. For example, if you enter a package name as well as a table name which happens to belong to another package in the Main Tables and Views Extraction Options then because the conjunction of these two fields gives an empty output, the CAST SAP Extractor will decide that the selection is not consistent and in most circumstances, nothing will be extracted.

Main Tables and Views Extraction Options

Application Component

This option represents the high level SAP Application hierarchy for example: Basic Components, Financials, Enterprise Portal etc. Using this option you can extract all ABAP tables and views related to Application Components. To do so, enter the Application Component names in the corresponding selection fields:

Package Name

This option allows the extraction of Tables and Views for one or multiple packages.  To do so, enter the packages' names in the corresponding selection field:

A match code is available to help you, choose the package(s) you would like to use for the Table and view Extractions.

Example

In this example, the user would like to extract all the specific tables on the SAP instance. To do so, enter Z* and Y* into the "Package" selection fields as shown below:

Table/View Name

This option enables users to extract Tables and Views directly by entering their names in the corresponding selection field:

Example

Let's suppose that a user would like to extract all the specific tables and views on his SAP instance. To do so, simply enter Z* and Y* in the "Table Name" selection as shown below:

Tables/Views Exclusion File

This selection field allows you to define a file name containing Tables or Views which you would like to exclude during the extraction. To do so, enter the file name in the following selection field:

Note that the file should be stored locally on your machine and not on the SAP Server.

Maximum Number of Tables/Views to handle

You can limit the number of tables and views to extract by entering a value in the following field:

The default number of tables and views to extract is set to 10000.

Additional Table & Views Extraction options

A handful of addition options are also available to provide the user with other useful extraction features as shown below:


The following paragraphs will explain these additional features in details.


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


Consider Tables

This option forces the CAST SAP Extractor to choose whether to retrieve data about the tables matching the selection scope. If you want to include SAP Tables during the execution of the tool, tick the following box:

In this case, if you choose to check the box mentioned above and thus to include SAP Tables during the extraction, then CAST Extractor will build an XML file which:

  • Will summarize and display all the data required for each table that has been extracted (column name, table description, primary and foreign keys, column related data types…)
  • Is entitled: "SAP_tables_001.SAP.XML".
  • Can be found in the root node of the Extraction Zip file result.

Example

For instance, asking the CAST SAP Extractor to extract table "TADIR" will provide the following XML file:

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. You can of course expand the XML tag corresponding to table "TADIR" which has been extracted to get more details:

Hence, the generated XML contains information about the table columns (displayed under the <COLUMNS> XML tag), indexes (under <INDEXES>) and foreign keys (under <FKS>). Each one of these tags can be expanded on its own. For instance, expanding the XML tag corresponding to the extraction of table "TADIR" will provide the following details:

Consider Views

This option forces the CAST SAP Extractor to choose whether to retrieve data about the Views matching the selection scope. If you want to include SAP Views during the execution of the tool, tick the following box (please note that the extractor only supports the extraction of the following SAP views: Data base views and projection views).

In this case, if you choose to check the box mentioned above and thus to consider SAP Views during the extraction, then CAST Extractor will build an XML file which:

  • Will summarize and display all the data required for each view that has been extracted (view type, view description, joined tables, join conditions, selection conditions…)
  • Is entitled: "SAP_views_001.SAP.XML"
  • Can be found in the root node of the Extraction Zip file result

Example

For instance, asking the CAST SAP Extractor to extract view "DM40V" will provide the following XML file:

As shown in the capture above, each view that has been extracted corresponds to an XML tag attached to a parent XML node, corresponding to the SAP package to which the view belongs to. You can of course expand the XML tag corresponding to view "DM40V" which has been extracted to get more details:

Hence, the generated XML contains information about the view columns (under the <COLUMNS> XML tag), foreign keys (under <FKS>), joined tables (under <TABLES>) and join conditions (under <JOIN_CONDITIONS>). Each one of these tags can be expanded on its own. For instance, expanding the  <TABLES> and <JOIN_CONDITIONS> XML tags will provide, details about the condition on which these tables (DM40L and DM40T) have been joined to create view "DM40V":

Consider CDS

This option is only available in CAST SAP Extractor NG ≥ 8.3.x, and allows CDS Views to be extracted. When active an 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:

Extract Number of Rows

Enabling this feature will force the CAST SAP Extractor to build another file which will display the number of rows of each table and view that has been extracted. This file is entitled: "SAP_tables_volume_0001.SQLTABLESIZE" and can be found in the root node of the Extraction Zip file result. You can simply open this file with a text editor (Notepad…) or even with a browser.

This .SQLTABLESIZE file can be integrated into the analysis of your SAP tables/views as follows:

AIP Console

Deliver the *.sqltablesize files that define your table row size information along with your SAP extraction files in the ZIP file or the source code upload folder.

CAST Management Studio

At Analysis Unit level:

Example

In this example, we will attempt to extract the view "DM40V" and table "TADIR" at the same time. For this purpose, you need to enter the name of these two SAP objects in the "Table/View Name" selection fields:

You then need to tick the main two checkboxes "Consider Tables" and "Consider Views":

Ticking the two first boxes will make CAST SAP Extractor build the XML files described in the sections above. Ticking the third box "Extract Number of Rows" will ask the CAST SAP Extractor to build a third .SQLTABLESIZE file as shown below:

As shown in the capture above, each XML tag corresponds to an element that has been extracted. Among the different tag properties, we can find data about the number of rows of the corresponding element.

Include client dependent table

SAP tables can have a column corresponding to the "Mandant" value as a key. These tables are called "Client Dependent" tables. When the user ticks this option, the CAST SAP Extractor will retrieve tables which are "Client Dependent", from the SAP system.

DB existence checks

When this option is enabled, the CAST SAP Extractor will check the existence of each DB table or view before proceeding with the extraction. This will avoid a situation where the extractor is run on on non-existent elements.

This is a security measurement, which can have a small impact on the extraction execution runtime.