Sie sind auf Seite 1von 143

Contents

1. IMPLEMENTING ATTRIBUTE VIEW WITH CUSTOMER ......................................................................................2


2. IMPLEMENTING ATTRIBUTE VIEW WITH MATERIAL ..................................................................................... 15
3. IMPLEMENTING ATTRIBUTE VIEW WITH COMPANY CODE ........................................................................... 25
4. IMPLEMENTING CUSTOMER ATTRIBUTE VIEW OF TYPE SHIPTOPARTY (DERIVED VIEW) ........................... 35
5. IMPLEMENTING ATTRIBUTE VIEW OF TYPE BILLTOPARTY USING COPY OF BASE ....................................... 44
6. IMPLEMENTING TIME ATTRIBUTE VIEW WITH GREGORIAN CALENDAR ...................................................... 51
7. IMPLEMENTING TIME ATTRIBUTE VIEW WITH FISCAL CALENDER................................................................ 57
8. IMPLEMENTING ATTRIBUTE VIEWS BY USING DESIGN TIME FILTERS .......................................................... 62
9. IMPLEMENTINGCALCULATED COLUMN INSIDE A ATTRIBUTE VIEW ............................................................ 79
9.a. IMPLEMENTING CALCULATED COLUMNS ..................................................................................................... 90
I0. IMPLEMENTING JOIN ENGINE IN ATTRIBUTE VIEW .................................................................................... 108
11. IMPLEMENTING ATTRIBUTE VIEW WITH TEXT JOIN................................................................................ 119
12. IMPLEMENTING ATTRIBUTE VIEW WITH INNER JOIN ................................................................................ 133

1
1. IMPLEMENTING ATTRIBUTE VIEW WITH CUSTOMER

Attribute view:

 Attribute views are dimensions


 Attribute views are used to join to a dimension or attribute view.
 In most cases used to model master data like entities (like product, employee, business partner)
 Highly re-used and shared in analytic- and calculation views

How to create attribute view with customer:

Go to remote desktop connection<start<click on saphana studio

How to create a package:

Expand best system<right click on content<new<click on package

2
Provide name<provide description<click ok

How to create a sub package:

Right click on package<new<click on package

3
Provide name as SD <provide description <click ok

How to create an attribute view:

4
Right click on sub package<new<click on attribute view

Provide name AT_CUSTOMER<provide label<select subtype as standard <click finish

Click on plus icon to add objects

5
Search for table KNA1<click on table<click ok

Select required output columns

6
Again click on plus icon<enter table T005T<click ok

Connect KNA1 LAND1 to T005T LAND1 to get output as LANDX <select LANDX as output
coloumn

Join type as text join<language as SPRAS

Text join:text join is used to fetch the description based on user's session language. Once we
implement the text join in sap hana, it automatically finds out user's language and gives
description in that language.

7
Again click on plus object<select T005U table<click ok

Join KNA1 LAND1 to T005U LAND1 because regions are specified with country

Join type as text join <language as SPRAS

8
Join KNA1 REGIO to T005U BLAND<select output coloumn as BEZEI

Join type as text join <language as SPRAS

9
Click on semantics<select key attribute as KUNNR

Key attributes:

Key attribute is a kind of primary key for the attribute view. But, it doesn’t prevent the

Passage of duplicate values. It is basically needed to determine the join execution order

At the run time when multiple tables are used in an attribute view.

In attribute views there is one mandatory step. Whatever keys in the table one key?

We need to define inside an attribute view

Provide label mapping

Label mapping:

We can choose to associate an attribute with another attribute description. Label

Mapping is also called as description mapping. For example if a1 has a label column

B1, then you can rename b1 to a1.description. The related columns appear side by

Side during data preview

10
Click save and validate<click save and activate

<assign an object<click finish

Use of assign object: in the select change dialog, either create a new id or select an
existing change id that you want to use to assign your change

11
Click on data preview

Click raw data<to get output

12
Output in different language:

Go to best system<right click on system<click on properties

Click additional properties<select locale<click apply<click ok

13
Click save and validate<click save and activate<click on data preview<click on raw data

14
2. IMPLEMENTING ATTRIBUTE VIEW WITH MATERIAL

Attribute view:

 Attribute views are dimensions, BW characteristics or master data.


 Attribute views are used to join to a dimension or attribute view.
 In most cases used to model master data like entities (like product, employee, business partner)
 Highly re-used and shared in analytic- and calculation views

How to create attribute view with customer:

Go to remote desktop connection<start<click on saphana studio

How to create an attribute view:

Right click on sub package<new<click on attribute view

15
Provide name AT_MATERIAL<provide label<select subtype as standard <click finish

Click on plus icon<select objects

16
Select table MARA<click ok

Select required output columns

17
Again click on plus icon <add table MAKT<click ok

Join MARA MATNR to MAKT MATNR

Join type as text join<language coloumn as spras


18
Join type:

Text join: text join is used to fetch the description based on user's session language. Once we
implement the text join in sap hana, it automatically finds out user's language and gives
description in that language.

Select MAKTX as output coloumn

19
Click on semantics<provide MATNR as key attribute

Key attribute is a kind of primary key for the attribute view. But, it doesn’t prevent the passage of
duplicate values. It is basically needed to determine the join execution order at the run time when
multiple tables are used in an attribute view.
In attribute views there is one mandatory step. Whatever keys in the table one key we need to
define inside an attribute view

Provide label mapping

20
Label mapping:

We can choose to associate an attribute with another attribute description. Label

Mapping is also called as description mapping. For example if a1 has a label column

B1, then you can rename b1 to a1.description. The related columns appear side by

Side during data preview

Click save and validate<click save and activate

21
<assign an object<click finish

Use of assign object: in the select change dialog, either create a new id or select an
existing change id that you want to use to assign your change

Click on data preview

22
Click on raw data<to get output

Output in different language:


Go to best system<right click on system<click on properties

23
Click additional properties<select locale<click apply<click ok

Click save and validate<click save and activate<click on data preview<click on raw data

24
3. IMPLEMENTING ATTRIBUTE VIEW WITH COMPANY CODE
Attribute view:
Attribute views are dimensions, master data.
Attribute views are used to join to a dimension or attribute view.
In most cases used to model master data like entities (like product, employee, business partner)
Highly re-used and shared in analytic- and calculation views

Go to remote desktop connection<start<click on Sap Hana studio

25
Right click on sub package<new<click on attribute view

26
Provide name as AT_COMPANY CODE<provide label<click finish

Click on plus icon add objects

27
Select T001 table

Select required output columns

Again Click plus icon<add TVKO table<click ok

28
Join T001 BUKRS to TVKO BUKRS<join type as inner join <select required output columns

Again click on plus icon<add TVKOT table<click ok

29
Join TVKO VKORG to join TVKOT VKORG<join type as text join<language as SPRAS<<select
VTEXT

Again click on plus icon<select TCURT table<click ok

30
Join T001 WAERS to TCURT WAERS<select ltext<join type as text join<language as SPRAS

Click on semantics<select BUKRS as key column

31
Provide descriptive mapping:

We can choose to associate an attribute with another attribute description. Label

Mapping is also called as description mapping. For example if a1 has a label column

B1, then you can rename b1 to a1.description. The related columns appear side by Side during
data preview

Click save and validate<click save and activate

Assign an object to change<click finish

32
Open data preview <click on raw data

Output in different language:

Go to best system<right click on system<click on properties

33
ck additional properties<select locale<click apply<click ok

Click save and validate<click save and activate<click on data preview<click on raw data

34
4. IMPLEMENTING CUSTOMER ATTRIBUTE VIEW OF TYPE
SHIPTOPARTY (DERIVED VIEW)
Derived attribute view:

In some business cases, it is required to use the same attribute view more than once. (Example:
Two logical join of different join types but defined on the same attribute view.)
Another example, Sales table has 3 dates i.e. Sales_Open_Date, sales_Closed_Date,
Sales_Begin_Date. All these columns should be joined with the date attribute view separately
In such cases, one can derive an attribute view using the base view which acts as reference to the
base attribute view. The derived attribute view will be opened in the read only mode. The only
Editable field will be its description.

The derived attribute view will act as a reference to its base attribute view.

How to create a derived attribute view:

Go to remote desktop connection<start<click on saphana studio

35
Expand package< Right click on sub package<click new<click attribute view

Provide name<provide label<select sub type as derived

36
Click on browse<expand package<expand sub package<expand attribute views<click base
attribute view customer<click ok

Click finish

37
In customer view the color will be like this

In customer SHIPTOPARTY the color will be like this

38
It means derived view is in display mode we cannot change the object

We cannot change any join type. Everything is in display

Click on semantics<click on view properties

Only we can change the description except this we cannot do any changes in derived view

39
If we want see more properties:

Click on data foundation<click on free space<properties<we can see engine as join <base attribute
view

This view will change only when base attribute view will be change

Go to AT_CUSTOMER VIEW<click on name2

40
Save and validate<save and activate

Click on Open data preview<click raw data

41
We can see same output in SHIPTOPARTY

Go to AT_SHIPTOPARTY view

<save and activate<save and validate<click on data preview<click rawdata

42
Output in different language:

Go to best system<right click on system<click on properties

Click additional properties<select locale<click apply<click ok

43
Click save and validate<click save and activate<click on data preview<click on raw data

5. IMPLEMENTING ATTRIBUTE VIEW OF TYPE BILLTOPARTY USING


COPY OF BASE
Attribute view:

44
 Attribute views are dimensions, BW characteristics or master data.
 Attribute views are used to join to a dimension or attribute view.
 In most cases used to model master data like entities (like product, employee, business partner)
 Highly re-used and shared in analytic- and calculation views

BILLTOPARTY: It is copy of base view. Copy we can take as a template


We can change
Copy from only standard attribute view

How to create billtoparty attribute view with customer:

Go to remote desktop connection<start<click on saphana studio

Right click on sub package<new<click on attribute view

45
Provide name AT_BILLTOPARTY<provide label<Click copy from<browse

Go to package<expand sub package<select view AT_CUSTOMER<click ok

46
Click finish

47
Click save and validate<click save and activate

48
<assign an object<click finish

Use of assign object: in the select change dialog, either create a new id or select an
existing change id that you want to use to assign your change

Click on data preview<click on raw data

49
Output in different language:

Go to best system<right click on system<click on properties

Click additional properties<select locale<click apply<click ok

50
Click save and validate<click save and activate<click on data preview<click on raw data

6. IMPLEMENTING TIME ATTRIBUTE VIEW WITH GREGORIAN


CALENDAR
Time attribute view:

Time attribute is based on time period. For e.g. you have a date filed in your views and you want
to calculate the aging (no of years) based on the date field’s they this calculated attribute you can
call as time attribute.

In general, the time attribute view would normally be created based on time dimension table
(_SYS_BI.M_TIME_DIMENSION)

Fiscal calendar table (_SYS_BI.M_FISCAL_CALENDAR)

Creating time attribute view with Gregorian calendar:

Go to remote desktop connection<start<click on saphana studio

51
How to create an attribute view:

Right click on sub package<new<click on attribute view

Provide name AT_TIME<provide label<select sub type as time<choose calendar type as


Gregorian<select granularity as date<click finish
52
Using 'generate time data' option, the sys table (_SYS_BI.M_TIME_DIMENSION are loaded with
data for the period entered.

53
Click on semantics<select DATE_SQL as key coloumn

Key attribute is a kind of primary key for the attribute view. But, it doesn’t prevent the

Passage of duplicate values. It is basically needed to determine the join execution

Order at the run time when multiple tables are used in an attribute view.

In attribute views there is one mandatory step. Whatever keys in the table one key we need to
define inside an attribute view

54
Click save and validate<click save and activate

<assign an object<click finish

Use of assign object: in the select change dialog, either create a new id or select

An existing change id that you want to use to assign your change

55
Click on data preview

Click on raw data<to get output

56
7. IMPLEMENTING TIME ATTRIBUTE VIEW WITH FISCAL CALENDER

Time attribute view:

Time attribute is based on time period. For e.g. you have a date filed in your views and you want
to calculate the aging (no of years) based on the date field’s they this calculated attribute you can
call as time attribute.

In general, the time attribute view would normally be created based on time dimension table
(_SYS_BI.M_TIME_DIMENSION)

Fiscal calendar table (_SYS_BI.M_FISCAL_CALENDAR)

Creating time attribute view with fiscal calendar:

Go to remote desktop connection<start<click on saphana studio

57
How to create an attribute view:

Right click on sub package<new<click on attribute view

Provide name at time<provide label<select sub type as time<choose calendar type as fiscal<select
variant schema<select variant<click finish

58
Using 'generate time data' option, the sys (_SYS_BI.M_FISCAL_CALENDAR) table are loaded
with data for the period entered.

59
Click on semantics<select DATE_SQL as key coloumn

Key attribute is a kind of primary key for the attribute view. But, it doesn’t prevent the

Passage of duplicate values. It is basically needed to determine the join execution

Order at the run time when multiple tables are used in an attribute view.

In attribute views there is one mandatory step. Whatever keys in the table one

Key we need to define inside an attribute view

Click save and validate<click save and activate

60
<assign an object<click finish

Use of assign object: in the select change dialog, either create a new id or select

An existing change id that you want to use to assign your change

Click on data preview

61
Click on raw data<to get output

8. IMPLEMENTING ATTRIBUTE VIEWS BY USING DESIGN TIME


FILTERS
Design Time Filter:

Filters are expressions which limit the data that is retrieved. For instance you can restrict the data

62
Retrieved based on the date or SAP client using filter expressions

Go to remote desktop connection<start<click on SAPHANA studio

How to create a package:

Expand best system<right click on content<new<click on package

63
Provide name<provide description<click ok

How to create a sub package:

Right click on package<new<click on package

64
Provide name as SD <provide description <click ok

How to create an attribute view:

Right click on sub package<new<click on attribute view

65
Provide name AT_CUSTOMER<provide label<select subtype as standard <click finish

66
Click on plus icon to add objects

Search for table KNA1<click on table<click ok

Select the required outputs

67
Again click on plus icon<enter table T005T<click ok

Connect KNA1 LAND1 to T005T LAND1 to get output as LANDX <select LANDX as output
column

Join type as text join<language as SPRAS

Text join: text join is used to fetch the description based on user's session language. Once we
implement the text join in sap hana, it automatically finds out user's language and gives description
in that language.

68
Again click on plus object<select T005U table<click ok

69
Join KNA1 LAND1 to T005U LAND1 because regions are specified with country

Join type as text join <language as SPRAS

Join KNA1 REGIO to T005U BLAND<select output column as BEZEI

Join type as text join <language as SPRAS

70
71
Click on semantics<select key attribute as KUNNR

Key attributes:

Key attribute is a kind of primary key for the attribute view. But, it doesn’t prevent the
Passage of duplicate values. It is basically needed to determine the join execution order
At the run time when multiple tables are used in an attribute view.

In attribute views there is one mandatory step. Whatever keys in the table one key?
We need to define inside an attribute view

72
Provide label mapping

Label mapping:

We can choose to associate an attribute with another attribute description. Label

Mapping is also called as description mapping. For example if a1 has a label

column B1, then you can rename b1 to a1.description. The related columns appear

side by Side during data preview

Click save and validate<click save and activate

73
Click on data preview

74
Click raw data<to get output

Now we are applying design time filters:

We want to see customers only belong to US country then we create a design time filter

Go to view < apply filter on LAND1 < Right Click on LAND < Apply Filter

75
Select operator

Select value as US<Click ok

76
Click ok

Save and activate<save and validate

77
<click data preview<click raw data

78
9. IMPLEMENTINGCALCULATED COLUMN INSIDE A ATTRIBUTE
VIEW
Calculated Column:
It is an additional column which can be created by us, the results of which are calculated at
runtime based on the existing column and using functions, input parameters and constants.

Go to remote desktop connection<start<click on saphana studio

Right click on sub package<new<click on attribute view

79
Provide name as AT_COMPANY CODE<provide label<click finish

Click on plus icon add objects

80
Select T001 table

Select required output columns

81
Again Click plus icon<add TVKO table<click ok

Join T001 BUKRS to TVKO BUKRS<join type as inner join <select required output columns

82
Again click on plus icon<add TVKOT table<click ok

Join TVKO VKORG to join TVKOT VKORG<join type as text join<language as spras<<select
vtext

83
Again click on plus icon<select TCURT table<click ok

Join T001 WAERS to TCURT WAERS<select LTEXT<join type as text join<language as spras

84
Click on semantics<select BUKRS as key column

Provide descriptive mapping:

We can choose to associate an attribute with another attribute description. Label

Mapping is also called as description mapping. For example if a1 has a label column

B1, then you can rename b1 to a1.description. The related columns appear side by Side during
data preview

85
Click save and validate<click save and activate

Assign a object to change<click finish

Open data preview <click on raw data

86
Right click on calculated columns<click new

Provide name<provide label<provide length

Enter expression<click on columns <select required columns

87
Here
we can see various functions available categorized into different sections like

 Conversion Functions
 String Functions
 Mathematical Functions
 Date Functions
 Misc Functions

Click on validate syntax<click ok

88
Click ok

Save and validate<save and activate

Click on data preview<click on raw data

89
By this we can say that calculated columns are very useful in SAP HANA and has good amount of
functions that can be used to build the same. If we need any help on the syntax of the function or
how different functions works, we can use the symbol ‘’ in calculated column editor screen

9.a. IMPLEMENTING CALCULATED COLUMNS

Calculated columns are the additional information we create based on the existing columns
available at data base level.

If we create calculated column at attribute level, that is going to act as just as attribute

If we create a calculated column at either analytic view or at calculation view, then we can choose
whether it should act as an attribute view or as a measure.

Let us create an attribute view: package<-new<-attribute view

90
Provide the details and click on finish

91
Click on + icon at data foundation<-type in KNA1<-select KNA1 (BEST) <-click on ok

92
Click on + icon<-type in T005T<-select T005T (BEST) <-click on ok

93
Click on + icon at data foundation<-type in T005U<-select T005U (BEST) <-click on ok

94
Now, you have to select the required columns from these tables

95
Select KUNNR, LAND1, NAME1 and REGIO in KNA1 table; select LANDX in T005T table;
select BEZEI in T005U table

96
Link a join between LAND1 (KNA1) and LAND1 (T005T); Link a join between LAND1 (KNA1)
and LAND1 (T005U); Link a join between REGIO (KNA1) and BLAND (T005U)

97
Make sure all the join types are text join and language column is SPRAS<-click on semantics

98
Let us do descriptive mapping between (KUNNR, NAME1); (LAND1, LANDX) and (REGIO,
BEZEI)<-select KUNNR as key attribute

99
Save and validate<-save and activate

Assign objects to a change and click finish

Job log shows “activation completed successfully”

100
Click data preview

101
View the output data by clicking on raw data

Go back to data foundation<- right click on calculated columns<-new

102
Provide name, label, data type, length<-type in “KUNNR”+‘–’+“NAME1”<-click on validate
syntax

Expression is valid<-click ok

103
Click ok

104
Now, we can see that the calculated column “KUNNR_NAME1” has been created

Save and validate<-save and activate

105
Activation completed successfully

Click data preview

106
Click raw data<- Now, you can see that the column “KUNNR_NAME1” has been created and we
can view the data in that column

107
I0. IMPLEMENTING JOIN ENGINE IN ATTRIBUTE VIEW
Join engine:

 This engine is used when we execute any Attribute View in HANA or run native SQL on more
than one table with join condition.
 If there are any calculations involved either in Attribute View or in native SQL then Join Engine
will use Calculation Engine for calculations or fetch the result.

How to create attribute view with customer:

Go to remote desktop connection<start<click on saphana studio

108
Right click on sub package<new<click on attribute view

Provide name AT_CUSTOMER<provide label<select subtype as standard <click finish

109
Click on plus icon to add objects

Search for table KNA1<click on table<click ok

110
Select required output columns

Again click on plus icon<enter table T005T<click ok

Connect kna1 land1 to T005T LAND1 to get output as LANDX <select LANDX as output column

111
Join type as text join<language as SPRAS

Again click on plus object<select T005U table<click ok

Join KNA1 LAND1 to T005U LAND1 because regions are specified with country

112
Join type as text join <language as SPRAS

Join KNA1 REGIO to T005U BLAND<select output column as BEZEI

Join type as text join <language as SPRAS

Click on data foundation<click on free space<properties<column engine is join engine

113
Click on semantics<select key attribute as kunnr

114
Provide label mapping

Click save and validate<click save and activate

<assign an object<click finish


115
Click on data preview

Click raw data<to get output

116
Output in different language:

Go to best system<right click on system<click on properties

117
Click additional properties<select locale<click apply<click ok

Click save and validate<click save and activate<click on data preview<click on raw data

118
11. IMPLEMENTING ATTRIBUTE VIEW WITH TEXT JOIN

Attribute view:

 Attribute views are dimensions used to join master data.


 Master data is a data which is not going to change frequently.

TEXT JOIN:

 A text join is used to obtain language-specific description. It retrieves the descriptions for a
column from a text table based on the user’s session language. The text tables contain
description for a column value in different languages.
 Go to remote desktop connection
 Click all programs<-select hana studio
 We can use text join in three different models
 Attribute views
 Analytic views
 Calculation views

click on start<type mstsc<click on mstsc

119
Enter ip address and click connect

Click on start<click on SAP HANA studio

120
How to create a package:

Expand best system<right click on content<new<click on package

Provide name<provide description<click ok

121
How to create a sub package:

Right click on package<new<click on package

Enter sub package name and description and click ok

122
Create another sub package and click ok

Create another sub package SD and click ok

123
Right click on sub package<new<attribute view

Provide name AT_CUSTOMER<provide label<select subtype as standard <click finish

124
Click on data foundation plus icon to add objects

Search for table KNA1 (BEST) <click on table<click ok

125
Select required fields for output

Again click on Data foundation plus icon<enter table T005T<click ok

126
Connect KNA1 LAND1 to T005T LAND1 to get output <select LANDX as output column

Join type as TEXT JOIN<language as SPRAS


Text join: Text join is a join which gives description based on user session.

Again click on plus icon<select T005U table<click ok

127
Join KNA1 LAND1 to T005U LAND1 because regions are specified with country

Join type as TEXT JOIN <language as SPRAS

Join KNA1 REGIO to T005U bland<select output coloumn as BEZEI

Join type as TEXT JOIN <language as SPRAS

128
Click on semantics<select key attribute as KUNNR

Key attributes:
 Key attribute is a kind of primary key for the attribute view. But, it doesn’t prevent the
Passage of duplicate values.
 It is basically needed to determine the join execution order at the run time when multiple
tables are used in an attribute view.
 In attribute views there is one mandatory step. Whatever keys in the table one key we need
to define inside an attribute view.

Label mapping:
We can choose to associate an attribute with another attribute description.
Label mapping is also called as description mapping.
129
Click save and validate<click save and activate

<assign object to change<click New

130
<create an object<click ok

<select the change<click finish

131
Click on data preview

Click on raw data

132
12. IMPLEMENTING ATTRIBUTE VIEW WITH INNER JOIN

Attribute view:

 Attribute views are dimensions used to join master data.


 Master data is a data which is not going to change frequently.

Inner Join:
 The inner join select the records that match in both the tables
 Inner join should be used if referential integrity is ensured.
 Inner Join is much faster that Outer Join thus is the preferred solution if possible from
semantically perspective.
 Inner Joins can be used to join different master data tables to a joint dimension Analytical
Views.
 Inner Joins can be used if referential integrity cannot be ensured

Right click on calculation view<click new

133
Provide name as AT_INNER_JOIN and click finish

Click on data foundation + icon to add table

134
Select T001 table and click ok

Again click on data foundation +icon to add TVKO table

135
Select TVKO and click ok

Again click on data foundation +icon to add TVKOT table

136
Select TVKOT table and click ok

Again click on data foundation + icon to add TCURT table

137
Select TCURT table and click ok

138
Define relationship between TVKO BUKRS to T001 BUKRS and provide join type as Inner

Inner Join:
 The inner join select the records that match in both the tables
 Inner join should be used if referential integrity is ensured.
 Inner Join is much faster that Outer Join thus is the preferred solution if possible from
semantically perspective.
 Inner Joins can be used to join different master data tables to a joint dimension Analytical
Views.
 Inner Joins can be used if referential integrity cannot be ensured

Define relationship between TVKO VKORG TO TVKOT VKORG and provide join type as Text
join

139
Define relationship between T001 WEARS TO TCURT WEARS and provide join type as Text
join

Select fields for output

Select BUKRS as key attribute

140
Select label columns

Click on save and validate<save and activate

141
Assign objects for a change

Click on data preview

142
Click on raw data

143

Das könnte Ihnen auch gefallen