Using Generic DataSources


After completing this lesson, you will be able to:

  • Use Generic DataSources

Generic DataSources

We have discussed the use of BI Content DataSources, but sometimes you may need to create generic DataSources in the SAP source system. For example, when:

  • BI Content does not include a DataSource for your application.
  • BI Content requires extra enhancements that need data that is not supplied by BI.
  • The application does not feature its own generic data extraction method.
  • You use your own programs to fill in your tables in the SAP system.

Creating Generic DataSources

To Create a Generic DataSource, choose an option: Extraction from View, Extraction from Query, or Extraction by FM.

You use the transaction Maintain Generic DataSources (transaction RSO2) to create generic DataSources for transactional data, master data, or texts.

When you create a generic DataSource, you must first enter the application component and descriptions for describing the DataSource. The definition of the application component determines where the DataSource metadata is stored in the source system.

You can then select the data source for the generic DataSource. Here, you can choose from the following options:

  • Generic extraction with view.
  • Generic extraction with InfoSet.
  • Generic extraction with function module.

Generic Extraction with View

Generic Extraction with View: To extract the data from a transparent table or database view, enter the name of the table or view.

If you want to extract the data from a transparent table or database view, enter the name of the table or view. The extraction structure of the generated DataSource is then identical to that of the view or table.

You create views with the transaction SE11 (ABAP Workbench Dictionary). The view type Database View must be selected when you create the view. If more tables are needed, the tables must be joined by identical fields in the join conditions. All the key fields in the tables must be defined as view fields, otherwise some data records can overlap, and the data won't be transferred to SAP BW/4HANA.

Characteristics can be ignored if you are certain that they are not used in the table keys.

The sequence of fields for defining a database view for extracting texts is fixed as follows:

  • Client.
  • Language with the domain SPRAS, if the defined texts are language dependent.
  • Key field: If compounding is used, all of the relevant characteristics have to be listed.
  • If the data is time dependent, the DATETO and DATEFROM fields.
  • Short, medium, and long texts.

    If one of the text fields is not required, it must not be checked. If there is no medium length text, the last two fields are the short text and long text fields.

Generic Extraction with InfoSet

If you want to use an SAP Query InfoSet as a data source, select the required InfoSet from the InfoSet catalog. You can go to the screen for maintaining an existing InfoSet by double-clicking its name.

SAP Query or InfoSet Query is a powerful tool for defining reports in SAP source systems and supports different forms of reporting. It allows users to define and execute their own reports on data in the SAP system without any knowledge of the ABAP programming language. Reports are structured by entering texts and selecting fields and options in SAP Query.

An InfoSet is a special view of a dataset (for example, logical database, table join, table, or sequential file) and is used by SAP Query as a data source. Therefore, InfoSets determine which tables or fields in these tables can be referenced by a report. Usually, InfoSets are based on logical databases. SAP Query features a component for maintaining InfoSets. When you create an InfoSet, a data source in an application system is selected. SAP Query is relevant for SAP BW/4HANA because it allows you to define the exact structure by selecting fields in:

  • A logical database.
  • A table join.
  • Other datasets in the form of an InfoSet.

In this way, you can use the generic data extraction function for master or transaction data from any InfoSet. When you do so, a query is created for an InfoSet that retrieves data and transfers it to the generic extractor.

InfoSets represent an additional, convenient data source for extracting data generically. Logical databases in all SAP applications, table joins, and further datasets can be used as a data source for SAP BW/4HANA.

Create an InfoSet: Title and database screen and Initial Screen.

The following steps are needed for the InfoSet on the preceding figure:

  1. To create an InfoSet, open transaction SQ02 in the SAP system in which you want to create the data source.
  2. Enter a name for the InfoSet, such as Z_TRANSACTION, and choose Create.
  3. Choose Table join using basis table and enter the name of the (left) table as VBAP.
  4. Use the Add object icon to the (right) table MARA.
  5. Proceed and connect MATNR of the left table with MATNR of the right table by dragging to mouse between the corresponding fields.

The process for creating an InfoSet from the DataSource definition is as follows:

  1. Fill out all of the required entry fields (application component, descriptions.)
  2. Choose Extraction from Query.
  3. Choose Save. A new screen is displayed.
  4. Assign a name for your InfoSet and choose InfoSet Maintenance.
  5. On the screen that follows, choose Create.
  6. Select the data source (DB tables/views, joins, logical DB.)
  7. Define the field groups and assign the fields.

Generic Extraction with Function Module

Create DataSource for Transaction data. Extraction by FM and Function Module are highlighted.

If you want to use an ABAP function module as a data source, enter the name of the required function module.

A template is provided, RSAX_BIW_GET_DATA_SIMPLE, with which you can extract data with a function module. The data must be copied from the function module to an interface table, E_T_DATA.

Delta Process with Generic DataSources

Generic Delta screen. Available options are Delta-Specific Field, Timestamp, and Date Limit.

To integrate a delta process with a generic DataSource, certain prerequisites must be fulfilled. There must be a way of identifying the data records that have already been transferred to determine the delta. The following options are available:

  • Delta-specific Field: If there's a field in the extraction structure of a DataSource that contains values that increase monotonously over time, you can define delta capability for this DataSource by using this delta-specific field. If you choose a numeric type of delta-specific field, the volume of data transferred in delta mode is determined by comparing the maximum value transferred during the last load with the data that has accrued since.

  • Timestamp: If you choose a timestamp field, the timestamp of the last extraction is chosen as a limit. Only the data that is newer is transferred. Therefore, generic delta management converts the update mode into a selection criterion. The selections for the request are expanded by an interval for the delta-specific field. The lower limit of the interval is known from the last extraction and the current value determines the upper limit. For example, the time stamp at the time of extraction.

  • Date Field: If you choose a date field, the last microsecond of the day of last extraction is used as a limit. So, if you choose a date field, you miss changes that occur on the same day, after the DTP was executed.

You can modify the limits by safety intervals to ensure that all the data is included in the extractions. After a data request is transferred to the extractor and the data is extracted, the extractor informs generic delta management that the pointer can be set to the upper limit of the previously returned interval.

Load Transactional Data with Generic Delta Using ODP

To learn how to define a generic DataSource with generic delta on a table and load the data, refer to this video.

To learn how to perform a delta load for a generic DataSource with generic delta, refer to this video.

Log in to track your progress & complete quizzes