Sie sind auf Seite 1von 45

SAP LANDSCAPE TRANSFORMATION

REPLICATION SERVER: REAL-TIME DATA


REPLICATION
DMM164

Exercises/Solutions
Tobias Koebler, Roland Hamm, Astrid Tschense / SAP SE
DMM164

TABLE OF CONTENTS

1 Before you start ..................................................................................................................................3

2 Chapter 1: Create a configuration and start a replication ...................................................................5

2.1 Create a Configuration from ABAP to SAP HANA ..........................................................................5

2.2 Check the table in SAP HANA STUDIO ..........................................................................................10

2.3 Create a new record and check the new entry in SAP HANA STUDIO ..........................................13

2.4 Summary (2) ....................................................................................................................................14

3 Chapter 2: Filter the intial load............................................................................................................15

3.1 Create initial load filters and start an initial load ..............................................................................15

3.2 Check the target table in SAP HANA STUDIO ...............................................................................23

4 Chapter 3: Use an ABAP to ABAP replication to enrich data to a Table ...........................................24

4.1 Create ABAP to ABAP configuration and start replication for table ZSCARR_XX .........................24

4.2 Create an entry in table ZSCARR_XX ............................................................................................33

4.3 Check entries for table ZSCARR_MAP_80 in the target system ....................................................36

4.4 Replicate ZSFLIGHT_XX with an additional field for Carrier Name ................................................37

4.5 Check records in SAP HANA ..........................................................................................................42

4.6 Optional: Create an additional entry in ZSCARR_XX and ZSFLIGHT_XX .....................................43

2
DMM164

1 BEFORE YOU START


In this hands-on session you have the opportunity familiarize yourself with the SAP LT Replication Server (aka 'SLT') to enable
real-time replication into SAP HANA.

The first exercise demonstrates how easy it is to establish a real-time replication. You will setup a configuration and replicate
data from a source system to a SAP HANA environment.

The second exercise focuses on filtering options for the initial load to reduce the data transfer volume and thus optimize
performance.
In the third exercise you will create an ABAP-to-ABAP replication to enrich a flight-booking table with additional airplane data.

Note: We recommend that you execute the exercises in the noted order to avoid any inconsistencies.

System Setup
To ensure a stable system environment and to enable all participants to run a real-time replication at the same time, the SLT
system was slightly modified to fulfill all requirements for allowing parallel exercises in such a big audience. You will see some
settings that differ from a regular system setup.
To simplify the setup, the source system and the SLT systems run on the same SAP NetWeaver instance. For the sake of equal
load distribution and acceptable system performance for all attendees the trainer will assign each participant to one of the
systems M96 or M97.
Please only use the system that you are assigned to.

3
DMM164

The SAP HANA system is M39 and M40. Further information is provided during the exercises.

4
DMM164

2 CHAPTER 1: CREATE A CONFIGURATION AND START A


REPLICATION

Overview
Estimated time: 30 minutes

Objective
In the following exercise you will get familiar with the concept of real-time replication with SAP LT Replication Server.

Exercise Description

 Create an SLT configuration to replicate data from an ABAP source system into an SAP HANA database
 Start the replication of a table
 Check the target table in SAP HANA
 Create a new record in the source table and check the new entry in SAP HANA

2.1 Create a Configuration from ABAP to SAP HANA

Explanation Screenshot

1. We create the SLT configuration


in the system that contains the
SLT server. Open SAP Logon
and select the
entry M96 or
M97 as announced by the trainer.

2. Enter the login credentials as


provided by the trainer:
Client: 001
User: DMM164-XX (replace xx
with your participant number)
Password: WelcomeSAP16 (enter
a new password when prompted)
Logon Language: EN
Press Enter.

Note: Please remember your


password!

3. The management UI for SLT is


the SAP LT Replication Server
Cockpit. Access the Cockpit with
transaction code LTRC.
Confirm your entry by pressing the
Enter key.

5
DMM164

Explanation Screenshot

4. Click the Create Configuration


button to create a new SLT
configuration.

5. Enter the name for the new


configuration, use the naming
convention SLT_HANA39_xx
(replace xx with your participant
number).
Enter a description (free text).
Click Next.

6. Specify the RFC connection to


the source system. To open the

drop-down list, click .

7. Double-click on

to select the RFC


destination.
(In case you are using the M97
SLT system please select the
SOURCE_M97 RFC destination).

8. Select the check box to Allow


Multiple Usage. This means that
there can be up to 4 configurations
with this source system.

9. Select the check box to Read


from Single Client. This means
that you only read data from the
client the RFC connection points
to.
Click Next.

10. Click Next .

11. To connect to the target


system we use a DB Connection
to the SAP HANA database.
Enter the following credentials:

Database System: HANA


Administration User Name:
HANA_M39 or HANA_M40

6
DMM164

Explanation Screenshot

Password: WelcomeSAP16
Host Name: lt5083 or lt5084
Instance Number: 01
Logical Port Number: 15
Click Next.

12. Specify the number of Data


Transfer Jobs.
Enter 1.
Leave the other settings to the
default.
Note:
In this step you would change the
replication option to Scheduled if
you did not want to have realtime
replication. Here you would also
define the initial load mode and
change it from resource optimized
to performance optimized if
required.
Click Next.

13. Review your entries and click


Create to create the
SLT configuration.

14. The new configuration is


added to the configuration
overview. A Mass Transfer ID is
assigned to the configuration and
you see the Status Active
(Running).
Click on the configuration name of
your configuration
SLT_HANA_xx
to open

7
DMM164

Explanation Screenshot

the configuration.

15. In the Table Overview you


see that the Data Dictionary tables
are already scheduled to be
loaded.Click Refresh
.

16. Now all table loads are running.


Note: In a standard environment,
the final status for the DD* tables
would be action Replication and
status In Process to reflect
changes to the DDIC tables. Only
for TechEd we changed some
system settings so that all users
can execute the exercises.
Click Refresh .

17. Now you can start to replicate


tables.
Click Data
Provisioning
.

18. In the Table Name field, enter


table name ZSFLIGHT_xx
(replace xx with your participant
number).

19. Click .

20. Click Execute .

8
DMM164

Explanation Screenshot

21. The table is in status


Scheduled.
Click Refresh .

22. Now the status changes to


Replication, beginning with the
Initial Load of the data.
Click Refresh .

23. In the Data Transfer Monitor


you see the performed steps until
the data is loaded.
Currently performed steps:
- Definition of the replication object
- Generation of the runtime object
Click Refresh .

24. Now the Calculation of the


access plan has happend and the
initial load or replication is In
Process.
Click Refresh .

25. Finally the data is loaded into


the target table.
You could check the duration of
the data load on the Load
Statistics tab (optional).

9
DMM164

2.2 Check the table in SAP HANA STUDIO

Explanation Screenshot

1. Now we want to check the table


in HANA.
Start the SAP HANA Studio from
the start menu or from the
Desktop.
On the Welcome page, click Open
Modeler.

2. In the SAP HANA Modeler, you


have to select one of the available
systems. Click Select

System... .

3. From the available connections,


select the entry H39
(HANA_M39)
or H40
(HANA_M40)
Click OK.

10
DMM164

Explanation Screenshot

4. In the system tree structure,


open the Catalog folder and find
your schema SLT_HANA39_xx or
SLT_HANA40_xx, depending on
your system assignment.
Note:
The schema name is the same as
the configuration you created in
the SLT system.

5. Open the schema and open the


Tables folder. Click on your table
ZSFLIGHT_xx with the right
mouse button to open the context
menu.

6. In the context menu click Open


Content to display the content of
the table.

11
DMM164

Explanation Screenshot

7. The content of your table


ZSFLIGHT_xx has been replicated
into SAP HANA. You can scroll
down to display all 128 records.

12
DMM164

2.3 Create a new record and check the new entry in SAP HANA STUDIO

Explanation Screenshot

1. Using a report we want to


create a new record in the source
table. In this system setup the
ABAP source system and SLT are
running on the same SAP
NetWeaver instance (which is
M96/M97). We start the ABAP
Editor with transaction code
/nse38.
Confirm your entry by pressing the
Enter key.

2. Enter program
name Z_SFLIGHT.
This report is used to generate
new records.
Click Execute.

3. Fill the fields of the report.


Group Number: xx (your
participant number)
Carrier: make a selection from the
dropdown-list
Connection: enter up to 4 digits
Date: select a date from the
calendar
Price: enter any price
Currency: enter EUR or USD
Plane Type: enter any plane type
like A380

Select the Insert Record button.

Note: It is important to enter your


participant number as group
number to insert the record in your
specific table zsflight_xx.

4. Click Execute .

13
DMM164

Explanation Screenshot

5. The record is inserted


successfully in your table
ZSFLIGHT_xx. Now we can check
the table on the HANA system.

6. In the table content view in the


HANA Modeler, click Refresh
(F5) to display the new entry.

7. Scroll down to the end to find


the new record.

2.4 Summary (2)


You have completed the exercise!

You are now able to:


 Create an SLT configuration from an ABAP source system to SAP HANA
 load a table and check the result in SAP HANA STUDIO

14
DMM164

3 CHAPTER 2: FILTER THE INTIAL LOAD

Overview
Estimated time: 10 minutes

Objective
Use filters to only transfer the required data. This reduces the amount of data which is transferred into the target system during
the initial load phase.

Exercise Description

 Use the Advanced Replication Settings to create initial load filters


 Filter for the Carrier IDs 'AA', 'AZ', an 'LH'. For 'LH' add the condition 'greater than 300'
 Check the result in SAP HANA STUDIO

3.1 Create initial load filters and start an initial load

Explanation Screenshot

1. In this step we want to create a


initial load filter to reduce the
amount of loaded data and start
an initial load.
Open the SAP LT Replication
Server Cockpit with transaction
code /nltrc.

2. Open your configuration


SLT_HANA39_xx with a double-
click on the configuration name.

15
DMM164

Explanation Screenshot

3. We first have to stop the


replication of the ZSFLIGHT_xx
table.
Click Data
Provisioning
.

4. Enter the name of your table


ZSFLIGHT_xx.
Select Stop Load / Replication.

5. Click Execute .

6. In the top menu, choose Goto -


> Advanced Replication
Settings

16
DMM164

Explanation Screenshot

7. In the Advanced Replication


Settings, open your SLT
configuration with a double-click.

8. Open the context menu on the


Performance Options folder and
click Add
Table

9. Enter the name of your table


ZSFLIGHT_xx and click Ok .

17
DMM164

Explanation Screenshot

10. On the Initial Load Options


tab, open the dropdown-list for the
Reading Type and select the
entry 4 Sender
Queue

by clicking it.

11. A popup shows the information


that the Filter/Range settings will
be activated. Click Continue .

12. We want to specify a filter that


only loads records for the carrier
IDs AA, AZ and LH when the
connid is higher 0300.
To create a new filter, click the
blank page icon and select
Filter .

13. Specify the Filter Condition for


the Carrier ID:
Field Name: CARRID
Operator: = Equal to
Low Value: AA

14. Click Ok .

15. Create a second filter for the


CARRID AF.
Click the blank page and
select Filter

18
DMM164

Explanation Screenshot

16. Specify the filter condition:


Field Name: CARRID
Operator: = Equal to
Low Value: AZ

17. Click Ok .

18. To create the third filter click


the blank page and
select Filter .

19. Specify the filter condition:

Field Name: CARRID


Operator: = Equal to
Low Value: LH

20. Click Ok .

21. Now we want to add the


addtional condition "greater than
300" to filter 3.
Mark the Filter 3 entry in the list.

22. Click on the blank page and


select Filter
Condition
to add
an additional condition to filter 3.

19
DMM164

Explanation Screenshot

23. Specify the filter condition:


Field Name: CONNID
Operator: > Greater than
Low Value: 300

Click Ok .

24. Save your settings .

25. Click back to navigate


back to the LT Replication Server
Cockpit.

26. In the LT Replication Server


Cockpit, click Data
Provisioning
.

27. Enter the name of your table


ZSFLIGHT_xx.
Select Start Load.
Click Execute .

20
DMM164

Explanation Screenshot

28. Click Refresh until the current


action is Load table (no
replication).

29. Now we want to compare the


amount of entries in the source
table without filters with the entries
in the target table.
Navigate to the Data Browser,
transaction code /nse16.
Confirm your entry by pressing the
Enter key.

30. In the Data Browser, enter the


name of your table ZSFLIGHT_xx
and click Table Contents .

31. In the Selection Screen click


Execute .

21
DMM164

Explanation Screenshot

32. The entries of the source table


are displayed including other
carrier IDs besides AA, AZ and
LH.
Navigate back.

33. In the Selection Screen you


can also display the number of
entries in the table. Click Number
of Entries .

34. The table contains 129 entries.


Click Close.

22
DMM164

3.2 Check the target table in SAP HANA STUDIO

Explanation Screenshot

1. Go back to the SAP HANA


Studio to the Table Content
display and click Refresh
(F5) .

2. The filters have been applied to


the table load. Scroll down to
check how many records are
loaded.

3. 58 records meet the filter criteria


and have been loaded.

Summary
You have completed the exercise!

You are now able to:


 Create initial load filters

23
DMM164

4 CHAPTER 3: USE AN ABAP TO ABAP REPLICATION TO ENRICH


DATA TO A TABLE

Overview
Estimated time: 30 minutes

Objective
Create an ABAP to ABAP configuration which replicates data from M39/M40 ABAP source system to M96/M97 ABAP target
system. Replicate the table ZSCARR_xx with a deviating table name ZSCARR_MAP_xx. Check the target table in M96/M97.
As a second step, enrich table ZSFLIGHT_xx with an additional field for carrier name and fill it with entries from table
ZSCARR_MAP_xx.

Exercise Description

 Create the ABAP to ABAP configuration and start replication for ZSCARR_xx to target table ZSCARR_MAP_xx
 Create an entry in ZSCARR_xx for carrier ID LH
 Check table ZSCARR_MAP_xx in the target system
 Add a new field for carrier name to table ZSFLIGHT_xx and add an include for using ZSCARR_MAP_xx to fill the field
 Create a new entry in table ZSFLIGHT_xx for the carrier ID LH
 Check in Hana Studio if table ZSFLIGHT_xx is filled correctly

Optional: Create an additional entry in ZSCARR_xx and a corresponding one in ZSFLIGHT_xx and check the result.

4.1 Create ABAP to ABAP configuration and start replication for table ZSCARR_XX

Explanation Screenshot

1. Open the LT Replication Server


Cockpit (transaction code /nLTRC)
and click Create to create a
new SLT configuration.

2. For your new SLT configuration


enter the configuration name
M39_SLT_xx or M40_SLT_xx.
Enter a description.
Click Next .

3. Specify an RFC Connection to


the source system. Open the

dropdown-list .

24
DMM164

Explanation Screenshot

4. Select SLTM96_M39 or
SLTM97_M40 respectively and
click .

5. Select the check box to allow for


Multiple Usage.
Select the check box to read from
Single Client.

6. Click Next .

7. For the connection to the target


system select the RFC
connection.

8. To select the RFC destination


open the dropdown-list.

25
DMM164

Explanation Screenshot

9. Select SOURCE_M96 or
SOURCE_M97 respectively and
click .

10. For the scenario, select the


entry Standard RFC
scenario

from the dropdown-list.


Click Next.

11. For the number of Data


Transfer Jobs, enter 1.

12. Click Next .

26
DMM164

Explanation Screenshot

13. Check your entries and click


Create to create the
SLT configuration.

14. Your new SLT configuration


appears in the configuration
overview of the SAP LT
Replication Server. Double-click
your configuration name to open
the configuration.

15. In your configuration open


Goto in the top menu and select
Advanced Replication Settings.

27
DMM164

Explanation Screenshot

16. In the Advanced Replication


Settings, click on
and open the
context menu.

17. Click the Add


Table menu
item to execute it.

18. As table name enter


ZSCARR_xx.
Click OK.

19. Click the blank page icon and


select Field-Related Rule.

20. Enter MANDT as the Target


Field. Click Ok .

28
DMM164

Explanation Screenshot

21. Double-click on the new rule


to manage the rule details.

22. Make the following entries:


Import Parameter 1: DUMMY
Line of Code: E_MANDT = '001'.

23. Set the status of the rule to


Released.

24. Click Save .

25. On the Table Settings folder


open the context menu and
click Add Table.

29
DMM164

Explanation Screenshot

26. Add your table ZSCARR_xx


and click Ok .

27. We want to give the target


table a new name.
On the Table Settings tab add the
Deviating Table Name
ZSCARR_MAP_80.
Click .

28. To navigate back click .

29. Now we want to replicate the


table.
In your SLT configuration click
Data
Provisioning
.

30
DMM164

Explanation Screenshot

30. Enter your table ZSCARR_xx


as table name.

31. Select Start Replication.


Click Execute.

32. Click
Refresh until the
table is in Replication (Initial
Load).

33. Open the Data Transfer


Monitor tab
.

34. Click
Refresh until the
table is flagged as loaded.

35. Now we want to check if there


are any entries in the target table.
Open the Data Browser
(transaction code /nse16).
Confirm your entry by pressing the
Enter key.

36. Enter the deviating table name


of your table ZSCARR_MAP_xx.

37. Click Table Contents .

31
DMM164

Explanation Screenshot

38. Click Number of


Entries .

39. There are no entries in the


table.
Click Close .

32
DMM164

4.2 Create an entry in table ZSCARR_XX

Explanation Screenshot

1. Open the ABAP source system


M39 or M40 respectively in the
SAP Logon

2. Log in with the following


credentials:
Client: 003
User: DMM164_xx
Password: WelcomeSAP16
Language: EN

Enter a new password when


prompted.

3. You can check again that there


are no entries in the source table
ZSCARR_xx, then we will create a
new entry in the ZSCARR tables.
Open the Data Browser
(transaction code /nse16).

Confirm your entry by pressing the


Enter key.

4. Enter your table ZSCARR_xx.

5. Click Table Contents .

33
DMM164

Explanation Screenshot

6. Click Number of
Entries .

7. There are no entries in the


source table.
Click Close .

8. To navigate back click .

9. Click the blank page icon to


insert new entries to the table.

10. Enter LH in the box.

34
DMM164

Explanation Screenshot

11. Make the following entries:


CARRID: make a selection from
the dropdown-list
CARRNAME: enter a name for the
carrier
CURRCODE: enter USD or EUR

12. Click Save to create the


new record.

13. The system reports that the


record is successfully created.

35
DMM164

4.3 Check entries for table ZSCARR_MAP_80 in the target system

Explanation Screenshot

1. In the target system M96 or


M97 respectively open the table
ZSCARR_MAP_xx again in the
Data Browser and click
Execute .

2. The new record has been


replicated and can be displayed.

36
DMM164

4.4 Replicate ZSFLIGHT_XX with an additional field for Carrier Name

Explanation Screenshot

1. Open your SLT_HANA39_xx or


SAP_HANA40_xx configuration
and open the context menu on the
Table Settings folder.

2. Click the Add


Table menu
item.

3. Add your table ZSFLIGHT_xx


and click Ok .

4. Open the Table Structure tab


and click the Add Line
icon to insert a new field.

37
DMM164

Explanation Screenshot

5. Make the following entries:


Field Name: CARRNAME
Position: 7
Data Type: CHAR
Length: 20

6. Click Ok .

7. The new line is displayed in the


Modification Overview.

8. Click on with
the right mouse button.

9. On the Rule Assignment folder


open the context menu and click
the Add
Table menu
item.

10. Add your table ZSFLIGHT_XX.


Click Ok .

38
DMM164

Explanation Screenshot

11. A popup reminds you to save


the changes you made to your
table. Click .

12. Click the blank page icon and


select the Event-Related
Rule
menu item.

13. For the Target Event, select


BOR Begin of Record from the
dropdown-list.
Click Ok .

14. Double-click on .

15. Enter the Include name of your


include ZREAD_CARRNAME_xx.

16. In the Details of Rule for Begin


of Record, set the status to
Released.

39
DMM164

Explanation Screenshot

17. Select the entry


Released by
clicking it.

18. Save your new rule .

19. The system recognizes that


the table ZSFLIGHT_xx is already
in load status. In order for the rule
to take effect, you have to stop the
load process and start a new load
or replication. Click Continue .

20. Go back to the LT Replication


Server Cockpit (transaction
/nLTRC).

21. In your configuration


SLT_HANA39_xx or
SLT_HANA40_xx click Data
Provisioning
.

22. Click .

23. Enter the table name


ZSFLIGHT_xx.

24. Click Execute .

40
DMM164

Explanation Screenshot

25. Click
Refresh until the
table is in Replication (initial
Load), logging table and trigger
are activated.

26. Now you can check in the


Data Transfer Monitor which step
is currently processed. Here you
see that the calculation of the
objects is scheduled (S).

27. Click Refresh .


Now the Calculation is finished.

28. Click .

29. Now the table is in status


Replication. We can check now in
the target table in HANA if the
additional field with the
corresponding entries is visible.

41
DMM164

4.5 Check records in SAP HANA

Explanation Screenshot

1. In the target table


ZSFLIGHT_xx we expect to see
an additional field which is filled
with the carriername Lufthansa in
case of the CARRID LH and with
'DUMMY' in all other cases.
Click Refresh (F5) .

2. After the Refresh we see the


new field CARRNAME at position
7, filled with DUMMY.
Use the vertical scroll bar to scroll
down to the LH entries.

For the CARRID LH the field


CARRNAME is filled with
Lufthansa. So we see that the rule
with the include completely worked
as designed.

42
DMM164

4.6 Optional: Create an additional entry in ZSCARR_XX and ZSFLIGHT_XX

Explanation Screenshot

1. You can create a new entry for


CARRID AA in your table
ZSCARR_xx in system M39 / M40:
Open the Data Browser (/nse16)
with table ZSCARR_xx and click
the blank page icon to insert an
entry.

2. Enter CARRID AA and


CARRNAME American Airlines.
Save your entry .

3. Now create a new entry in


ZFSLIGHT_xx for CARRID AA:
In system M96 open the ABAP
Editor (transaction code /nse38)
Click Execute.

43
DMM164

Explanation Screenshot

4. Make the following entries:


Group Number: your group
number
Carrier: AA
Connection: enter some number
Date: enter a date

Click .

5. Check in SAP HANA Studio that


the entry has been replicated into
the target table and the
CARRNAME field for CARRID AA
is filled. Scroll down to the end of
the table.

The new entry is inserted


correctly.

Summary
You have completed the exercise!

You are now able to:

 Create an ABAP to ABAP configuration


 replicate a table with a deviating table name
 use transformation methods: Add a new field to a table and work with rules

44
DMM164

© 2015 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP
affiliate company. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries.
Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

45