R_WorkAssgmtAltCostAssgmtUnion is a Composite CDS View that provides data about "Alt Cost Assgmnts at Wrk Assignmnt" in SAP S/4HANA. It reads from 2 data sources (R_WorkAssgmtAltCostAssgmt, R_WorkAssignmentBP) and exposes 17 fields with key fields WorkAssignmentUUID, WorkAssignmentStartDate, SequenceNumber. It has 1 association to related views. Part of development package ODATA_CA_BUM_WF.
@AbapCatalog.viewEnhancementCategory: [#NONE]@AccessControl.authorizationCheck: #NOT_REQUIRED@EndUserText.label: 'Alt Cost Assgmnts at Wrk Assignmnt'
@Metadata.ignorePropagatedAnnotations: true@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #SAP_INTERNAL_API
}@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}@Consumption.dbHints: [ 'USE_HEX_PLAN' ]defineviewentity R_WorkAssgmtAltCostAssgmtUnion
asselectfrom R_WorkAssgmtAltCostAssgmt as _AlternativeCostAssgmt
innerjoin R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AlternativeCostAssgmt.WorkforceAssignment
//Below associationis to get the UUID
association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
{
key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
key _AlternativeCostAssgmt.WorkforceAssgmtStartDate as WorkAssignmentStartDate,
key _AlternativeCostAssgmt.SequenceNumber as SequenceNumber,
_AlternativeCostAssgmt.WorkforceAssignment as WorkAssignment,
_AlternativeCostAssgmt.WorkforceAssgmtEndDate as WorkAssignmentEndDate,
_AlternativeCostAssgmt.CostCenter as CostCenter,
_AlternativeCostAssgmt.IsDefaultValue,
_AlternativeCostAssgmt.FunctionalArea,
_AlternativeCostAssgmt.Fund,
_AlternativeCostAssgmt.GrantID,
_AlternativeCostAssgmt.AlternateCostPercent,
_AlternativeCostAssgmt.ControllingArea,
_AlternativeCostAssgmt.FinancialManagementArea,
_AlternativeCostAssgmt.CompanyCode,
_BuPaIdentification.WorkAssignmentBusinessPartner,
_BuPaIdentification.BusinessPartner,
_AlternativeCostAssgmt.WBSElementExternalID
}
// asselectfrom I_WorkAssignmentDetail_1 as _AssignmentDetails
// leftouter to one join R_WorkAssgmtAltCostAssgmt as _AlternativeCostAssgmt on _AlternativeCostAssgmt.WorkforceAssignment = _AssignmentDetails.WorkforceAssignment
// and _AlternativeCostAssgmt.WorkforceAssgmtStartDate = _AssignmentDetails.WorkforceAssgmtStartDate
// and _AlternativeCostAssgmt.IsDefaultValue = 'X'
// innerjoin R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AssignmentDetails.WorkforceAssignment
// //Below associationis to get the UUID
// association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
//{
// key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
// key _AssignmentDetails.WorkforceAssgmtStartDate as WorkAssignmentStartDate,
// keycasewhen _AlternativeCostAssgmt.IsDefaultValue = 'X'
// then _AlternativeCostAssgmt.SequenceNumber
// else// cast ( '000' as wfd_seq_no ) endas SequenceNumber,
// _AssignmentDetails.WorkforceAssignment as WorkAssignment,
// _AssignmentDetails.WorkforceAssgmtEndDate as WorkAssignmentEndDate,
// _AssignmentDetails.CostCenter as CostCenter,
// cast ( 'X' as atstd ) as IsDefaultValue, //IsDefaultValue is X in both the case// casewhen _AlternativeCostAssgmt.IsDefaultValue = 'X'
// then _AlternativeCostAssgmt.FunctionalArea
// else// cast ( '' as fm_farea ) endas FunctionalArea,
// casewhen _AlternativeCostAssgmt.IsDefaultValue = 'X'
// then _AlternativeCostAssgmt.Fund
// elsecast ( '' as bp_geber ) endas Fund,
// casewhen _AlternativeCostAssgmt.IsDefaultValue = 'X'
// then _AlternativeCostAssgmt.GrantID
// elsecast ( '' as gm_grant_nbr ) endas GrantID,
// casewhen _AlternativeCostAssgmt.IsDefaultValue = 'X'
// then _AlternativeCostAssgmt.AlternateCostPercent
// elsecast ( '0' as wfd_percent ) endas AlternateCostPercent, //calculated by virtual field
// _AssignmentDetails.ControllingArea,
// _AssignmentDetails._CompanyCode.FinancialManagementArea,
// _AssignmentDetails.CompanyCode,
// _BuPaIdentification.WorkAssignmentBusinessPartner,
// _BuPaIdentification.BusinessPartner,
// _AlternativeCostAssgmt.WBSElementExternalID
//
//}
//where// _AssignmentDetails.CostCenter isnot initial
// and _AssignmentDetails.WorkforceAssignmentStatus = '1'
//
//unionselectfrom R_WorkAssgmtAltCostAssgmt as _AlternativeCostAssgmt
// innerjoin R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AlternativeCostAssgmt.WorkforceAssignment
////Below associationis to get the UUID
//association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
//{
// key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
// key _AlternativeCostAssgmt.WorkforceAssgmtStartDate as WorkAssignmentStartDate,
// key _AlternativeCostAssgmt.SequenceNumber as SequenceNumber,
// _AlternativeCostAssgmt.WorkforceAssignment as WorkAssignment,
// _AlternativeCostAssgmt.WorkforceAssgmtEndDate as WorkAssignmentEndDate,
// _AlternativeCostAssgmt.CostCenter as CostCenter,
// _AlternativeCostAssgmt.IsDefaultValue,
// _AlternativeCostAssgmt.FunctionalArea,
// _AlternativeCostAssgmt.Fund,
// _AlternativeCostAssgmt.GrantID,
// _AlternativeCostAssgmt.AlternateCostPercent,
// _AlternativeCostAssgmt.ControllingArea,
// _AlternativeCostAssgmt.FinancialManagementArea,
// _AlternativeCostAssgmt.CompanyCode,
// _BuPaIdentification.WorkAssignmentBusinessPartner,
// _BuPaIdentification.BusinessPartner,
// _AlternativeCostAssgmt.WBSElementExternalID
//}
//where// _AlternativeCostAssgmt.IsDefaultValue is initial