@EndUserText.label: 'Customer 360 Scheduling Agreements'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions: true
@VDM: {
viewType:#CONSUMPTION
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking:#REQUIRED
}
@ObjectModel: {
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #C,
sizeCategory: #L
}
}
@Search.searchable: true
define view entity C_Cust360SalesSchedgAgrmt
as select from I_SalesSchedgAgrmt as SalesSchedulingAgreement
inner join I_Customer360BusDocSetting as Customer360BusDocSetting on Customer360BusDocSetting.Cust360BusDocCategory = 'E'
and Customer360BusDocSetting.BusinessDocumentIsEnabled = 'X'
association [0..1] to C_SoldToValueHelp as _SoldToParty on $projection.SoldToParty = _SoldToParty.Customer
association [0..1] to C_SoldToValueHelp as _ShipToParty on $projection.ShipToParty = _ShipToParty.Customer
association [0..1] to C_SalesSchedgAgrmtTypeVH as _SalesSchedgAgrmtType on $projection.SalesSchedgAgrmtType = _SalesSchedgAgrmtType.SalesSchedgAgrmtType
association [0..1] to I_OverallSDProcessStatus as _OverallSDProcessStatus on $projection.OverallSDProcessStatus = _OverallSDProcessStatus.OverallSDProcessStatus
association [0..1] to I_OverallSDDocumentRjcnStatus as _OverallSDDocumentRejectionSts on $projection.OverallSDDocumentRejectionSts = _OverallSDDocumentRejectionSts.OverallSDDocumentRejectionSts
association [0..1] to I_SalesOrganization as _SalesOrg on $projection.SalesOrganization = _SalesOrg.SalesOrganization
association [0..1] to I_DistributionChannel as _DistributionChannel on $projection.DistributionChannel = _DistributionChannel.DistributionChannel
association [0..1] to I_Division as _Division on $projection.OrganizationDivision = _Division.Division
association [0..1] to I_SalesOffice as _SalesOffice on $projection.SalesOffice = _SalesOffice.SalesOffice
association [0..1] to I_SalesGroup as _SalesGroup on $projection.SalesGroup = _SalesGroup.SalesGroup
association [0..1] to C_SalesDocumentUserVH as _CreatedByUser on $projection.CreatedByUser = _CreatedByUser.UserID
association [0..1] to C_SalesDocumentUserVH as _LastChangedByUser on $projection.LastChangedByUser = _LastChangedByUser.UserID
// association [0..*] to C_SalesDocumentItemWl as _SalesDocumentItemWl on $projection.SalesSchedulingAgreement = _SalesDocumentItemWl.SalesDocument
//Extension Association
association [1] to E_SalesDocumentBasic as _Extension on $projection.SalesSchedulingAgreement = _Extension.SalesDocument
{
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
key SalesSchedulingAgreement.SalesSchedulingAgreement,
@ObjectModel: {
readOnly: true,
foreignKey.association: '_SoldToParty'
}
SalesSchedulingAgreement.SoldToParty,
//Organization
@ObjectModel.readOnly: true
@ObjectModel.foreignKey.association: '_SalesOrg'
@ObjectModel.text.element: ['SalesOrganizationName']
SalesSchedulingAgreement.SalesOrganization,
SalesSchedulingAgreement._SalesOrganization._Text[1:Language = $session.system_language].SalesOrganizationName as SalesOrganizationName,
SalesSchedulingAgreement.PurchaseOrderByCustomer,
// @ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
@ObjectModel.text.element: ['OverallSDProcessStatusDesc']
SalesSchedulingAgreement.OverallSDProcessStatus,
SalesSchedulingAgreement._OverallSDProcessStatus._Text[1:Language = $session.system_language].OverallSDProcessStatusDesc,
//Administrator
SalesSchedulingAgreement.SalesSchedgAgrmtDate,
SalesSchedulingAgreement.CreationDate,
@ObjectModel.foreignKey.association: '_CreatedByUser'
@ObjectModel.text.element: ['CreatedByUserDescription']
SalesSchedulingAgreement.CreatedByUser,
SalesSchedulingAgreement._CreatedByUser.UserDescription as CreatedByUserDescription,
@ObjectModel.foreignKey.association: '_LastChangedByUser'
@ObjectModel.text.element: ['LastChangedByUserDescription']
SalesSchedulingAgreement.LastChangedByUser,
SalesSchedulingAgreement._LastChangedByUser.UserDescription as LastChangedByUserDescription,
@ObjectModel.foreignKey.association: '_DistributionChannel'
@ObjectModel.text.element: ['DistributionChannelName']
SalesSchedulingAgreement.DistributionChannel,
_DistributionChannel._Text[1:Language = $session.system_language].DistributionChannelName,
@ObjectModel.foreignKey.association: '_Division'
@ObjectModel.text.element: ['DivisionName']
SalesSchedulingAgreement.OrganizationDivision,
_Division._Text[1:Language = $session.system_language].DivisionName,
@ObjectModel.foreignKey.association: '_SalesOffice'
@ObjectModel.text.element: ['SalesOfficeName']
SalesSchedulingAgreement.SalesOffice,
_SalesOffice._Text[1:Language = $session.system_language].SalesOfficeName,
@ObjectModel.foreignKey.association: '_SalesGroup'
@ObjectModel.text.element: ['SalesGroupName']
SalesSchedulingAgreement.SalesGroup,
_SalesGroup._Text[1:Language = $session.system_language].SalesGroupName,
@Semantics.amount.currencyCode: 'TransactionCurrency'
SalesSchedulingAgreement.TotalNetAmount,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
@ObjectModel.text.element: ['CurrencyName']
SalesSchedulingAgreement.TransactionCurrency,
SalesSchedulingAgreement._TransactionCurrency._Text[1:Language = $session.system_language].CurrencyName as CurrencyName,
@ObjectModel.foreignKey.association: '_SalesSchedgAgrmtType'
@ObjectModel.text.element: ['SalesDocumentTypeName']
SalesSchedulingAgreement.SalesSchedgAgrmtType,
SalesSchedulingAgreement._SalesSchedgAgrmtType._Text[1:Language = $session.system_language].SalesDocumentTypeName,
SalesSchedulingAgreement.PricingDate,
//Status
@ObjectModel.foreignKey.association: '_OverallBillingBlockStatus'
@ObjectModel.text.element: ['OverallBillingBlockStatusDesc']
SalesSchedulingAgreement.OverallBillingBlockStatus,
SalesSchedulingAgreement._OverallBillingBlockStatus._Text[1:Language = $session.system_language].OverallBillingBlockStatusDesc as OverallBillingBlockStatusDesc,
@ObjectModel.foreignKey.association: '_OverallDeliveryStatus'
@ObjectModel.text.element: ['OverallDeliveryStatusDesc']
SalesSchedulingAgreement.OverallDeliveryStatus,
SalesSchedulingAgreement._OverallDeliveryStatus._Text[1:Language = $session.system_language].OverallDeliveryStatusDesc as OverallDeliveryStatusDesc,
@ObjectModel.foreignKey.association: '_OverallSDDocumentRejectionSts'
@ObjectModel.text.element: ['OvrlSDDocumentRejectionStsDesc']
SalesSchedulingAgreement.OverallSDDocumentRejectionSts,
_OverallSDDocumentRejectionSts._Text[1: Language=$session.system_language].OvrlSDDocumentRejectionStsDesc as OvrlSDDocumentRejectionStsDesc,
_SoldToParty.OrganizationBPName1,
_SoldToParty.OrganizationBPName2,
@ObjectModel.foreignKey.association: '_OvrlTradeCmplncEmbargoStatus'
@ObjectModel.text.element: ['OverallTrdCmplncEmbargoStsDesc']
cast(SalesSchedulingAgreement.OverallTrdCmplncEmbargoSts as totembargochksts preserving type) as OverallTrdCmplncEmbargoSts,
SalesSchedulingAgreement._OvrlTradeCmplncEmbargoStatus._Text[1: Language=$session.system_language].OverallTrdCmplncEmbargoStsDesc,
@ObjectModel.foreignKey.association: '_OvTrdCmplncSnctndListChkSts'
@ObjectModel.text.element: ['OvrlTrdCmplncSnctndListStsDesc']
cast(SalesSchedulingAgreement.OvrlTrdCmplncSnctndListChkSts as totwatchlistscrngchksts preserving type) as OvrlTrdCmplncSnctndListChkSts,
SalesSchedulingAgreement._OvTrdCmplncSnctndListChkSts._Text[1: Language=$session.system_language].OvrlTrdCmplncSnctndListStsDesc,
@ObjectModel.foreignKey.association: '_OvrlTrdCmplncLegalCtrlChkSts'
@ObjectModel.text.element: ['OvrlTrdCmplncLglCtrlChkStsDesc']
cast(SalesSchedulingAgreement.OvrlTrdCmplncLegalCtrlChkSts as totlglctrlchksts preserving type) as OvrlTrdCmplncLegalCtrlChkSts,
SalesSchedulingAgreement._OvrlTrdCmplncLegalCtrlChkSts._Text[1: Language=$session.system_language].OvrlTrdCmplncLglCtrlChkStsDesc,
@ObjectModel.foreignKey.association: '_ShipToParty'
@ObjectModel.text.element: ['ShipToPartyName']
@EndUserText.label: 'Ship-to Party'
SalesSchedulingAgreement._Partner [ 1:PartnerFunction = 'WE'].Customer as ShipToParty,
@Semantics.text:true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SLSSA_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as ShipToPartyName,
@ObjectModel.foreignKey.association: '_OverallChmlCmplncStatus'
@ObjectModel.text.element: ['OverallChmlCmplncStatusDesc']
cast(SalesSchedulingAgreement.OverallChmlCmplncStatus as mon_tdd_total_pcsta preserving type) as OverallChmlCmplncStatus,
SalesSchedulingAgreement._OverallChmlCmplncStatus._Text[1: Language=$session.system_language].OverallChmlCmplncStatusDesc,
@ObjectModel.foreignKey.association: '_OverallDangerousGoodsStatus'
@ObjectModel.text.element: ['OverallDangerousGoodsStsDesc']
cast(SalesSchedulingAgreement.OverallDangerousGoodsStatus as mon_tdd_total_dgsta preserving type) as OverallDangerousGoodsStatus,
SalesSchedulingAgreement._OverallDangerousGoodsStatus._Text[1: Language=$session.system_language].OverallDangerousGoodsStsDesc,
@ObjectModel.foreignKey.association: '_OvrlSftyDataSheetSts'
@ObjectModel.text.element: ['OverallSafetyDataSheetStsDesc']
cast(SalesSchedulingAgreement.OverallSafetyDataSheetStatus as mon_tdd_total_sdssta preserving type) as OverallSafetyDataSheetStatus,
SalesSchedulingAgreement._OvrlSftyDataSheetSts._Text[1: Language=$session.system_language].OverallSafetyDataSheetStsDesc,
cast ('' as matnr_ku) as MaterialByCustomer,
cast ('' as werks_ext) as Plant,
//Association
@Consumption.filter.hidden: true
_SoldToParty,
@Consumption.filter.hidden: true
_OverallSDProcessStatus,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OverallBillingBlockStatus,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OverallDeliveryStatus,
@Consumption.filter.hidden: true
_OverallSDDocumentRejectionSts,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OverallChmlCmplncStatus,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OverallDangerousGoodsStatus,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OvrlSftyDataSheetSts,
@Consumption.filter.hidden: true
_SalesSchedgAgrmtType,
@Consumption.filter.hidden: true
_SalesOffice,
@Consumption.filter.hidden: true
_SalesGroup,
@Consumption.filter.hidden: true
_SalesOrg,
@Consumption.filter.hidden: true
_DistributionChannel,
@Consumption.filter.hidden: true
_Division,
@Consumption.filter.hidden: true
_CreatedByUser,
@Consumption.filter.hidden: true
_LastChangedByUser,
// @Search.defaultSearchElement: true
// _SalesDocumentItemWl,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._TransactionCurrency,
@Consumption.filter.hidden: true
_ShipToParty,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OvrlTradeCmplncEmbargoStatus,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OvTrdCmplncSnctndListChkSts,
@Consumption.filter.hidden: true
SalesSchedulingAgreement._OvrlTrdCmplncLegalCtrlChkSts
}
where SalesSchedulingAgreement.CreationDate > dats_add_days( tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), -Customer360BusDocSetting.BusDocumentDurationInDays, 'INITIAL')
and SalesSchedulingAgreement.CreationDate <= $session.system_date