You are on page 1of 65

Overview real-time replication

with SAP LT Replication Server


Agenda

Positioning and Key Concepts


Use Cases
SAP LT & TDMS as part of the product family

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 2


Big Data provisioning with SAP LT Replication Server
Sources Support of LAN, WAN Targets
and cloud deployments SAP Business
Warehouse
SAP Business Suite New
application-based SAP Simple Finance
powered by SAP HANA
 Pool, Cluster, INDX, HR tables replication
 Unicode & non-Unicode
 Replication of Views
 Support of NW 4.6c and higher SAP Data Services

SAP HANA Real-Time SAP LT


with optimized capturing Batch Replication Server
Native DB
 Transformation and filter capabilities
 Integrated data type mapping
 Scalable NetWeaver instance
 Replication staging for HA / DR Standard
 Option to load out of archives table-based SAP Business Suite
Native DB replication

SAP HANA applications*


 SAP ASE, Oracle
 MS SQL, Max DB
 IBM DB2, DB4, AS/400, Informix
SAP HANA

Unrestricted change data capturing Robust and proven architecture with *SAP Customer Activity Repository
*SAP HANA Live
with almost zero impact more than 4400 customers *SAP High Performance Applications
*Suite Accelerator and more apps
SAP Landscape Transformation Replication Server
Product description
SAP LT Replication Server (aka ‘SLT’) is a standard software to move data in real-time between different systems within the same network,
wide area networks, or into the cloud to have the information at the right place at the right point of time.

The software helps to feed analytical systems with up-to-date business information from the productive system landscape, support the
acceleration of large volume transactions executed in SAP HANA, enables real-time reporting and minimizes transfer volume for SAP BW and
enables the synchronization between different systems.

Replication
 Real-time or scheduled
 Delta capturing to minimize transfer volume
Transformation
 Filtering by using selective criteria
 Adjustment of tables
 Conversion of data, e.g. to make sensitive data
anonymous
Installation & operation
 Deeply integrated within SAP landscapes to reuse
existing installation and monitoring capabilities
 Monitoring with SAP Solution Manager 7.1 SP5
onwards

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 4


Agenda

Landscape Strategy and Sizing Aspects


Installation Procedure
Architectural Concept
Basic Configuration
Overview Important Transactions
Transformation and Adjustment Options - Table to Table Replication
Performance Optimization
Operations
• Monitoring of Replications
• Troubleshooting
• Software maintenance activities
• Disaster Recovery & High Availability
• API to support external tools

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 5


Important transactions

LTR – Creation of a new configuration


LTRC – Detailed overview on a configuration
LTRO – Monitoring of several configurations at a glance
LTRS – Advanced replication settings, like transformation rule, tables adjustments or performance
SM37 – Status system jobs
SM21 – System log
SM50 – Work Process Monitor
SM51 – Work Process Monitor including Application Server
ST10 – Change statistics for a table

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 6


LTR – Creation of a new configuration

Execute transaction LTR in the SLT system to open the Configuration and Monitoring Dashboard

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 7


LTRC – Detailed overview on a configuration

Input MT ID or use the F4-Help to


select your configuration.
More details in chapter „Operations“

You can also start and stop all


configurations or create a new
configuration (recommended LTR)

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 8


LTRO – Monitoring of several configurations at a glance

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 9


LTRS – Advanced replication settings

Use File to
download your
settings or upload All configuration are listed in the
the settings to overview area. You can choose
exchange from the configuration that needs some
Dev/QA to adjustments.
productive
systems.

Navigate back to
the Overview
sections
To define special settings for a table, just right-click on the required section and add the table:
• Performance Options: You would like to change the reading type to improve the load
Assign templates to • Rule Assignment: You would like to filter on a specific field
single tables or all
• Table Settings: You would like to adjust the target table structure
tables of the
• Trigger Options: You would like set a filter direct on the trigger in the source system
configuration

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 10


Agenda

Landscape Strategy and Sizing Aspects


Installation Procedure
Architectural Concept
Basic Configuration
Overview Important Transactions
Transformation and Adjustment Options - Table to Table Replication
Performance Optimization
Operations
• Monitoring of Replications
• Troubleshooting
• Software maintenance activities
• Disaster Recovery & High Availability
• API to support external tools

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 11


Chapter Content

Client Specific and Cross Client


Data Type Mapping source system to HANA system
Table Settings
Rule Assignment
• Field-related Rules
• Event-related Rules

Expert Filtering
• Initial Load Filter
• Trigger Options
• Views

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 12


Client Specific vs. Cross Client Load / Replication

Per default, the SAP LT Replication Server loads and replicates all data of the defined tables. Client specific tables are also
loaded and replicated completely and not restricted to a certain client. Data load can be restricted by define some filter rules
(described in the following slides) or by activating the client specific load and replication.

Prerequisites:
• Load / replication should be restricted to a single client
(To restrict a load to multiple but not all clients, individual filter rules need to be defined)
• RFC Destination to the source system points to the relevant
client (relevant client is derived from RFC connection)

Activation: Specify Read from Single Client when you create


a new Configuration.

Result:
• DB trigger are defined in a way that they only record changes from relevant client
• Data that is loaded and replicated is restricted to the client defined in the RFC destination

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 13


Client Specific Load
Advantages

• Trigger is restricted automatically to the relevant


client
• Data load can be restricted to a smaller amount
of data without manual defining filter rules

If you want to filter on a three client system (100,200,300) only on 100


and 200, you have to apply a transformation rule.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 14


Chapter Content

Client Specific and Cross Client


Data Type Mapping source system to HANA system
Table Settings
Rule Assignment
• Field-related Rules
• Event-related Rules

Expert Filtering
• Initial Load Filter
• Trigger Options
• Views

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 15


Global Mapping Values
The default type mapping can be redefined for each configuration with SAP Hana target. The individual type mapping can be defined as Global
Mapping Values and will affect all tables of the corresponding configuration. For those data types where no individual type mapping is defined,
the default mapping will be used.

You have to open the Table Settings folder and double-click on Global Mapping Values. Choose the add icon and input the Data Type you want
to change and the Target DB Type you want to use for all tables in this configuration.
For each table and table field you can redefine the Global Mapping Values. You find more details in the next chapter.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 16


Chapter Content

Client Specific and Cross Client


Data Type Mapping source system to HANA system
Table Settings

Rule Assignment
• Field-related Rules
• Event-related Rules

Expert Filtering
• Initial Load Filter
• Trigger Options
• Views

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 17


Table Settings

Under Table Settings, you can change the settings for a target table.
By default, the table created in the target system will have the same name
and structure as the source table. However, it might be necessary to
change the name or alter the table structure depending on your
requirements. For instance, tables from different sources could be
replicated to one target system, some table fields might have become
obsolete, or several fields could be combined into one field.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 18


Table Settings - Target Table Definition

You can specify a new table name can be entered in the Deviating Table Name field.

Modifications to the table structure can be achieved in two different ways. At first, you can use a different ABAP Dictionary
table (could be a copy of the existing table structure with adjusted fields). This type must be defined in either the source
system or in the SAP LT Replication Server system.

You enter the type in the Structure Template field. The second way to change the target structure is to define changes in
the Table Structure tab page. Note that both methods for changing a table structure can be used at the same time.

If a different ABAP Dictionary data type is defined, this type will be used as a starting point for modifications using the
Table Structure tab page.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 19


Table Settings - Table Properties

The Table Store field indicates how the data is stored in the target database. Data can be stored in columns (the default
setting), or rows. The third option is History Column Store. If you select this option, the system records every change to the
source table with a timestamp.

In the Partition Command field, you can specify a partition command for when the target table is created in the target system.
The code that you specify here is executed when the table is created in the target system. You can use the partition
command to split the target table into several smaller packages. For example, 'PARTITION BY HASH (MANDT, CARRID)
PARTITIONS 4' would create the table with four hash partitions selected by the fields Client (mandt) and CARRID.

Result on SAP HANA

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 20


Table Settings – Processing Settings

The size of read portions is the number of entries in one portion during the initial load for the default reading type DB_SETGET. It has no effect
for other reading types, for example access plan, or for delta replication. For delta replication, up to 5000 entries are selected in one portion.

Refresh Behavior
If a table is available in the target system, you can recreate the table (for example if you want to reuse the structure of the table).
To do this, you can choose one of the following options in the Refresh Behavior field:
Default - The system drops the target table completely (structure and data). The system recreates the tables again based on the configuration.
No Action - If the table exists in the target system it is used for the replication; no change to the structure or the data is made
Drop - Choose this option if you want to drop the target table completely (structure and data). The system recreates the tables again based on the
configuration.
Truncate - This option preserves the structure, but removes all data from the table.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 21


Table Settings – Table Structure

You can make changes to the target table structure in the Table Structure tab page. You
can view the existing table structure and the new table structure side by side.

With this option you can minimize the target table to save memory or you can enhance it to fill the
additional field with a transformation rule on the fly. Data type changes could be required if you plan
to fill a field with additonal values or another data type is expected by the target application.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 22


Table Settings – Table Structure
You can modify the structure in the following ways:

Add a new field


To add a new field, choose the Add pushbutton. You specify the field name, and information such as the position of the field in the table and the data type. If you
want to create a new key field, the field has to be positioned next to an existing key field to become automatically a key field.

Change a field
You can change the characteristics of a field. To do this, select a field and choose the Edit pushbutton. For example you can change the position of the field in
the table, or the length of the field.

Remove a field
You can remove a field from the table. To do this, select a field and choose the Remove pushbutton.

You can also change multiple fields at the same time. To do the
select the relevant fields, and choose the Mass Change
pushbutton. You can change the data type, length, and decimal
places for multiple fields. You can also remove multiple fields
from the table by choosing the Mass Change pushbutton, and
then specifying the fields that you want to remove.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 23


Table Settings – Table Structure

You can view the modified table structure by choosing the View Modified Table Structure pushbutton. All modifications, that is, the
ABAP Dictionary type and changes made in tab page Table Structure, are considered and the system displays the new structure.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 24


Table Settings – Mapping Values

The default type mapping can be redefined for each configuration on table level. The individual type mapping for a
table can be defined in Mapping Values and will affect only the table. These settings will win against the Global
Mapping Values.

Result on SAP HANA

FLDATE was the only field with data type DATS. It was changed into DATE.
If you only want to have a single field changed from e.g. from DATS to DATE, just use the Table Fields mapping. The Target
DB Types has to be specified as a string (for example DAYDATE CS_DAYDATE).

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 25


Table Settings – Create Table

Result on SAP HANA

You can choose Create Table to get a preview which SQL statement will be executed to create the table on SAP
HANA. The result after all changes is illustrated on the right screenshot. You see that the target table name was
changed to ZSFLIGHT_TEST, SID field was added as a key field and the field NEWFIELD_1 was removed.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 26


Rule Assignment – What can you do?

We only need Filtering will save


the data of last memory and
fiscal year transfer time

For N:1 Rule


replication we
will run in
Assignment
duplicates
Let us
scramble HR
data

Can we recalculate
some fields on the fly

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 27


Rule Assignment – Where can you filter/transform data?

SAP LT
SAP
ABAP/ non-ABAP system
Replication Server HANA

Initial load only: Initial load & replication:


• Apply filter criteria to adjust the read statement in table The Advanced Replication Settings (LTRS) is the
DMC_ACSPL_SELECT on SLT system to have a load recommended option to execute any kind of data
filter. adjustements. Filter criterias can be specified for
• Load from a view that includes a filter criteria the load and the replication in one step. Any kind of
data transformation can only be defined in this
transaction.

Replication only:
Apply filter criteria directly for DB trigger via LTRS (Trigger
Option) on SLT system.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 28


Rule Assignment – Concept

SAP LT Replication Server

ABAP/ non-ABAP system 1 Start of load / replication cycle


2 Get next portion from source

… 3 Loop through portion


Data Portions 4 Map fields of a record to sender structure …
and execute transformation rule
Data Portions SAP
5 Add record to sender portion
HANA

 The data for transformation will be split into portions (default: load: 10,000 lines, replication: 5,000 lines)
 The portions will be processed successively, mapped, and transferred to sender
 Extension of functionality (for example data conversion) is possible at several points of the process
 Implementation of filter or data transformation as ABAP coding

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 29


Rule Assignment – How to start

A rule can filter or transform data during the load an replication process. Choose Rule
Assignment and add the relevant table. A new user interface will appear and you can create
a new rule for the table.

You can choose between two different rule types:

Event-Related Rule
• More flexible
• Knowledge of data processing within the SAP LT Replication Server
needed to select the right event for the specific business scenario
• Has access to all fields of a record

Field-Related Rule
• Less flexible
• Easy to create by using parameters

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 30


Rule Assignment – Use Case

Two different rules will be applied to the table:

Data Transformation Rule


The field SID was newly created and is not available in the source table. No value is available.
 We want to fill the field SID with the unique value T40 that you see directly on SAP HANA
where the record is coming from.
 This is especially in a N:1 scenario important to avoid duplicates and see the origin.

Filter Rule
Within the table we have several carriers like Lufthansa (LH), American Airlines (AA) and many
more.
 We only want to move the data from carrier Lufthansa (CARRID = “LH”) to SAP HANA

A rule is a small code of ABAP that can be defined in LTRS or


as a separate ABAP include (e.g. for reusability)

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 31


Rule Assignment – Field-Related Rule

After you choose Field-Related Rule, you have to


choose the target field for the rule. You can use
the F4 help to get an overview about all fields. In
our scenario we choose SID and confirm the field.

After you confirmed you will see a new entry for a Field-Related Rule.
Double-click on the rule in the Rule Overview section, so that the
relevant data is displayed below.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 32
Rule Assignment – Field-Related Rule

The initial status is New. Change it to Released


that the rule will be used for the table. If you do not
need the rule any longer, change it to Obsolete.

You can specify up to three import parameters.


The import parameter could be fields of the table
or text literal. On the next slide you find the syntax
of the import parameter.

The rule can be defined within an ABAP include or


directly on the UI. If your code is less than 72
characters, you can directly write it to the field Line
of Code. If you have a more complex code, use an
ABAP include and specify the name of the include
for the field Include Name. Only one of both fields
can be filled.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 33


Rule Assignment – Field-Related Rule

Will be performed after the record is mapped to the receiver structure and before it will be added to the sender portion.

Import Parameters
 Are used within ABAP-code to apply values, which were determined in Advanced Replication Settings
 If no parameter has to be used within the rule, IMP_PARAM_1 has to be set to ‘DUMMY’!
 Values of fields of the sender record will be addressed in the include using the following name:
 IMPORT PARAMETER 1: i_<fieldname>_1 (for example, i_mandt_1)
 IMPORT PARAMETER 2: i_<fieldname>_2
 IMPORT PARAMETER 3: i_<fieldname>_3

 If you have defined a literal the technical name will be:


 IMPORT PARAMETER 1: i_p1
 IMPORT PARAMETER 2: i_p2
 IMPORT PARAMETER 3: i_p3

Export Parameter
 Specifies the fieldname of the receiver structure, which has to be filled within the parameter rule
 Addressed in the include using the following name:
 EXPORT PARAMETER: e_<fieldname> (for example, e_mandt).

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 34


Rule Assignment – Field-Related Rule

As the import value we choose a text literal ‘RK3’ (do not miss the ‘’). This value should be
inserted into the SID field for all records.
This small piece of code can be defined directly in the Line of Code:
E_SID = I_P1.
Do not forget the spaces before and after the `=` and the fullstop at the end. Do not forget to
save the rule afterwards.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 35


Rule Assignment – Field-Related Rule

If you do not want to use an import parameter,


please define a ‘DUMMY’ literal to avoid a
dump.

For the filter rule you work with the export


parameter for the carrier (E_CARRID) and
compare it with the value of Lufthansa (‘LH’). If
the value of CARRID is not equal (NE) ‘LH’ the
system will execute SKIP_RECORD and the
record will not be transferred to the target.

SKIP_RECORD is a macro from the SLT


engine.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 36


Rule Assignment – Field-Related Rule

Table in source system Result in SAP HANA

We find 13 entries in the source table including all By the filter on Lufthansa we reduced the records to
carriers like Air Canada (AC) and Air France (AF). 10. In addition we filled the SID field with the value
‘T40’.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 37


Rule Assignment – Event-Related Rule

After you choose Event-Related Rule, you have to


choose the event for the rule. The event define in
which stage of the process the rule will be
executed.
In the most cases you select the event BOR begin
of record. You find more details to the different
events on the next slide.

After you confirmed you will see a new entry for a


Event-Related Rule. Double-click on the rule in the
Rule Overview section, that the relevant data is
displayed below.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 38


Rule Assignment – Event-Related Rule
BOP (Begin of Processing):
Process flow
 Processed only once, before the data transfer really starts.

Start Load / Replication  Can be used to initialize certain global fields that might be used in subsequent events (for example, fill
internal mapping tables)
BOP – Begin of Processing
EOP (End of Processing):
DO
Get next portion from source system  Processed only once, after the data transfer is completed.

BOT – Begin of Block BOT (Begin of Block):

LOOP AT source  Access to all data records of a portion read from the sender system
BOL – Begin of Loop EOT (End of Block):
MOVE-CORRESPONDING  Access to all data records immediately before they are passed to the receiver system
source To target BOL (Begin of Loop):
BOR – Begin of Record  Like BOT if only one table is included in the conversion object; in case of objects with multiple tables, it can
individual field mapping be applied to each specific table

EOR – End of Record EOL (End of Loop):


EOL – End of Loop  Like EOT if only one table is included in the conversion object; in case of objects with multiple tables, it can
be applied to each specific table
ENDLOOP
BOR (Begin of Record):
Write to target system
EOT – End of Block  This event is processed before the field mapping of the individual fields is started.

ENDDO EOR (End of Record):

EOP – End of processing  This event is processed after the field mapping of the individual fields of a certain data record has finished.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 39


Rule Assignment – Event-Related Rule
The initial status is New. Change it to Released
that the rule will be used for the table. If you do not
need the rule any longer, change it to Obsolete.

You can specify up to three import parameter. The


import parameter could be fields of the table or
text literal. Import Parameters are usually not used
for event-related rules.

The rule can be defined within an ABAP include or


directly on the UI. If your code is less than 72
character, you can directly write it to the field Line
of Code. If you have a more complex code, use an
ABAP include and specify the name of the include
for the field Include Name. Only one of both filled
can be filled.
You find the syntax to address fields on the next
slide.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 40


SLT based Transformation Concepts
Details – Event-Based Rules
Event based Rules and Parameter Rules
•can be performed at several events of the transformation process
•the event has to be determined in Advanced Replication Settings
•Fields can be directly addressed in ABAP-Includes using field symbols
(event BOL, BOR, EOR and EOL only)

Fields of Sender Structure


<wa_s_(tab_name)>-<field> (for example, <wa_s_mara>-mandt)

Fields of Receiver Structure


<wa_r_(tab_name)>-<field> (for example, <wa_r_mara>-mandt)

 Typical use-case for an event-based rule


if you have to apply a mapping to figure out the value of the field to be changed with the rule, a select statement could be executed for each
record within a parameter rule. This could decrease the overall performance of the replication dramatically.
By creating an event based rule at the beginning of the replication process (BOP or BOT) an internal table containing the mapping

information could be initialized once. In a second event-based rule where the records will be processed, the mapping information can be
taken from internal table (in memory) instead of a select to database. So the overall performance can be optimzed by applying the event-
based rules.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 41


Rule Assignment – Field-Related Rule

In this example we created the include Z_RULE where we specify the rule. You can create it within
transaction SE38 or SE80 and specify the name in the field Include Name.
This small piece of code can be defined in the include :
<wa_r_zsflight_01>-sid = ‘T40'.
Do not forget the spaces between and the full stop. Do not forget to save and activate the include afterwards.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 42
Rule Assignment – Event-Related Rule

You can reuse the existing include to specify also the filter code.
IF <wa_s_zsflight_00>-carrid NE 'LH'.
SKIP_RECORD.
ELSE.
Do not forget the spaces between and the full stop. Do not forget to save and activate the include afterwards.
© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 43
Rule Assignment – Field-Related Rule

Table in source system Result in SAP HANA

We find 13 entries in the source table including all By the filter on Lufthansa we reduced the records to
carriers like Air Canada (AC) and Air France (AF). 10. In addition we filled the SID field with the value
‘T40’.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 44


Syntax Check for Rule Definition
New Feature DMIS 2011 SP8

Automatic syntax check when trying to set a rule to released.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 45


Rule Assignment – Consideration

Cluster tables with example BSEG

• For initial load, you create a transformation/filter for BSEG.

• For replication, you create a transformation/filter for RFBLG.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 46


Chapter Content

Client Specific and Cross Client


Data Type Mapping source system to HANA system
Table Settings
Rule Assignment
• Field-related Rules
• Event-related Rules

Expert Filtering
• Initial Load Filter
• Trigger Options
• Views

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 47


Expert filtering – Initial Load Filter

Use Case
You don't want to load the entire source table but a filter on the SLT is not the optimal solution as most of the data is transferred to the SLT system
and skipped here. In case you filter a significant part of a table it's better to already limit the reader module of the initial load accordingly.

Process
With DMIS 2011 SP6 a new table is available where Filter for the Initial Load and / or settings to parallelize the replication can be defined. The
entries in table DMC_ACSPL_SELECT have to be defined on the SLT systems.

Same result as Field-Related


and Parameter-Related Rule

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 48


Expert Filtering – Initial Load Filter
Details & Considerations
Fieldname Description
Access Plan ID
ACS_PLAN_ID Use ID 00000 for filter criteria of initial load and / or replication • Filtering is only working for initial load (validity = 2)
use access plan ID 00001 - 99999 for parallelization settings
• You can concatenate several conditions
FIELD Fieldname
VALUE Filter / parallelization value for current field • Filter can only be applied for fields that are part of the table itself
CURRNUM
Line Number (0001 - 9999) to define multiple records for the • Ensure that the reading type for your table is “5”. If “resource
same access plan ID
optimized” is selected for your configuration, specify reading type
LOGICAL_OPER
ATOR
Logical Operator (allowed in Open SQL where clause) manually via LTRS.
MT_ID Mass Transfer ID
GATING_OPERA required if several records for the same field are defined
TOR multiple fields are concatenated with AND automatically
MIGR_OBJ_ALIA
Table Name
S
Validity of this setting
1 = use for initial load and replication
VALIDITY
2 = use for initial load only
3 = use for replication only

You find more examples in SCN:


http://scn.sap.com/community/replication-server/blog/2014/02/25/how-to-filter-on-the-initial-load-parallelize-replication

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 49


Expert Filtering – Initial Load Filter
More Examples
Example 1: Filter on one field for a single value
Define filter criteria for table BKPF in mass transfer ID 001. Only those records should be loaded where GJAHR is greater or equal
2013. The filter criteria shall be relevant for initial load and replication.

MT_ID MIGR_OBJ_ALIAS VALIDITY ACS_PLAN_ID FIELD CURRNUM LOGICAL_OPERATOR VALUE GATING_OPERATOR

001 BKPF 2 00000 GJAHR 0001 >= 2013

The following where clause will be used for the select:


SELECT FROM BKPF WHERE GJAHR >= 2013.

Example 2: Filter on one field for multiple values


Define filter criteria for table BKPF in mass transfer ID 001. Only those records should be loaded where BUKRS is equal 0010 or between 1000 and 3000. The
filter criteria shall be relevant for the initial load only.

MT_ID MIGR_OBJ_ALIAS VALIDITY ACS_PLAN_ID FIELD CURRNUM LOGICAL_OPERATOR VALUE GATING_OPERATOR


001 BKPF 2 00000 BUKRS 0001 = '0010' OR
001 BKPF 2 00000 BUKRS 0002 >= '1000' AND
001 BKPF 2 00000 BUKRS 0003 <= '3000'

The following where clause will be used for the select:


SELECT FROM BKPF WHERE BUKRS = '0010' OR BUKRS >= '1000' AND BUKRS <= '3000'.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 50


Expert Filtering - Trigger Options

Use Case
SLT is capturing all updates, inserts and deletes for a table that is in replication. If you expect a very high change rate on the table, but your use
case requires only a subset of the records, you could minimize the replication volume by a trigger filter.

Process
Within the Trigger Options in LTRS you can specify a trigger code that will be added when SLT creates the DB trigger on the source system.
Ensure that the trigger condition is correct. The trigger option is a expert function, the code is database-specific. Keep in mind that with wrong
settings you can harm your source system.

Field Action
DBSYS Enter the database type of the source system.
LINE_NO You can specify multiple lines if the condition is too complex to be filled in only one line.

LINE Enter the trigger condition here. Only when the data change fulfills the condition , it will be recorded into the
logging table for the SLT replication.

DBSYS Syntax Sample


MaxDB field1 = 'value0' AND field2 IN ( 'value1', 'value2' ) CARRID = ‘LH'
DB2 ___."field1" = 'value0' AND ___."field2" IN ( 'value1', 'value2' ) ___."CARRID" = ‘LH'
DB6 ___.field1 = 'value0' AND ___.field2 IN ( 'value1', 'value2' ) ___.CARRID = ‘LG'
MSSQL field1 = 'value0' AND field2 IN ( 'value1', 'value2' ) CARRID = 'N'
ORACLE :___.field1 = 'value0' AND :___.field2 IN ( 'value1', 'value2' ) :___. CARRID = ‘LH'

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 51


Expert Filtering - Trigger Options

In this example, we want to customize the trigger directly in the source system
in a way that only changes to the data with CARRID = ‘LH’ will be recorded.

Please note: trigger filtering will only work for


replication phase. If it is required to filter the table
during the initial load phase, an additional Initial
Load Filter or a Event-related or Field-related Filter The trigger code is created with the filter condition. You
Rule has to be applied. can have a look at the trigger code in the expert
function of transaction LTRC.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 52


Replication of Views – Architecture with Projection View

Source System SAP LT Replication Server


Initial Load/Replication View C:
distinct fields from Table A Read view C SAP HANA

Table A

Table A

Source System SAP LT Replication Server Target Systems


Creating a Projection View with a subset of fields of a table means filtering on the source system. Only the data
in the fields which are selected for the view are transferred with SLT into the target system. The table in the
target system has then the same name as in the source but only contains the subset of fields.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 53


Creating a Projection View

In the ABAP Workbench of the source


system, create a Projection View to select
relevant fields from the table you want to
replicate. This functionality helps to filter
data on the source system side and
streamline the data transfer.

Source System SAP LT Replication Server Target Systems


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 54
Creating a Projection View: Assign the View to the Table

In the SLT system you have to assign the new view to the table. Add
the table under Table Settings and assign the view in the
Processing Settings of the table. You may assign the view for both
initial load and replication.
You can add a deviating table name, meaning that the table is
created with this new name in the target system. This helps to show
that a table is modified.

Source System SAP LT Replication Server Target Systems


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 55
Change Reading Type for Views: 5

Add the table under Performance Options


and change the Reading Type to 5 (INDX
CLUSTER with FULL TABLE SCAN).

Source System SAP LT Replication Server Target Systems


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 56
Creating a Projection View: Result of Initial Load in LTRC and HANA
In the target system the table is created with the deviated table name and contains only the data of the fields selected in the view (the other fields
stay empty – how to get rid of the empty fields, see under „Use View Template“).

Source System SAP LT Replication Server SAP HANA


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 57
Replication of Views – Architecture with Database View

Source System SAP LT Replication Server


Initial Load/Replication View C:
Table A plus 2 fields of B Read view C SAP HANA

+
Table A
Create table deviation of table A with
Table A 2 fields of B, load/replicate from view C
Table B

Source System SAP LT Replication Server Target Systems


If you join fields of different tables into one view, one table (A) is the leading table and fields from other tables can
be added. In the SLT system, the table deviation has to be built as a transformation of table A. The table keeps
the name as in the source system but is enlarged with the additional fields.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 58


Creating a Database View with the ABAP Workbench

ABAP Workbench

Create

Display Table Content

With a Database View you can join fields of tables to a leading table. Create a
new view in the ABAP Workbench and join the leading table with the dependent
table on the Join Conditions tab.
Define which fields should be filled in the target. After the activation of the view
you can display the table content and check the functionality of the view.

Source System SAP LT Replication Server SAP HANA


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 59
Creating a Database View: Change Table Settings of Leading Table
The table structure of the leading table has to be adapted
according to the created view. This is done in the SLT system in
the Advanced Replication Settings (LTRS). You can define a
deviating table name which makes clear in the target system that
the table is modified.
Add the view name for initial load and replication.

Source System SAP LT Replication Server SAP HANA


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 60
Creating a DB View: Change Reading Type for leading Table

For Views, the reading type has to be set to 5 in the Performance Options of the leading table.

Source System SAP LT Replication Server SAP HANA


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 61
Replication of the DB View: Structure of the View in HANA

In the Replication Server Cockpit the leading table ZSFLIGHT_00 is


added for replication. The effect is that the table is created in HANA
with deviating table name and the enlarged structure we have
defined in the view.

Source System SAP LT Replication Server SAP HANA


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 62
Use View Template to define the Target Table Structure

If you create a view an choose it as template for the table you want to replicate, you can change the field names and only create the fields you want
to fill in the target. Again we have entered a deviating table name.

Source System SAP LT Replication Server SAP HANA


© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 63
View Replication from non-ABAP Sources
New Feature DMIS 2011 SP08

As of SP08, the replication of views is possible for non-ABAP sources.


If you want to replicate a view from a supported database, use the
following procedure:
 Create the view in the source system or use a Z_report in the SLT
system to create the view.
 You can find an example of the Z_Report on the SCN page:
http://scn.sap.com/docs/DOC-61426
 Assign the view to the leading table in LTRS as described in the section
“Assigning the view to the table”.
 Start the replication for the table.

© 2014 SAP AG or an SAP affiliate company. All rights reserved. Public 64


Thank you

© 2014 SAP AG or an SAP affiliate company. All rights reserved.

You might also like