R_WorkAssignmentAltCost
Alternate Cost Objects for Work Assignment
R_WorkAssignmentAltCost is a Composite CDS View that provides data about "Alternate Cost Objects for Work Assignment" in SAP S/4HANA. It reads from 2 data sources (I_WorkAssignmentAltCost, R_WorkAssignmentBP) and exposes 25 fields with key fields WorkAssignmentUUID, WorkAssignmentStartDate, SequenceNumber. It has 7 associations to related views. Part of development package WFD_WORKER_FACTSHEET_BL.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_WorkAssignmentAltCost | _AlternativeCostAssgmt | from |
| R_WorkAssignmentBP | _BuPaIdentification | inner |
Associations (7)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_BusinessPartner | _WorkAssignmentBP | _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner |
| [1..1] | I_WorkAssignmentDetail_1 | _AssignmentDetails | _AlternativeCostAssgmt.IsDefaultValue = 'X' and _AssignmentDetails.WorkforceAssignment = $projection.WorkAssignment and ( ( _AssignmentDetails.WorkforceAssgmtStartDate <= _AlternativeCostAssgmt.WorkforceAssgmtStartDate and _AssignmentDetails.WorkforceAssgmtEndDate >= _AlternativeCostAssgmt.WorkforceAssgmtEndDate ) or( _AssignmentDetails.WorkforceAssgmtStartDate >= _AlternativeCostAssgmt.WorkforceAssgmtStartDate and _AssignmentDetails.WorkforceAssgmtEndDate <= _AlternativeCostAssgmt.WorkforceAssgmtEndDate ) ) |
| [0..1] | I_CostCenter | _CostCenterText | $projection.CostCenter = _CostCenterText.CostCenter and _CostCenterText.ControllingArea = _AlternativeCostAssgmt.ControllingArea and _CostCenterText.ValidityStartDate <= _AlternativeCostAssgmt.WorkforceAssgmtStartDate and _CostCenterText.ValidityEndDate >= _AlternativeCostAssgmt.WorkforceAssgmtEndDate |
| [1..1] | I_FunctionalArea | _FunctionalAreaText | $projection.FunctionalArea = _FunctionalAreaText.FunctionalArea |
| [1..1] | I_Grant | _GrantText | $projection.GrantID = _GrantText.GrantID |
| [1..1] | I_Fund | _FundText | $projection.Fund = _FundText.Fund and _AlternativeCostAssgmt.FinancialManagementArea = _FundText.FinancialManagementArea |
| [1..1] | I_WBSElementBasicData | _WBSText | $projection.WBSElementExternalID = _WBSText.WBSElementExternalID |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #MANDATORY | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.contract.type | #SAP_INTERNAL_API | view | |
| EndUserText.label | Alternate Cost Objects for Work Assignment | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (25)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | WorkAssignmentUUID | _WorkAssignmentBP | BusinessPartnerUUID | |
| KEY | WorkAssignmentStartDate | I_WorkAssignmentAltCost | WorkforceAssgmtStartDate | |
| KEY | SequenceNumber | I_WorkAssignmentAltCost | SequenceNumber | |
| WorkAssignment | I_WorkAssignmentAltCost | WorkforceAssignment | ||
| WorkAssignmentEndDate | I_WorkAssignmentAltCost | WorkforceAssgmtEndDate | ||
| CostCenterendasCostCenter | ||||
| IsDefaultValue | I_WorkAssignmentAltCost | IsDefaultValue | ||
| FunctionalArea | I_WorkAssignmentAltCost | FunctionalArea | ||
| Fund | I_WorkAssignmentAltCost | Fund | ||
| GrantID | I_WorkAssignmentAltCost | GrantID | ||
| WBSElementExternalID | I_WorkAssignmentAltCost | WBSElementExternalID | ||
| AlternateCostPercent | I_WorkAssignmentAltCost | AlternateCostPercent | ||
| OrganizationalAssignment | I_WorkAssignmentAltCost | IsDefaultValue | ||
| ControllingArea | I_WorkAssignmentAltCost | ControllingArea | ||
| FinancialManagementArea | I_WorkAssignmentAltCost | FinancialManagementArea | ||
| WorkforceAssgmtStartDate | I_WorkAssignmentAltCost | WorkforceAssgmtStartDate | ||
| WorkforceAssgmtEndDate | I_WorkAssignmentAltCost | WorkforceAssgmtEndDate | ||
| IsBlocked | I_WorkAssignmentAltCost | IsBlocked | ||
| CostAssignmentPercentageUnit | ||||
| _CostCenterText | _CostCenterText | |||
| _FunctionalAreaText | _FunctionalAreaText | |||
| _GrantText | _GrantText | |||
| _FundText | _FundText | |||
| _WBSText | _WBSText | |||
| _WorkAssignment | _WorkAssignment |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #SAP_INTERNAL_API
}
@EndUserText.label: 'Alternate Cost Objects for Work Assignment'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #XL,
dataClass: #MIXED
}
define view entity R_WorkAssignmentAltCost
as select from I_WorkAssignmentAltCost as _AlternativeCostAssgmt
inner join R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AlternativeCostAssgmt.WorkforceAssignment
association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
association [1..1] to I_WorkAssignmentDetail_1 as _AssignmentDetails on _AlternativeCostAssgmt.IsDefaultValue = 'X'
and _AssignmentDetails.WorkforceAssignment = $projection.WorkAssignment
and (
(
_AssignmentDetails.WorkforceAssgmtStartDate <= _AlternativeCostAssgmt.WorkforceAssgmtStartDate
and _AssignmentDetails.WorkforceAssgmtEndDate >= _AlternativeCostAssgmt.WorkforceAssgmtEndDate
)
// if assignment details is a subset of alternate cost
or(
_AssignmentDetails.WorkforceAssgmtStartDate >= _AlternativeCostAssgmt.WorkforceAssgmtStartDate
and _AssignmentDetails.WorkforceAssgmtEndDate <= _AlternativeCostAssgmt.WorkforceAssgmtEndDate
)
)
association [0..1] to I_CostCenter as _CostCenterText on $projection.CostCenter = _CostCenterText.CostCenter
and _CostCenterText.ControllingArea = _AlternativeCostAssgmt.ControllingArea
and _CostCenterText.ValidityStartDate <= _AlternativeCostAssgmt.WorkforceAssgmtStartDate
and _CostCenterText.ValidityEndDate >= _AlternativeCostAssgmt.WorkforceAssgmtEndDate
association [1..1] to I_FunctionalArea as _FunctionalAreaText on $projection.FunctionalArea = _FunctionalAreaText.FunctionalArea
association [1..1] to I_Grant as _GrantText on $projection.GrantID = _GrantText.GrantID
association [1..1] to I_Fund as _FundText on $projection.Fund = _FundText.Fund
and _AlternativeCostAssgmt.FinancialManagementArea = _FundText.FinancialManagementArea
association [1..1] to I_WBSElementBasicData as _WBSText on $projection.WBSElementExternalID = _WBSText.WBSElementExternalID
association to parent R_WorkAssignment as _WorkAssignment on $projection.WorkAssignmentUUID = _WorkAssignment.WorkAssignmentUUID
and $projection.WorkAssignment = _WorkAssignment.WorkAssignment
// pernr addition
{
key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
//key case
// when (_AlternativeCostAssgmt.IsDefaultValue is not initial and ( _AssignmentDetails.WorkforceAssgmtStartDate >= _AlternativeCostAssgmt.WorkforceAssgmtStartDate
// and _AssignmentDetails.WorkforceAssgmtEndDate <= _AlternativeCostAssgmt.WorkforceAssgmtEndDate
// ) )
// then _AssignmentDetails.WorkforceAssgmtStartDate
//else _AlternativeCostAssgmt.WorkforceAssgmtStartDate end as WorkAssignmentStartDate,
key _AlternativeCostAssgmt.WorkforceAssgmtStartDate as WorkAssignmentStartDate,
key _AlternativeCostAssgmt.SequenceNumber as SequenceNumber,
_AlternativeCostAssgmt.WorkforceAssignment as WorkAssignment,
// case
// when (_AlternativeCostAssgmt.IsDefaultValue is not initial and ( _AssignmentDetails.WorkforceAssgmtStartDate >= _AlternativeCostAssgmt.WorkforceAssgmtStartDate
// and _AssignmentDetails.WorkforceAssgmtEndDate <= _AlternativeCostAssgmt.WorkforceAssgmtEndDate
// ) )
// then _AssignmentDetails.WorkforceAssgmtEndDate
// else _AlternativeCostAssgmt.WorkforceAssgmtEndDate end as WorkAssignmentEndDate,
_AlternativeCostAssgmt.WorkforceAssgmtEndDate as WorkAssignmentEndDate,
case when _AlternativeCostAssgmt.IsDefaultValue is not initial
then _AssignmentDetails.CostCenter
else _AlternativeCostAssgmt.CostCenter
end as CostCenter,
_AlternativeCostAssgmt.IsDefaultValue,
_AlternativeCostAssgmt.FunctionalArea,
_AlternativeCostAssgmt.Fund,
_AlternativeCostAssgmt.GrantID,
_AlternativeCostAssgmt.WBSElementExternalID,
_AlternativeCostAssgmt.AlternateCostPercent,
_AlternativeCostAssgmt.IsDefaultValue as OrganizationalAssignment,
// case when _AlternativeCostAssgmt.IsDefaultValue is not initial
// then 'Yes' //Primary
// else 'No' //Alternative
// end as OrganizationalAssignment,
_AlternativeCostAssgmt.ControllingArea,
_AlternativeCostAssgmt.FinancialManagementArea,
_AlternativeCostAssgmt.WorkforceAssgmtStartDate,
_AlternativeCostAssgmt.WorkforceAssgmtEndDate,
_AlternativeCostAssgmt.IsBlocked as IsBlocked,
cast('%' as qprozent) as CostAssignmentPercentageUnit,
_CostCenterText,
_FunctionalAreaText,
_GrantText,
_FundText,
_WBSText,
_WorkAssignment // Make association public
}
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