You are on page 1of 80

A PRIMER ON ENTERPRISE INFORMATION

MANAGEMENT WITH SAP HANA


DMM165

Exercises / Solutions
DMM165

DMM165 - A Primer on Enterprise Information


Management with SAP HANA
1. BEFORE YOU START ............................................................................................................................... 4
2. COPY SESSION FILES ............................................................................................................................. 5
2.1. Overview ................................................................................................................................................. 5
2.2. Copy Session Files ................................................................................................................................ 5
2.3. Summary ................................................................................................................................................ 7
3. SOURCE DATA ......................................................................................................................................... 8
3.1. Overview ................................................................................................................................................. 8
3.2. Register the Data Provisioning Agent ................................................................................................. 8
3.3. Register the FileAdapter ..................................................................................................................... 11
3.4. Create a Remote Source ..................................................................................................................... 14
3.5. Create Virtual Tables ........................................................................................................................... 17
3.6. Summary .............................................................................................................................................. 23
4. REPLICATION ......................................................................................................................................... 24
4.1. Overview ............................................................................................................................................... 24
4.2. Replication ........................................................................................................................................... 24
4.3. Summary .............................................................................................................................................. 31
5. FILTER ..................................................................................................................................................... 32
5.1. Overview ............................................................................................................................................... 32
5.2. Filter ...................................................................................................................................................... 32
5.3. Summary .............................................................................................................................................. 42
6. UNION ...................................................................................................................................................... 43
6.1. Overview ............................................................................................................................................... 43
6.2. Union ..................................................................................................................................................... 43
6.3. Summary .............................................................................................................................................. 59
7. JOIN ......................................................................................................................................................... 60
7.1. Overview ............................................................................................................................................... 60
7.2. Join ....................................................................................................................................................... 60
7.3. Summary .............................................................................................................................................. 79
8. COPYRIGHT ............................................................................................................................................ 80

2
DMM165

A Primer on Enterprise Information


Title
Management with SAP HANA
Richard LeBlanc, Avijit Kumar Singh,
Speaker
Werner Daehn, Fernando Velez
Company SAP

3
DMM165

1. Before you start


Session DMM165 consists of the following chapters. Chapters 1 and 2 are required to move on to any of the
other chapters. You can then choose to perform chapters 3-6 in any order or even skip some if you think you
won't have time to finish them all.

Chapter 1: Copy Session Files


Estimated Duration: 5 minutes

Chapter 2: Source Data


Estimated Duration: 20 minutes

Chapter 3: Replication
Estimated Duration: 15 minutes

Chapter 4: Filter
Estimated Duration: 20 minutes

Chapter 5: Union
Estimated Duration: 25 minutes

Chapter 3: Join
Estimated Duration: 20 minutes

4
DMM165

2. Copy Session Files


2.1. Overview
Estimated time: 5 minutes

Objective
Get the external data files you will be using when designing various ETL processes in HANA.
Get the configuration files that enable parsing of the external data files.

Exercise Description
[provide a description as a short overview to what objectives will be executed during the exercise, e.g.]:
 Open the network share
 Copy the data and cfg folders
 Paste them on a local directory on the laptop

2.2. Copy Session Files

Explanation Screenshot

1. Click the

Run... me
nu item to execute it.

2. Enter
\\students.fair.sap.corp\Student
share in the Open: box.

3. Click OK .

4. Double click on the entry


DMM165

to select it.

5
DMM165

Explanation Screenshot

5. Select the entry


cfg

by clicking it.

6. Select the entry


data

by clicking it.
Press Shift key while performing
the action.

7. Click on
data

with the right mouse button.

8. Click the
Copy

menu item to execute it.

9. Click SAP (D:) .

10. Double click on the entry


Files
to select it.

6
DMM165

Explanation Screenshot

11. Double click on the entry


Session
to
select it.

12. Double click on the entry


DMM165
to
select it.

13. Click on with the right mouse


button.

14. Click the


Paste
menu item to execute it.

2.3. Summary
You have completed the exercise!

You are now able to:


 Access the data and configuration files.
 Proceed with the next exercise, which consists of creating connections to the data files.

7
DMM165

3. Source Data
3.1. Overview
Estimated time: 20 minutes

Objective
Expose the external data sources as HANA catalog objects so that they can be used in various ETL
processes.

Exercise Description
Configure HANA and the Data Provisioning Agent so that the external data files can be accessed.
 Start the Data Provisioning Agent Configuration tool
 Connect to the HANA instance
 Register the Data Provisioning Agent
 Configure the FileAdapter
 Register the FileAdapter
 Create a Remote Source using the registered FileAdapter
 Browse the Remote Source to see the various data files that are available
 Create Virtual Tables that provide virtualized access to the data files

3.2. Register the Data Provisioning Agent

Explanation Screenshot

1. Click the Command


Prompt

menu item to execute it.

2. Enter ipconfig in the Windows


Command Prompt.

Please take note of the IPv4


Address. You will need it in a
subsequent step.

3. Click the All


Programs

menu item to execute it.

8
DMM165

Explanation Screenshot

4. Click SAP .

5. Click SAP HANA .

6. Click the SAP HANA Data


Provisioning Agent
Configuration

menu item to execute it.

7. Click Connect to
HANA .

9
DMM165

Explanation Screenshot

8. Enter lt5070.wdf.sap.corp in
the HANA Hostname: box.

9. Enter 31015 in the HANA


Port: box.

10. Enter DMM165_XX in the


HANA Admin User: box.

11. Enter in the HANA Admin


Password: box.

12. Click Connect .

13. Click Register


Agent .

14. Enter DMM165_XX in the


Agent Name: box.

15. Enter the IP Adresss you took


note of in step 2 of this exercise in
the Agent Hostname: box.

10
DMM165

Explanation Screenshot

16. Click Register .

17. Click OK .

3.3. Register the FileAdapter

Explanation Screenshot

1. Click the Configure


menu item to execute it.

11
DMM165

Explanation Screenshot

2. Click the
Preferences
menu item to execute it.

3. Click Adapters .

4. Open the folder by clicking the


Open folder icon.

5. Click FileAdapter .

12
DMM165

Explanation Screenshot

6. Enter
D:\Files\Session\DMM165\data
in the Root Directory: box.

7. Enter
D:\Files\Session\DMM165\cfg in
the File Format Root Directory:
box.

8. Enter 12345 in the


AccessToken box.

9. Click OK .

10. Click Register


Adapter .

11. Click Yes .

13
DMM165

Explanation Screenshot

12. Click OK .

3.4. Create a Remote Source

Explanation Screenshot

1. Enter
lt5070.wdf.sap.corp:8010/sap/h
ana/ide/catalog in the Address
and search bar box.

2. Enter DMM165_XX in the

box.

3. Enter Welcome15 in the

box.

4. Click

5. Click

14
DMM165

Explanation Screenshot

6. Click on

with the right mouse button.

7. Click .

8. Enter DMM165XX_Files in the


Source Name box.

9. Click .

10. Click here

15
DMM165

Explanation Screenshot

11. Enter
D:\Files\Session\DMM165\data
in the Root Directory box.

12. Enter
D:\Files\Session\DMM165\cfg in
the Directory of the fileformat
definitions box.

13. Click Credentials

Mode .

14. Click .

15. Click .

16. Enter 12345 in the


AccessToken box.

16
DMM165

Explanation Screenshot

17. Click .

18. Click on

with the right mouse button.

19. Click .

Now you can see the new


Remote Source

3.5. Create Virtual Tables

Explanation Screenshot

17
DMM165

Explanation Screenshot

1. Click on

with the right mouse button.

2. Click .

3. Click .

4. Click on with the right


mouse button.

18
DMM165

Explanation Screenshot

5. Click .

6. Click .

7. Click on with the right


mouse button.

8. Click .

19
DMM165

Explanation Screenshot

9. Click .

10. Click on with the


right mouse button.

11. Click .

20
DMM165

Explanation Screenshot

12. Click .

13. Click on with the


right mouse button.

14. Click .

21
DMM165

Explanation Screenshot

15. Click .

16. Click

17. Click DMM165_XX .

18. Click

22
DMM165

Explanation Screenshot

Here is the list of virtual tables


that were added to your schema
in the HANA catalog.

3.6. Summary
You have completed the exercise!

You are now able to:


 Register the Data Provisioning Agent with the HANA instance
 Configuret the FileAdapter
 Register the FileAdapter with the HANA instance
 Create a Remote Source using the FileAdapter
 Browse the Remote Source
 Create Virtual Tables

23
DMM165

4. Replication
4.1. Overview
Estimated time: 15 minutes

Objective
Take currency data from an external data source and replicate into a HANA table.

Exercise Description
[provide a description as a short overview to what objectives will be executed during the exercise, e.g.]:
 Create a Replication Task
 Choose a Remote Source
 Specify a Virtual Table prefix to prevent table name conflits with the target tables
 Choose the table to replicate
 Remove unwanted columns
 Save the Replication Task
 Execute
 Verify the results

4.2. Replication

Explanation Screenshot

1. Click .

2. Click .

24
DMM165

Explanation Screenshot

3. Click on
DMM165_XX with
the right mouse button.

4. Click
.

5. Enter Currencies in the box.

6. Click .

7. Click .

8. Click
DMM165XX_Files

9. Enter VT _ in the box.

25
DMM165

Explanation Screenshot

10. Click .

11. Click here.

12. Click .

13. Select PATH

14. Click .

26
DMM165

Explanation Screenshot

15. Click .

16. Select NAME

17. Click .

18. Click .

19. Select ROWNUMBER

27
DMM165

Explanation Screenshot

20. Click .

21. Click .

22. Select ERROR

23. Click .

24. Click .

28
DMM165

Explanation Screenshot

25. Select PARTITION

26. Click .

27. Click .

28. Click .

29. Click .

29
DMM165

Explanation Screenshot

30. Click [M42] SAP HANA:


Catalog .

31. Click on with the


right mouse button.

32. Click .

33. Click on
with the right mouse button.

34. Click .

30
DMM165

Explanation Screenshot

Here you can see the replicated


data

4.3. Summary
You have completed the exercise!

You are now able to:


 Replicate data from an external data source into HANA

31
DMM165

5. Filter
5.1. Overview
Estimated time: 20 minutes

Objective

Take materials from an external data source and apply a filter so that only those with material type FERT
(Finished Goods) or HAWA (Trading Goods) are loaded into a HANA table.

Exercise Description
 Create a new Flowgraph
 Add the materials as a data source
 Add a Filter operation and specify criteria
 Add a Template Table as the target
 Save the Flowgraph
 Execute the Flowgraph
 Verify the results in the target table

5.2. Filter

Explanation Screenshot

1. Click on DMM165_XX with the


right mouse button.

2. Click .

3. Enter Filter in the box.

4. Click .

32
DMM165

Explanation Screenshot

5. Click here.

6. Click .

7. Click DMM165_XX.

8. Click
.

9. Click
DMM165XX_Files_mara.csv.

10. Click .

33
DMM165

Explanation Screenshot

11. Click .

12. Click here.

13. Click
DMM165XX_Files_mara.csv

14. Drag .

15. Drop on .

34
DMM165

Explanation Screenshot

16. Click .

17. Click here.

18. Click .

19. Drag .

20. Drop on .

21. Double-click on

35
DMM165

Explanation Screenshot

22. Click .

23. Click .

24. Click .

25. Click .

26. Click .

27. Click .

28. Click .

36
DMM165

Explanation Screenshot

29. Click .

30. Click .

31. Click .

32. Click .

33. Click .

34. Drag
.

35. Drop on .

36. Enter ='FERT' OR after


"Filter1_Input"."MTART"

37
DMM165

Explanation Screenshot
37. Drag
.

38. Drop after


"Filter1_Input"."MTART"='FERT'
OR .

39. Enter ='HAWA' after


"Filter1_Input"."MTART"='FERT'
OR "Filter1_Input"."MTART"

40. Click .

41. Double-click on

TemplateTable1 .

42. Enter MATERIALS in the


Name: box.

43. Click the


button to open a dropdown list.

38
DMM165

Explanation Screenshot

44. Select the entry


DMM165_XX by clicking it.

45. Click .

46. Click .

47. Click .

39
DMM165

Explanation Screenshot

48. Click [M42] SAP HANA:


Catalog .

49. Click .

50. Click DMM165_XX.

51. Click on with the


right mouse button.

40
DMM165

Explanation Screenshot

52. Click .

53. Click on with


the right mouse button.

54. Click .

41
DMM165

Explanation Screenshot

Here you can see the results of


the Flowgraph being executed.
You can see that the MTART
column for all records have the
value FERT or HAWA, just like
you defined in the Filter
transform.

5.3. Summary
You have completed the exercise!

You are now able to:


 Take data from an data source, apply a filter and load it into a table in HANA

42
DMM165

6. Union
6.1. Overview
Estimated time: 25 minutes

Objective
Take customers and vendors from external data sources, combine them and load them in a single HANA
table.

Exercise Description
 Create a new Flowgraph
 Add the customers as a data source
 Add a Filter operation to remove unwanted columns from the customer data source
 Add the vendors as a second data source
 Add a Filter operation to remove unwanted columns from the vendor data source
 Add a Union operation to combine the filtered customer and vendor data sources
 Add a template table as the target
 Save the Flowgraph
 Execute the Flowgraph
 Verify the results in the target template table

6.2. Union

Explanation Screenshot

1. Click on
DMM165_XX with the
right mouse button.

2. Click .

43
DMM165

Explanation Screenshot

3. Enter Union in the Name box.

4. Click .

5. Click .

6. Click here.

44
DMM165

Explanation Screenshot

7. Click
DMM165_XX .

8. Click
.

9. Click
DMM1665XX_Files_kna1.csv
.

45
DMM165

Explanation Screenshot

10. Click .

11. Click
.

12. Click here.

46
DMM165

Explanation Screenshot

13. Click
DMM165_XX .

14. Click
.

15. Click
DMM165XX_Files_lfa1.csv
.

47
DMM165

Explanation Screenshot

16. Click .

17. Click .

18. Click here.

48
DMM165

Explanation Screenshot

19. Click .

20. Click here.

21. Click .

22. Drag .

23. Drop on .

49
DMM165

Explanation Screenshot

24. Click .

25. Drag .

26. Drop on .

27. Double-click on

28. Click .

29. Click .

30. Click .

31. Click .

32. Click .

50
DMM165

Explanation Screenshot

33. Click .

34. Click .

35. Click .

36. Click .

37. Click .

38. Click .

51
DMM165

Explanation Screenshot

39. Enter BPNR in the box.

40. Click .

41. Click .

42. Double-click on

43. Click .

44. Click .

52
DMM165

Explanation Screenshot

45. Click .

46. Click .

47. Click .

48. Click .

49. Click .

50. Click .

51. Click .

53
DMM165

Explanation Screenshot

52. Click .

53. Click .

54. Enter BPNR in the box.

55. Click .

56. Click .

57. Click .

54
DMM165

Explanation Screenshot

58. Click here.

59. Click .

60. Drag .

61. Drop on .

62. Click .

63. Drag .

64. Drop on .

65. Double-click on .

55
DMM165

Explanation Screenshot

66. Click .

67. Click .

68. Click here.

69. Click .

70. Drag .

71. Drop on .

72. Double-click on

56
DMM165

Explanation Screenshot

TemplateTable1 .

73. Enter BUSINESS_PARTNERS


in the Name box.

74. Click the Authoring


Schema button
to open a dropdown list.

75. Select the entry


DMM165_XX by clicking
it.

76. Click .

77. Click .

78. Click .

57
DMM165

Explanation Screenshot

79. Click .

80. Click .

81. Click .

82. Click .

83. Enter select count(*) from


"DMM165_XX"."DMM165XX_Files
_kna1.csv in the text field.

84. Enter select count(*) from


"DMM165_XX"."DMM165XX_Files
_lfa1.csv" in the box.

58
DMM165

Explanation Screenshot

85. Enter select count(*) from


"DMM165_XX"."BUSINESS_PART
NERS" in the box.

86. Click .

Note that the record count for


the kna1 virtual table is 8403.

87. Click .

Note that the record count for


the lfa1 virtual table is 2223.

88. Click .

Note that the record count for


the BUSINESS_PARTNERS table
is 10626.
This is the result of the union
of the kna1 table + the lfa1 table
8403+2223=10626.

6.3. Summary
You have completed the exercise!

You are now able to:


 Take data from multiple external data sources, union them and load them in a single table in HANA.

59
DMM165

7. Join
7.1. Overview
Estimated time: 20 minutes

Objective

Take sales orders and sales order items from external data sources, join them, and load it in a single HANA
table.

Exercise Description
 Create a new Flowgraph
 Add the sales order headers s as a data source
 Add the sales order items as a second data source
 Add a Filter operation to remove unwanted columns from the sales order headers data source
 Add a Filter operation to remove unwanted columns from the sales order items data source
 Add a Join operation to combine the two data sources having a common identifier
 Add a Template Table as the target
 Save the Flowgraph
 Execute the Flowgraph

7.2. Join

Explanation Screenshot

1. Click on
DMM165_XX with
the right mouse button.

60
DMM165

Explanation Screenshot

2. Click .

3. Enter Join in the box.

4. Click .

5. Click .

61
DMM165

Explanation Screenshot

6. Click .

7. Click
DMM165_XX .

8. Click
.

9. Click
DMM165XX_Files_vbak.csv
.

62
DMM165

Explanation Screenshot

10. Click .

11. Click
.

12. Click .

13. Click
DMM165_XX .

63
DMM165

Explanation Screenshot

14. Click .

15. Click
DMM165XX_Files_vbap.csv
.

16. Click .

17. Click .

64
DMM165

Explanation Screenshot

18. Click .

19. Click .

20. Click .

65
DMM165

Explanation Screenshot

21. Click .

22. Drag .

23. Drop on .

24. Click .

25. Drag .

26. Drop on .

27. Double-click on

28. Click .

29. Click .

66
DMM165

Explanation Screenshot

30. Click .

31. Click .

32. Click .

33. Click .

34. Click .

35. Click .

67
DMM165

Explanation Screenshot

36. Click .

37. Click .

38. Click .

39. Double-click on

40. Click .

68
DMM165

Explanation Screenshot

41. Click .

42. Click .

43. Click .

44. Click .

45. Click .

46. Click .

69
DMM165

Explanation Screenshot

47. Click .

48. Click .

49. Click .

50. Click .

70
DMM165

Explanation Screenshot

51. Click .

52. Click .

71
DMM165

Explanation Screenshot

53. Click .

54. Drag .

55. Drop on .

56. Click .

57. Drag .

58. Drop on .

59. Double-click on

60. Click .

72
DMM165

Explanation Screenshot

61. Click .

62. Click .

63. Click .

64. Click .

65. Enter NETWR_ITEM in the


Name box.

66. Click .

67. Click .

73
DMM165

Explanation Screenshot

68. Click
.

69. Enter WAERK_ITEM in the


Name box.

70. Click .

71. Enter
"Join1_Input1"."Mandt"="Join1_In
put2"."Mandt" And in the Join
Condition box.

72. Enter
"Join1_Input1"."VBELN"="Join1_In
put2"."VBELN" in the Join
Condition box.

73. Click .

74. Click .

74
DMM165

Explanation Screenshot

75. Click
.

76. Click .

77. Click .

78. Drag .

79. Drop on .

80. Double-click on .

81. Enter SALES_ORDERS in the


box.

82. Click the


button to open a dropdown list.

75
DMM165

Explanation Screenshot

83. Select the entry


DMM165_XX

by clicking it.

84. Click .

85. Click .

86. Click .

87. Click [M42] SAP HANA:


Catalog .

76
DMM165

Explanation Screenshot

88. Click .

89. Click
DMM165_XX .

90. Click .

Here you can see that the


SALES_ORDERS table was
created.

77
DMM165

Explanation Screenshot

91. Click .

92. Enter select * from


DMM165_XX."DMM165XX_Files_v
bak.csv; in the SQL Editor.

93. Enter select * from


DMM165_XX."DMM165XX_Files_v
bap.csv; in the SQL Editor.

94. Enter select * from


DMM165_XX.SALES_ORDERS
order by MANDT, VBELN,
POSNR; in the SQL Editorbox.

95. Click .

Here you can see records from


the VBAK table, which contains
sales header information.

96. Click .

78
DMM165

Explanation Screenshot

Here you can see records from


the VBAP table, which contains
sales item information.

97. Click .

Here you can see records from


the SALES_ORDER table, which
contains sales header and sales
item information.

7.3. Summary
You have completed the exercise!

You are now able to:


 Take data from multiple external data sources, join them and load them in a single table in HANA.

79
DMM165

8. Copyright
© 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.

80