fac_cds_fh
Flexible Hierarchy
fac_cds_fh is a CDS View that provides data about "Flexible Hierarchy" in SAP S/4HANA. It reads from 3 data sources (flexhier_dir, hrrp_dir_n, hrrp_typt) and exposes 15 fields with key fields FlexibleHierarchy, HierarchyVersion, ValidityEndDate. It has 2 associations to related views.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| flexhier_dir | flexhier_dir | inner |
| hrrp_dir_n | hrrp_dir_n | from |
| hrrp_typt | hrrp_typt | left_outer |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..*] | fac_cds_fht | _Text | hrrp_dir_n.hryid_42 = _Text.FlexibleHierarchy and hrrp_dir_n.hryvalto = _Text.ValidityEndDate |
| [0..*] | fac_cds_fh_node | _Node | $projection.FlexibleHierarchy = _Node.FlexibleHierarchy and $projection.ValidityEndDate = _Node.ValidityEndDate |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | FACV_FH | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Flexible Hierarchy | view | |
| ObjectModel.usageType.dataClass | #MASTER | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| Search.searchable | true | view | |
| ObjectModel.representativeKey | FlexibleHierarchy | view |
Fields (15)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | FlexibleHierarchy | hrrp_dir_n | hryid_42 | |
| KEY | HierarchyVersion | |||
| KEY | ValidityEndDate | hrrp_dir_n | hryvalto | |
| HierarchyShortID | hrrp_dir_n | hrysid | ||
| ValidityStartDate | hrrp_dir_n | hryvalfrom | ||
| HierarchyType | hrrp_dir_n | hrytyp | ||
| LastChangedByUser | hrrp_dir_n | upduser | ||
| LastChangeTime | hrrp_dir_n | updtime | ||
| CreatedByUser | flexhier_dir | fhcrtnuser | ||
| CreationTime | flexhier_dir | fhcrtntime | ||
| HierarchyRawSequence | flexhier_dir | fhsequence | ||
| HierarchyRawFilter | flexhier_dir | fhfilter | ||
| HierarchyTypeText | hrrp_typt | text | ||
| FlexibleHierarchyName | ||||
| _Node | _Node |
@AbapCatalog.sqlViewName: 'FACV_FH'
//@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
///@AccessControl.authorizationCheck: #CHECK
@AccessControl.privilegedAssociations: [ '_Node' ]
@EndUserText.label: 'Flexible Hierarchy'
@ObjectModel.usageType: {
dataClass: #MASTER,
serviceQuality: #D,
sizeCategory: #XL
}
@Search.searchable: true
@ObjectModel.representativeKey: 'FlexibleHierarchy'
define view fac_cds_fh
as select from hrrp_dir_n
inner join flexhier_dir on hrrp_dir_n.hryid_42 = flexhier_dir.hryid
and hrrp_dir_n.hryvalto = flexhier_dir.hryvalto
and hrrp_dir_n.mandt = flexhier_dir.mandt
and hrrp_dir_n.mandt = $session.client
left outer join hrrp_typt on hrrp_dir_n.hrytyp = hrrp_typt.hrytyp
and hrrp_typt.spras = $session.system_language
association [1..*] to fac_cds_fht as _Text on hrrp_dir_n.hryid_42 = _Text.FlexibleHierarchy
and hrrp_dir_n.hryvalto = _Text.ValidityEndDate
association [0..*] to fac_cds_fh_node as _Node on $projection.FlexibleHierarchy = _Node.FlexibleHierarchy
and $projection.ValidityEndDate = _Node.ValidityEndDate
{
@Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.8 }
//@ObjectModel.text.association: 'FlexibleHierarchyName'
@ObjectModel.text.element: ['FlexibleHierarchyName']
key hrrp_dir_n.hryid_42 as FlexibleHierarchy,
@VDM.lifecycle.status: #DEPRECATED
key cast( '000000000000001' as hryversn preserving type ) as HierarchyVersion,
key hrrp_dir_n.hryvalto as ValidityEndDate,
hrrp_dir_n.hrysid as HierarchyShortID,
hrrp_dir_n.hryvalfrom as ValidityStartDate,
hrrp_dir_n.hrytyp as HierarchyType,
hrrp_dir_n.upduser as LastChangedByUser,
@Consumption.filter.selectionType:#INTERVAL
hrrp_dir_n.updtime as LastChangeTime,
flexhier_dir.fhcrtnuser as CreatedByUser,
flexhier_dir.fhcrtntime as CreationTime,
flexhier_dir.fhsequence as HierarchyRawSequence,
flexhier_dir.fhfilter as HierarchyRawFilter,
hrrp_typt.text as HierarchyTypeText,
@Search: { defaultSearchElement: true, ranking: #LOW, fuzzinessThreshold: 0.8}
_Text[1:Language = $session.system_language].FlexibleHierarchyName as FlexibleHierarchyName,
_Node
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"FAC_CDS_FHT",
"FLEXHIER_DIR",
"HRRP_DIR_N",
"HRRP_TYPT"
],
"ASSOCIATED":
[
"FAC_CDS_FHT",
"FAC_CDS_FH_NODE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA