P_UniAllocTagObjectAssignment
Assign tag to cycle and segment
P_UniAllocTagObjectAssignment is a Composite CDS View that provides data about "Assign tag to cycle and segment" in SAP S/4HANA. It reads from 2 data sources (I_AllocationCycle, I_AllocationSegment) and exposes 14 fields with key fields AllocationType, AllocationCycle, AllocationCycleStartDate, AllocationCycleSegment. Part of development package ODATA_ALLOCATION_TAG_V2.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_AllocationCycle | _Cycle | from |
| I_AllocationSegment | _Segment | inner |
Annotations (12)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.sqlViewName | PUNIALLOTAGASGN | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (14)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | AllocationType | I_AllocationCycle | AllocationType | |
| KEY | AllocationCycle | I_AllocationCycle | AllocationCycle | |
| KEY | AllocationCycleStartDate | I_AllocationCycle | AllocationCycleStartDate | |
| KEY | AllocationCycleSegment | I_AllocationSegment | AllocationCycleSegment | |
| SegmentName | I_AllocationSegment | SegmentName | ||
| AllocTagAssignmentStatus | ||||
| AllocationCycleEndDate | AllocationCycleEndDate | |||
| AllocationFrequency | AllocationFrequency | |||
| AllocationCreateDate | I_AllocationCycle | AllocationCreateDate | ||
| CreatedByUser | CreatedByUser | |||
| LastChangeDate | I_AllocationCycle | LastChangeDate | ||
| LastChangedByUser | LastChangedByUser | |||
| AllocationPostingType | ||||
| AllocationActualPlanVariant | AllocationActualPlanVariant |
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.sqlViewName: 'PUNIALLOTAGASGN'
@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.preserveKey:true
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel: {
usageType.serviceQuality: #C,
usageType.sizeCategory: #S,
usageType.dataClass: #MIXED
}
define view P_UniAllocTagObjectAssignment
// with parameters
// P_AllocationTagID :fco_tag_id
as select from I_AllocationCycle as _Cycle
inner join I_AllocationSegment as _Segment on _Cycle.AllocationType = _Segment.AllocationType
and _Cycle.AllocationCycle = _Segment.AllocationCycle
and _Cycle.AllocationCycleStartDate = _Segment.AllocationCycleStartDate
// left outer to many join P_AllocTagObjectAssignment(P_AllocationTagID:$parameters.P_AllocationTagID) as _AllocTagAssign
// left outer to many join P_AllocTagObjectAssignment as _AllocTagAssign
// on _Cycle.AllocationType = _AllocTagAssign.AllocationType
// and _Cycle.AllocationCycle = _AllocTagAssign.AllocationCycle
// and _Cycle.AllocationCycleStartDate = _AllocTagAssign.AllocationCycleStartDate
// and ( _AllocTagAssign.AllocationCycleSegment = '0000' or _AllocTagAssign.AllocationCycleSegment = _Segment.AllocationCycleSegment )
{
key _Cycle.AllocationType,
key _Cycle.AllocationCycle,
key _Cycle.AllocationCycleStartDate,
// @UI.hidden: true
key _Segment.AllocationCycleSegment,
_Segment.SegmentName,
// cast( '' as fco_alloc_tag ) as AllocationTagID,
cast ('U' as fco_alloc_tag_assignment) as AllocTagAssignmentStatus,
// case
// when AllocationTagID is null
// then cast (('U') as fco_alloc_tag_assignment)
// else
// cast (('A') as fco_alloc_tag_assignment)
// end as AllocTagAssignmentStatus,
AllocationCycleEndDate,
AllocationFrequency,
_Cycle.AllocationCreateDate, // missing GFN
// @UI.lineItem: [ { type: #AS_CONTACT, label: 'Created By', value: '_CreatedByUserContactCard' } ]
CreatedByUser,
// _CreatedByUserContactCard.FullName as CreatedByUserName,
_Cycle.LastChangeDate,
// @UI.lineItem: [ { type: #AS_CONTACT, label: 'Changed By', value: '_LastChangeUserContactCard', position: 100, importance: #HIGH } ]
LastChangedByUser,
cast(AllocationPostingType as fco_alloc_posting_type preserving type) as AllocationPostingType,
AllocationActualPlanVariant
}
where
_Cycle.AllocationType is not initial
and _Cycle.AllocationCycle is not initial
and _Cycle.AllocationCycleStartDate is not initial
and(
_Cycle.AllocationType = 'ACDOC_CC'
or _Cycle.AllocationType = 'ACDOC_PC'
or _Cycle.AllocationType = 'ACDOC_PA'
)
// and(
// _AllocTagAssign.AllocationTagID = $parameters.P_AllocationTagID
// or _AllocTagAssign.AllocationTagID is null
// )
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