R_WORKASSIGNMENTBASIC
Work assignment TP
R_WORKASSIGNMENTBASIC is a CDS View in S/4HANA. Work assignment TP. It contains 44 fields. 3 CDS views read from this table.
CDS Views using this table (3)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| R_WorkAgreementPaymentMethod | view | inner | COMPOSITE | Work Assignment Payment Method |
| R_WorkAssignmentTP | view_entity | from | TRANSACTIONAL | Work assignment TP |
| R_WrkAssgmtPaymentMethodTP | view_entity | inner | TRANSACTIONAL | Work assignment Payment Method TP |
Fields (44)
| Key | Field | CDS Fields | Used in Views |
|---|---|---|---|
| KEY | WorkAssignment | WorkAssignment | 2 |
| KEY | WorkAssignmentUUID | WorkAssignmentUUID | 1 |
| _BPUsrRoleText | _BPUsrRoleText | 1 | |
| _CompanyCodeText | _CompanyCodeText | 1 | |
| _CountryText | _CountryText | 1 | |
| _CurrencyText | _CurrencyText | 1 | |
| _EntrySourceText | _EntrySourceText | 1 | |
| _WorkAssignmentBP | _WorkAssignmentBP | 1 | |
| _WorkforcePersonBP | _WorkforcePersonBP | 1 | |
| AuthorizationGroup | AuthorizationGroup | 1 | |
| BasicRoleCategory | BasicRoleCategory | 1 | |
| BusinessPartnerName | BusinessPartnerName | 1 | |
| BusinessPartnerRelshpSupplier | BusinessPartnerRelshpSupplier | 1 | |
| BusinessPartnerRole | BusinessPartnerRole | 1 | |
| BusPartRelshpSupplierIsVisible | BusPartRelshpSupplierIsVisible | 1 | |
| CompanyCode | CompanyCode | 1 | |
| CompanyCodeCountry | CompanyCodeCountry | 1 | |
| CreationDateTime | CreationDateTime | 1 | |
| Currency | Currency | 1 | |
| DataController1 | DataController1 | 1 | |
| DataController10 | DataController10 | 1 | |
| DataController2 | DataController2 | 1 | |
| DataController3 | DataController3 | 1 | |
| DataController4 | DataController4 | 1 | |
| DataController5 | DataController5 | 1 | |
| DataController6 | DataController6 | 1 | |
| DataController7 | DataController7 | 1 | |
| DataController8 | DataController8 | 1 | |
| DataController9 | DataController9 | 1 | |
| DataControllerSet | DataControllerSet | 1 | |
| EmploymentSituation | EmploymentSituation | 1 | |
| EndDate | EndDate | 1 | |
| IsBlocked | IsBlocked | 1 | |
| IsBusinessPurposeCompleted | IsBusinessPurposeCompleted | 1 | |
| Person | Person | 1 | |
| PersonUUID | PersonUUID | 3 | |
| RoleCategory | RoleCategory | 1 | |
| StartDate | StartDate | 1 | |
| WorkAssignmentBusinessPartner | WorkAssignmentBusinessPartner | 1 | |
| WorkAssignmentCountryISOCode | WorkAssignmentCountryISOCode | 1 | |
| WorkAssignmentDataSource | WorkAssignmentDataSource | 1 | |
| WorkAssignmentExternalID | WorkAssignmentExternalID | 1 | |
| WorkforcePersonID | WorkforcePersonID | 1 | |
| WorkforcePersonUserID | WorkforcePersonUserID | 1 |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Work assignment TP'
@Metadata.ignorePropagatedAnnotations: true
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #SAP_INTERNAL_API
}
//@AccessControl.privilegedAssociations: [ '_BPDataControllerUsage' ]
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XL,
dataClass: #MASTER
}
@Consumption.dbHints: [ '&PREFER_JOIN_WITH_FDA 0&', 'USE_HEX_PLAN' ]
define view entity R_WorkAssignmentBasic
as select distinct from R_WorkAssignmentKeyMap as _AssignmentKeyMap
//Get the Employment BP (for both old and new BP Models)
inner join R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
inner join R_BPUsrRole as _BPUsrRole on _BPUsrRole.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
and _BPUsrRole.BPRoleCategoryUsageCode = _BuPaIdentification.BPRoleCategoryUsageCode
left outer to one join I_WorkAssignmentDetailsAll as _AssignmentDetailsForKeyDate on _AssignmentDetailsForKeyDate.WorkAssignment = _AssignmentKeyMap.WorkforceAssignment
and _AssignmentDetailsForKeyDate.WorkAssignmentStartDate = _BPUsrRole.BPUsrRoleValidFromDate
left outer to one join R_WorkAssignmentKeyMapOldModel on R_WorkAssignmentKeyMapOldModel.BusinessPartner = _AssignmentKeyMap.BusinessPartner
and _AssignmentKeyMap.WorkforceBPModelType = 'O'
association [0..1] to R_BPUsrRoleText as _BPUsrRoleText on _BPUsrRoleText.Role = $projection.BasicRoleCategory
and _BPUsrRoleText.Language = $session.system_language
association [1..1] to I_BusinessPartner as _WorkforcePersonBP on _WorkforcePersonBP.BusinessPartner = _AssignmentKeyMap.BusinessPartner
association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
association [0..1] to I_CompanyCode as _CompanyCodeText on _CompanyCodeText.CompanyCode = _AssignmentDetailsForKeyDate.CompanyCode
association [0..1] to I_CurrencyText as _CurrencyText on _CurrencyText.Currency = $projection.Currency
and _CurrencyText.Language = $session.system_language
association [0..1] to I_CountryText as _CountryText on _CountryText.Country = $projection.CompanyCodeCountry
and _CountryText.Language = $session.system_language
association [0..1] to R_WorkAssignmentDataSourceVH as _EntrySourceText on $projection.WorkAssignmentDataSource = _EntrySourceText.WorkAssignmentDataSource
{
key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
_BPUsrRole.BPUsrRoleValidFromDate as StartDate,
_BPUsrRole.BPUsrRoleValidToDate as EndDate,
_AssignmentKeyMap.WorkforceAssignment as WorkAssignment, //PERNR
_AssignmentKeyMap.WorkAssignmentExternalID as WorkAssignmentExternalID,
//Replacing WorkAssignmentExternalID with User ID field in the UI because these fields could differ if in case of replication
_AssignmentKeyMap.WorkforcePersonID as WorkforcePersonID,
_AssignmentKeyMap.WorkforcePersonUserID as WorkforcePersonUserID, //Mandatory
//If the Original Entry Source is 'E', treat it as 'W'
case _AssignmentKeyMap.WorkAssignmentDataSource
when 'E'
then 'W'
else
_AssignmentKeyMap.WorkAssignmentDataSource
end as WorkAssignmentDataSource,
_BuPaIdentification.WorkAssignmentBusinessPartner as WorkAssignmentBusinessPartner,
_AssignmentKeyMap.BusinessPartner as Person,
_WorkforcePersonBP.BusinessPartnerUUID as PersonUUID,
_AssignmentDetailsForKeyDate.CompanyCode as CompanyCode, //select only first one
_CompanyCodeText.Country as CompanyCodeCountry,
_CompanyCodeText.Currency as Currency,
_AssignmentDetailsForKeyDate.Country2DigitISOCode as WorkAssignmentCountryISOCode,
_BPUsrRole.RoleCategory as RoleCategory,
case _BPUsrRole.BasicRoleCategory
when ''
then _BPUsrRole.RoleCategory
else
_BPUsrRole.BasicRoleCategory
end as BasicRoleCategory,
_BPUsrRole.BusinessPartnerRole as BusinessPartnerRole,
cast( '' as bum_wf_employment_situation preserving type ) as EmploymentSituation,
cast( ' ' as boolean preserving type ) as BusPartRelshpSupplierIsVisible,
@Semantics.systemDateTime.lastChangedAt: true
cast (dats_tims_to_tstmp( _WorkAssignmentBP.CreationDate,
_WorkAssignmentBP.CreationTime,
abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as vdm_lastchangedon) as CreationDateTime,
cast ( '' as abap.char(10)) as BusinessPartnerRelshpSupplier,
cast ( '' as abap.char(100)) as BusinessPartnerName,
// Fields for DCL
@Semantics.booleanIndicator
_AssignmentKeyMap.IsBlocked as IsBlocked,
@Semantics.booleanIndicator
_WorkAssignmentBP.IsBusinessPurposeCompleted as IsBusinessPurposeCompleted,
_WorkAssignmentBP.AuthorizationGroup,
_WorkAssignmentBP.DataControllerSet,
_WorkAssignmentBP.DataController1,
_WorkAssignmentBP.DataController2,
_WorkAssignmentBP.DataController3,
_WorkAssignmentBP.DataController4,
_WorkAssignmentBP.DataController5,
_WorkAssignmentBP.DataController6,
_WorkAssignmentBP.DataController7,
_WorkAssignmentBP.DataController8,
_WorkAssignmentBP.DataController9,
_WorkAssignmentBP.DataController10,
_WorkAssignmentBP,
_WorkforcePersonBP,
// _AssignmentDetailsForKeyDate,
_CompanyCodeText,
_CurrencyText,
_CountryText,
_BPUsrRoleText,
_EntrySourceText
}
where
_AssignmentKeyMap.BusinessPartner is not initial
and(
R_WorkAssignmentKeyMapOldModel.NumberOfWorkAssignments <= 1
or R_WorkAssignmentKeyMapOldModel.NumberOfWorkAssignments is null
)
////
//
//define view entity R_WorkAssignmentBasic
// as select distinct from R_WorkAssignmentKeyMap as _AssignmentKeyMap
// //Get the Employment BP (for both old and new BP Models)
// inner join R_WorkAssignmentBP as _BuPaIdentification on _BuPaIdentification.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
// inner join R_BPUsrRole as _BPUsrRole on _BPUsrRole.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
// and _BPUsrRole.BPRoleCategoryUsageCode = _BuPaIdentification.BPRoleCategoryUsageCode
//
// left outer to one join R_WorkAssignmentKeyMapOldModel on R_WorkAssignmentKeyMapOldModel.BusinessPartner = _AssignmentKeyMap.BusinessPartner
// and _AssignmentKeyMap.WorkforceBPModelType = 'O'
// association [0..1] to R_BPUsrRoleText as _BPUsrRoleText on _BPUsrRoleText.Role = $projection.BasicRoleCategory
// and _BPUsrRoleText.Language = $session.system_language
// association [1..1] to I_BusinessPartner as _WorkforcePersonBP on _WorkforcePersonBP.BusinessPartner = _AssignmentKeyMap.BusinessPartner
//
// association [1..1] to I_BusinessPartner as _WorkAssignmentBP on _WorkAssignmentBP.BusinessPartner = _BuPaIdentification.WorkAssignmentBusinessPartner
// association [1..1] to I_WorkAssignmentDetail_1 as _AssignmentDetailsForKeyDate on _AssignmentDetailsForKeyDate.WorkforceAssignment = _AssignmentKeyMap.WorkforceAssignment
// and _AssignmentDetailsForKeyDate.WorkforceAssgmtStartDate = _BPUsrRole.BPUsrRoleValidFromDate
// association [0..1] to I_CompanyCode as _CompanyCodeText on _CompanyCodeText.CompanyCode = $projection.CompanyCode
// association [0..1] to I_CurrencyText as _CurrencyText on _CurrencyText.Currency = $projection.Currency
// and _CurrencyText.Language = $session.system_language
// association [0..1] to I_CountryText as _CountryText on _CountryText.Country = $projection.CompanyCodeCountry
// and _CountryText.Language = $session.system_language
//{
// key _WorkAssignmentBP.BusinessPartnerUUID as WorkAssignmentUUID,
// _BPUsrRole.BPUsrRoleValidFromDate as StartDate,
// _BPUsrRole.BPUsrRoleValidToDate as EndDate,
// _AssignmentKeyMap.WorkforceAssignment as WorkAssignment, //PERNR
// _AssignmentKeyMap.WorkAssignmentExternalID as WorkAssignmentExternalID,
// //Replacing WorkAssignmentExternalID with User ID field in the UI because these fields could differ if in case of replication
// _AssignmentKeyMap.WorkforcePersonID as WorkforcePersonID,
// _AssignmentKeyMap.WorkforcePersonUserID as WorkforcePersonUserID, //Mandatory
// _AssignmentKeyMap.WorkAssignmentDataSource as WorkAssignmentDataSource,
// _BuPaIdentification.WorkAssignmentBusinessPartner as WorkAssignmentBusinessPartner,
// _AssignmentKeyMap.BusinessPartner as Person,
// _WorkforcePersonBP.BusinessPartnerUUID as PersonUUID,
// _AssignmentDetailsForKeyDate.CompanyCode as CompanyCode, //select only first one
// _AssignmentDetailsForKeyDate._CompanyCode.Country as CompanyCodeCountry,
// _AssignmentDetailsForKeyDate._CompanyCode.Currency as Currency,
// _AssignmentDetailsForKeyDate.Country2DigitISOCode as WorkAssignmentCountryISOCode,
// _BPUsrRole.RoleCategory as RoleCategory,
// case _BPUsrRole.BasicRoleCategory
// when ''
// then _BPUsrRole.RoleCategory
// else
// _BPUsrRole.BasicRoleCategory
// end as BasicRoleCategory,
// _BPUsrRole.BusinessPartnerRole as BusinessPartnerRole,
// cast( '' as bum_wf_employment_situation preserving type ) as EmploymentSituation,
// cast( ' ' as boolean preserving type ) as BusPartRelshpSupplierIsVisible,
// @Semantics.systemDateTime.lastChangedAt: true
// cast (dats_tims_to_tstmp( _WorkAssignmentBP.CreationDate,
// _WorkAssignmentBP.CreationTime,
// abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL' ) as vdm_lastchangedon) as CreationDateTime,
//
// cast ( '' as abap.char(10)) as BusinessPartnerRelshpSupplier,
// cast ( '' as abap.char(100)) as BusinessPartnerName,
// // Fields for DCL
// @Semantics.booleanIndicator
// _AssignmentKeyMap.IsBlocked as IsBlocked,
// @Semantics.booleanIndicator
// _WorkAssignmentBP.IsBusinessPurposeCompleted as IsBusinessPurposeCompleted,
// _WorkAssignmentBP.AuthorizationGroup,
// _WorkAssignmentBP.DataControllerSet,
// _WorkAssignmentBP.DataController1,
// _WorkAssignmentBP.DataController2,
// _WorkAssignmentBP.DataController3,
// _WorkAssignmentBP.DataController4,
// _WorkAssignmentBP.DataController5,
// _WorkAssignmentBP.DataController6,
// _WorkAssignmentBP.DataController7,
// _WorkAssignmentBP.DataController8,
// _WorkAssignmentBP.DataController9,
// _WorkAssignmentBP.DataController10,
//
//
// _WorkAssignmentBP,
// _WorkforcePersonBP,
// _AssignmentDetailsForKeyDate,
// _CompanyCodeText,
// _CurrencyText,
// _CountryText,
// _BPUsrRoleText
//}
//where
// _AssignmentKeyMap.BusinessPartner is not initial
// and(
// R_WorkAssignmentKeyMapOldModel.NumberOfWorkAssignments <= 1
// or R_WorkAssignmentKeyMapOldModel.NumberOfWorkAssignments is null
// )