Вы находитесь на странице: 1из 26

Table Analysis (TAANA) - Usage for Filters in SAP Event Management transactional

Applications (Fiori)

Author: Marco Freischlag


Document Date: 27.01.2016

Contents
Documents ............................................................................................................................................. 3
Summary ................................................................................................................................................ 4
Pre-requisites ........................................................................................................................................ 5
Overview Filter Filter Value and Filter Description retrieval........................................................ 5
Supported Parameter Types for TAANA based Filter ..................................................................... 7
TAANA delivered Analysis for Freight Order Visibility App ODT40_TO Scenario...................... 8
Set up TAANA for SAP delivered Filter based on TAANA ............................................................. 9
Filter Values for System Parameter used in Filter: ...................................................................... 9
Filter Values for Expected Event Parameter used in Filter: ....................................................... 9
How-To set up TAANA for Freight Order Visibility App for custom Parameter ......................... 10
How to setup a Control Parameter as Filter ............................................................................... 11
How to setup an Event Message Header Parameter as Filter ................................................ 16
Test Filter setup with the EM ODATA Service ............................................................................... 22
TAANA Warnings displayed on the Freight Order Visibility App UI ............................................ 25
Table of Figures .................................................................................................................................. 26

Documents
TAANA Table Analysis
SAP Help

http://help.sap.com/erp2005_ehp_07/helpdata/en/4d/9c347
69be813fde10000000a42189c/frameset.htm

SAP NOTE

2034063 - Deletion of old table analyses in the background

SAP NOTE

1976948 - SAP TM EM Integration Guide Updates

How to Generate your own


Transactional Fiori Apps

http://scn.sap.com/docs/DOC-65175

Summary
In the SAP Event Management transactional Freight Oder Visibility app it is possible to use
pre-defined filters for querying data from the SAP EM backend system. Some of these values
are directly extracted from the SAP EM tables which are relevant for the ODT40_TO visibility
scenario. To offer a solution to customers that can be used on SAP HANA and Any DB
systems, SAP TAANA (Table Analyses) was selected to perform analyses and aggregate the
relevant data to retrieve the pre-analyzed distinct values.
This guide focuses on filter values which are based on SAP TAANA. No other non TAANA
based filter values like Status Parameter, Parameter Value Sets etc. are covered.

Figure 1 Freight Order Visibility App Open Filter Control

Figure 2 Freight Order Visibility App Filter Control

Pre-requisites
-

SAP Event Management Release SAP EM 9.2 SP01 or higher.


Make sure the ODT40_TO visibility scenario has been set up properly. For more
information see SAP Note 1976948 - SAP TM EM Integration Guide Updates
To use a Configured Field as a Filter, it must be setup as a Selection Profile Item and
the Usage Type must be set to Drill-down/Filter (TA /SAPTRX/UCUP5)

Overview Filter Filter Value and Filter Description retrieval


When using a Drill-down/Filter as a filter for which filter values must be retrieved from the
backend system for a specific configured field, depending on the semantics or the configured
field itself, the following logic is used to retrieve these values and descriptions:
1. BAdI /SAPTRX/BADI_ODATA_FO Method GET_FACET_FILTER:
Customers can implement their own logic for retrieving filter values and the
description. If the table CT_OD_FACET_FILTER after the method call is filled the
standard logic is skipped.
A sample implementation for Event Status is available. For the Event Status the
values and description from domain /SAPTRX/EE_STATUS are used.
2. Semantics of a Configured Field is defined as timezone:
Filter values for Timezones and Timezone descriptions are retrieved from table ttzz
and ttzzt
5

3. Semantics of a Configured Field is defined as timestamp or date:


The Domain values and description are used from domain
/SAPTRX/OD_FACET_FILTER_DATE
4. Configured Field is referencing to a EM Attribute which is a Status Attribute:
The Status Attribute Values and description from the Status Attribute are retrieved.
5. Value Set defined for Parameter:
If a value set has been defined for Control, Info or System Parameter the parameter
value and description is returned for the corresponding configured field.
6. Filter values from Table Analysis (TAANA):
If none of the above applies, SAP TAANA is called to retrieve the values for the filter.
Therefore maintain in the customizing of the configured field for selection the TAANA
View and TAANA variant to be used for the data retrieval.
From TAANA only the filter values are retrieved therefore the filter description must
be retrieved separately. Use BAdI /SAPTRX/BADI_ODATA_FO Method
GET_FACET_FILTER_DESC to get the corresponding filter description for the
already retrieved filter values.
In method GET_FACET_FILTER_DESC you find various sample implementations
which are used for the Freight Order Visibility app.
For example Business Partner and Location descriptions are retrieved from the
corresponding Master Data System which is defined in the Event Handler Type
Customizing. Therefore the Application System which links to the Master Data
System must be specified in the Event Handler Type.
As a fallback the filter description always gets the filter value if no description is
assigned.
For how to setup TAANA see SAP Help:
http://help.sap.com/erp2005_ehp_07/helpdata/en/4d/9c34769be813fde10000000a42
189c/frameset.htm
Also see SAP Note: 2034063 - Deletion of old table analyses in the background

Supported Parameter Types for TAANA based Filter


Parameter
Type
EH Extension

Supported

ODT40_TO
Shipment

TAANA View/Table

Yes

Yes

/SAPTRX/V_ODTTO,
Customer

EH Control

Yes

No

Customer

EH Info

Yes

No

Customer

Expected
Event
Parameter
Event
Extension
Parameter
Event Handler
TRKID
Parameter
Event
Message
Header

Yes

Yes

/SAPTRX/V_H_EXP,
Customer

Yes

No

Customer

Yes

No

Customer

Yes

No

Customer

UCCF Cust:
View/Table and Variant
Required, specify view
in uccf, Variant not
supported
Required, specify view
and variant in uccf
Required, specify view
and variant in uccf
Required, specify view
in uccf, Variant not
supported
Required, specify view
in uccf, Variant not
supported
Required, specify view
in uccf, Variant not
supported
Required, specify view
in uccf, Variant not
supported

TAANA Method
select_single_complex

select_single_complex
select_single_complex
select_single_complex

select_single_complex

select_single_complex

select_single_complex

Table 1 Supported Parameter Types for TAANA based Filters

TAANA delivered Analysis for Freight Order Visibility App ODT40_TO Scenario
Table/View

Parameter

Variant

/SAPTRX/V_ODTTO

ODT40_TO_TSP_I
ODT40_TO_TRMOD
ODT40_TO_TRMODCAT
ODT40_TO_SHIPPING_TYPE
ODT40_TO_SOU_LOC_I
ODT40_TO_SOU_LOC_CITY
ODT40_TO_SOU_LOC_COUNTRY
ODT40_TO_DESTLOC_I
ODT40_TO_DEST_LOC_CITY
ODT40_TO_DEST_LOC_COUNTRY

ODT40_EH_EXTENSION

/SAPTRX/V_H_EXP

LOC_ID_1
COUNTRY

ODT40_LOCATION

/SAPTRX/V_H_EXP

EVENT_CODE

ODT40_ EVENT_CODE

Table 2 TAANA delivered Analysis for Freight Order Visibility App ODT40_TO Scenario

Note: For the retrieval of the filter description for Carrier (ODT40_TO_TSP_I) a wrapper for
BAPI_LOCSRVAPS_GETLIST2 is available for SAP TM 9.20 or higher. When using Filter or
Business Partner descriptions do not call BAPI_LOCSRVAPS_GETLIST2 in a separate
RFC call for each BP as this would lead to performance problems.
In the View /SAPTRX/V_ODTTO, the field EH_TYPE is not a key field. In TAANA table
analysis only key fields can be used for data selection filters. If this is required a new view
has to be created containing the corresponding fields in the table key.

Set up TAANA for SAP delivered Filter based on TAANA


Schedule TAANA Analysis for Visibility Scenario ODT40_TO:
- Run TA TAANA

Filter Values for System Parameter used in Filter:


-

Run Table Analysis (F8)


Select Table Name: /SAPTRX/ODTTO
Variant: ODT_40_COLLECT
Choose Processing Options
Enter Run the Analysis

Filter Values for Expected Event Parameter used in Filter:


- Run Table Analysis (F8)
- Select Table Name: /SAPTRX/V_H_EXP
- Variant: ODT_40_COLLECT
- Choose Processing Options
- Enter Run the Analysis

Hint: To ensure that you only get the TAANA values for parameters which correlate to active
Event Handlers, schedule the table analysis and use Field Selection and specify Active = X
to get only values for active Event Handlers.
Hint: To make sure that the Filter values are updated, schedule the TAANA analysis runs
daily. In setting up the table analysis, choose the Processing Options In the Background
and set up a daily job for the analysis run.
To regulate the space of the table analyses used on the database, it is recommended to
setup a reorganization of the table analysis transaction taana Utilities Reorganize
Analysis.
Also consider SAP Note: 2034063 - Deletion of old table analyses in the background

How-To set up TAANA for Freight Order Visibility App for custom Parameter
Pre-requisite: View Component EH_TYPE available
Parameter Type
EH Extension

View Join Tables


/SAPTRX/EH_HDR
EH Extension Table

EH Control

/SAPTRX/EH_HDR
/SAPTRX/EH_CNTR

EH Info

/SAPTRX/EH_HDR
/SAPTRX/EH_INFO

Expected Event
Parameter

/SAPTRX/EH_HDR
/SAPTRX/EH_EXPEV

Event Extension
Parameter

/SAPTRX/EH_HDR
EV Extension Table

Event Handler
TRKID Parameter

/SAPTRX/EH_HDR
/SAPTRX/EH_TRKID

Event Message
Header

/SAPTRX/EH_HDR
/SAPTRX/EH_EVMSG
/SAPTRX/EVM_HDR

Table 3 Parameter Types - Required EM Tables/Views

If possible set up the TAANA table analysis data selection specify the EH_TYPE used in
the corresponding tracking scenario to limit the TAANA analysis result data.
If this is not possible due to the fact that the TAANA analysis View is required for multiple
tracking scenarios with different EH Types, the filter values are filtered in the coding by the
EH_TYPE which is used in the actual tracking scenario.
When using a Filter within SAP EM in combination with TAANA, specify the TAANA view
name and TAANA analysis variant in the Configured Field customizing for Selection Fields
Tab ODATA Service
Control and Info Parameter:
For this use case you must have a separate analysis variant for each parameter. This is
because the control and info parameters are stored as key values pairs in the DB
PARAM_NAME and PARAM_VALUE. It is not possible to request values for just one
parameter as all parameter values for all available parameters in the system are stored in
PARAM_VALUE.

10

How to setup a Control Parameter as Filter


To bring the new filter into the filter control of the Freight Order Visibility app, two additional
steps are required in the app configuration:
1. Define the new filter in XML View (FilterCategoryDialog.fragment.xml)
This is not covered in this document and will be made available in the whitepaper How to
Generate your own Transactional Fiori Apps.
The following example is based on the assumption that a new filter is required for control
parameter ODT40_TO_EXEC_ORG_ID. The procedure is exactly the same for info
parameters.
Step 1.) DDIC View
Create one DDIC view for the Control Parameter. The view can be re-used within TAANA for
all other required control parameters.
Table Join Conditions:

Figure 3 Table Join Conditions (Control Parameter)

For info parameter join /SAPTRX/EH_HDR and /SAPTRX/EH_INFO.


View Fields:

Figure 4 View Fields (Control Parameter)

11

Step 2.) TAANA Variant


Create a new TAANA variant which contains the fields EH_TYPE and PARAM_VALUE. With
EH_TYPE the values of the analysis can be limited to the values available for example
ODT40_TO Event Handler.
Go to transaction taana Environment Analysis Variants New Entries

Figure 5 New TAANA Variant (Control Parameter)

Hint:
Create a variant for each Control and Info Parameter as the TAANA table and variant is
maintained in the corresponding configured field. TAANA cannot differentiate the parameters
within one variant as on the control and info data table all parameters are stored as
PARAM_NAME and PARAM_VALUE pairs.
Step 3.) TAANA Table Analysis
Start the table analysis. Specify the table/view to be analyzed and the variant created in the
previous step.

Figure 6 Start the table analysis (Control Parameter)

12

In the Data Selection the Parameter for which the values should be retrieved has to be
specified Parameter = ODT40_TO_EXEC_ORG_ID which is the PARAM_NAME on the
DB.
To limit the values for a certain scenario or EH Type specify the Event Handler Type as well
for the selection.

Figure 7 Table Analysis Parameter (Control Parameter)

13

Run the analyses either online or schedule an analysis job which runs periodically. After the
first run of the table analysis the result can be found underneath the analyzed table/view
name and distinct columns can be viewed. These values can now be used when using the
Parameter ODT40_TO_EXEC_ORG_ID as a filter.

Figure 8 Table Analysis Results (Control Parameter)

Step 4.) Configured Field Customizing


Go to transaction /saptrx/uccf Configure Fields for Selection Create a new or adjust an
existing Configured Field.

Figure 9 Control Parameter - Configured Field Customizing (General Data)

On the tab General Data, fill in the required information..


On tab OData Service provide the following information:
- External Field Name: Used as property name for the Configured Field in the
corresponding EventHandlerOverview Entity Type in the Odata Service
- Table/View
- TAANA Variant

Figure 10 Control Parameter - Configured Field Customizing (OData Service)

14

Step 5.) User Profile Customizing


Go to transaction /saptrx/ucup5 and select the selection profile to which the new filter should
be added. Select the Configured Field and select Usage Type Drill-down/ Filter and specify
a Collection ID. The Collection ID is used to construct the OData Entity Type and Entity Set
Name User Profile OData ID + Filter Collection ID e.g.
<EntityType Name="FreightOrderZmfExecOrgId2FctFlt" and
<EntitySet Name="FreightOrderZmfExecOrgId2FctFltS

Figure 11 Selection Profile - Add Configured Field (Control Parameter)

15

How to setup an Event Message Header Parameter as Filter


To bring the new filter into the filter control of the Freight Order Visibility app, two additional
steps are required in the app configuration:
1. Define the new filter in XML View (FilterCategoryDialog.fragment.xml)
This is not covered in this document and will be made available in the SAP Event
Management guide How to Generate your own Transactional Fiori Apps.
The following example is based on the assumption that a new filter is required for Tracking
ID Code Set (TRXCOD).
Step 1.) DDIC View
Create one DDIC View for the Event Message Header Parameter. The view can be re-used
within TAANA for all other required Event Message Header Parameters.
Table Join Conditions:

Figure 12 Table Join Conditions (EVM Header)

For Event Message Header Parameter join /SAPTRX/EH_HDR, /SAPTRX/EH_EVMSG and


/SAPTRX/EVM_HDR.

16

View Fields:

Figure 13 View Fields (EVM Header)

Step 2.) TAANA Variant


Create a new TAANA variant which contains the fields EH_TYPE and TRXCOD. With
EH_TYPE the values of the analysis can be limited to the values available for example
ODT40_TO Event Handler.
Go to transaction taana Environment Analysis Variants New Entries

Figure 14 New TAANA Variant (EVM Header)

Step 3.) TAANA Table Analysis


Start the table analysis. Specify the table/view to be analyzed and variant created in the
previous step.

17

Figure 15 Start the table analysis (EVM Header)

In the Data Selection the analysis result can be limited to the EH Type corresponding to the
tracking scenario.

Figure 16 Table Analysis Parameter (EVM Header)

Run the analyses either online or schedule an analysis job which runs periodically. After the
first run of the table analysis the result can be found underneath the analyzed table/view
name and distinct columns can be viewed. These values can now be used when using the
Tracking ID Code Set Parameter as a filter.
Table analysis result using EH Type in the Data Selection:

18

Figure 17 Table Analysis Results (EVM Header)

Table analysis result not using EH Type in the Data Selection:

Figure 18 Table Analysis Results (EVM Header)

19

Step 4.) Configured Field Customizing


Go to transaction /saptrx/uccf Configure Fields for Selection Create a new or adjust an
existing Configured Field.

Figure 19 EVM Header - Configured Field Customizing (General Data)

On the tab General Data enter the required information.


On tab OData Service provide the following information:
- External Field Name: Used as property name for the Configured Field in the
corresponding EventHandlerOverview Entity Type in the Odata Service
- Table/View
- TAANA Variant

Figure 20 EVM Header - Configured Field Customizing (OData Service)

20

Step 5.) User Profile Customizing


Go to transaction /saptrx/ucup5 and select the selection profile to which the new filter should
be added. Select the Configured Field and select Usage Type Drill-down/ Filter and specify
a Collection ID. The Collection ID isused to construct the OData Entity Type and Entity Set
Name User Profile OData ID + Filter Collection ID for example
<EntityType Name="FreightOrderZMFTrkIdCs1FctFlt" and
<EntitySet Name="FreightOrderZmfExecOrgId2FctFltS

Figure 21 Selection Profile - Add Configured Field (EVM Header)

21

Test Filter setup with the EM ODATA Service


Query EM ODATA Service Metadata:
https://<server>:<port>/sap/opu/odata/saptrx/em_srv/$metadata
For each of the Selection Profile Items with Usage Type Drill-down/Filter a new Entity Type in
the ODATA Service Metadata is generated.

Figure 22 Selection Profile Drill-down/Filter

The Entity Type Name is derived User Profile OData ID and Selection Profile Item
Collection ID:

Figure 23 EM ODATA Metadata EntityType Filter

22

Figure 24 EM ODATA Metadata EntitySet Filter

23

Querying data for the Filter use EntitySet Name:


https://<server>:<port>/sap/opu/odata/saptrx/em_srv/FreightOrderDestLocCountryFltS
When calling the EM ODATA Service for testing purposes in abrowser, request data for each
separate filter. The Identifier tag contains the filter value and the description tag contains the
filter description value.

Figure 25 ODATA Service Data call

24

TAANA Warnings displayed on the Freight Order Visibility App UI


1.) TAANA Last Run older than 24h
sap-message: {"code":"/SAPTRX/MSIO/767","message":"Last TAANA run
20140806121209 Filter values might have outdated
values.","severity":"warning","target":"","details":[]}
2.) TAANA Query does not return any results
sap-message: {"code":"/SAPTRX/MSIO/766","message":"TAANA Query for
ODT40_TO_TRMOD did not return
values.","severity":"warning","target":"","details":[{"code":"/SAPTRX/MSIO/767","m
essage":"Last TAANA run 20140806121209 Filter values might have outdated
values.","target":"","severity":"warning"}]}
3.) No TAANA analysis result for requested parameter does not exist
sap-message: {"code":"/SAPTRX/MSIO/768","message":"Job for TAANA not
scheduled. Retrival of filter values not
possible.","severity":"warning","target":"","details":[{"code":"/SAPTRX/MSIO/767","m
essage":"Last TAANA run 20140806121209 Filter values might have outdated
values.","target":"","severity":"warning"}]}

25

Table of Figures
Figure 1 Freight Order Visibility App Open Filter Control............................................................ 4
Figure 2 Freight Order Visibility App Filter Control....................................................................... 5
Figure 3 Table Join Conditions (Control Parameter)..................................................................... 11
Figure 4 View Fields (Control Parameter) ...................................................................................... 11
Figure 5 New TAANA Variant (Control Parameter) ....................................................................... 12
Figure 6 Start the table analysis (Control Parameter) .................................................................. 12
Figure 7 Table Analysis Parameter (Control Parameter) ............................................................. 13
Figure 8 Table Analysis Results (Control Parameter) .................................................................. 14
Figure 9 Control Parameter - Configured Field Customizing (General Data) ........................... 14
Figure 10 Control Parameter - Configured Field Customizing (OData Service) ....................... 14
Figure 11 Selection Profile - Add Configured Field (Control Parameter) ................................... 15
Figure 12 Table Join Conditions (EVM Header) ............................................................................ 16
Figure 13 View Fields (EVM Header) .............................................................................................. 17
Figure 14 New TAANA Variant (EVM Header) .............................................................................. 17
Figure 15 Start the table analysis (EVM Header) .......................................................................... 18
Figure 16 Table Analysis Parameter (EVM Header) ..................................................................... 18
Figure 17 Table Analysis Results (EVM Header) .......................................................................... 19
Figure 18 Table Analysis Results (EVM Header) .......................................................................... 19
Figure 19 EVM Header - Configured Field Customizing (General Data) ................................... 20
Figure 20 EVM Header - Configured Field Customizing (OData Service)................................. 20
Figure 21 Selection Profile - Add Configured Field (EVM Header)............................................. 21
Figure 22 Selection Profile Drill-down/Filter ................................................................................ 22
Figure 23 EM ODATA Metadata EntityType Filter ..................................................................... 22
Figure 24 EM ODATA Metadata EntitySet Filter ........................................................................ 23
Figure 25 ODATA Service Data call ............................................................................................. 24

26

Вам также может понравиться