Adding Targets

Objective

After completing this lesson, you will be able to add target objects such as template tables to a data flow for data loading.

Target Objects

After placing sources and transforms in your data flows, complete the process by adding targets.

A target object can be a physical table or a file. You add them to your data flow by dragging and dropping metadata from a datastore or a file format, similar to how you add source objects.

When the target object is a physical database table, the target table editor opens in the workspace. This editor includes tabs for database properties, table loading options, and performance tuning.

Note

Most tabs in the target table editor focus on migration or performance tuning. This section focuses specifically on the Options tab.

Target Table Editor Options

OptionDescription
Column comparison

Define how input columns map to output columns. Validation errors occur if the data types do not match.

Delete data from a table before loading

Use this option to execute a TRUNCATE statement and clear the table before loading data during batch jobs. This option is disabled by default.

Ignore columns with value

Specify a value in a source column that should not be updated in the target table.

Use input keys

Configure SAP Data Services to use primary keys from the source table. By default, the system uses the primary key of the target table.

Update key columns

Update the values of key columns when loading data into the target.

File Formats as Targets

When using a file format as a target, you can modify the file location, just as you would for a source object.

You can also choose to delete the existing file content before loading new data.

Depending on the file format definition (which is not editable within the target object), you can also specify whether to include a header row.

Options of a file format target object.

If you need to load data into a table that does not yet exist, SAP Data Services can create it automatically during data flow execution.

To do this, add a template table as a target in your data flow.

Template Tables

Use template tables during the early stages of application development to design and test projects.

Template tables have the following features:

  • They allow schema changes without modifying the Relational Database Management System (RDBMS).
  • They are created in the underlying database only after the data flow executes successfully for the first time.
  • Once created, they function as standard tables in the database.
  • They are identified as template tables only within the SAP Data Services Repository metadata.
  • The Target Table Editor provides a Drop and Recreate Table option specifically for template tables.
  • The Import Table option converts a template table into a standard table.

With template tables, you do not need to manually create a table in your datastore and import its metadata. SAP Data Services automatically creates the table in the database using the schema defined in the data flow during job execution.

After creating a template table as a target in one data flow, you can use it as a source in other data flows.

You must convert template tables to standard tables to use them in expressions, functions, and transform options. Note that once converted, you can no longer modify the schema through the template table interface.

Use a Template Table

Follow this simulation to learn how to add a template table as target to the first job and use this template table in the second job:

Summary

In this lesson, you have learned how to add targets to your data flows.

  • Drag and drop physical tables or file formats into data flows as targets.
  • Use the Options tab to map columns, truncate tables, and manage key updates.
  • Specify file locations, delete existing content, and include header rows as needed.
  • Automatically create tables during execution, for rapid development and testing without manual database setup, by using template tables.
  • Transform template tables into standard tables to enable use in subsequent data flows.