@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@ObjectModel: {
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #C,
sizeCategory: #XL
}
}
@EndUserText.label: 'Customer 360 Sales Order Without Charge'
@Metadata.allowExtensions: true
@VDM.viewType: #CONSUMPTION
@Search.searchable: true
define view entity C_Cust360SlsOrdWithoutCharge
as select from I_SalesOrderWithoutCharge as Cust360SlsOrdWithoutCharge
inner join I_Customer360BusDocSetting as Customer360BusDocSetting on Customer360BusDocSetting.Cust360BusDocCategory = 'I'
and Customer360BusDocSetting.BusinessDocumentIsEnabled = 'X'
association [0..1] to I_SalesOrderWithoutChargeType as _SalesDocumentType on $projection.SalesOrderWithoutChargeType = _SalesDocumentType.SalesOrderWithoutChargeType
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
//Extension Association
association [1] to E_SalesDocumentBasic as _Extension on $projection.SalesOrderWithoutCharge = _Extension.SalesDocument
{
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
@Consumption.semanticObject: 'SalesOrderWithoutCharge'
key Cust360SlsOrdWithoutCharge.SalesOrderWithoutCharge as SalesOrderWithoutCharge,
@ObjectModel: {
text.element: ['SoldToPartyName']
}
Cust360SlsOrdWithoutCharge.SoldToParty,
@Semantics.text:true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOWOC_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as SoldToPartyName,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@ObjectModel: {
text.element: ['ShipToPartyName']
}
@Consumption.semanticObject: 'Customer'
cast( Cust360SlsOrdWithoutCharge._Partner[ PartnerFunction = 'WE' ].Customer as kunwe preserving type ) as ShipToParty,
@Semantics.text:true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOWOC_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as ShipToPartyName,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@ObjectModel: {
text.element: ['PayerPartyName']
}
@Consumption.semanticObject: 'Customer'
cast( Cust360SlsOrdWithoutCharge._Partner[ PartnerFunction = 'RG' ].Customer as kunrg preserving type ) as PayerParty,
@Semantics.text:true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOWOC_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as PayerPartyName,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@ObjectModel: {
text.element: ['BillToPartyName']
}
@Consumption.semanticObject: 'Customer'
cast( Cust360SlsOrdWithoutCharge._Partner[ PartnerFunction = 'RE' ].Customer as kunre preserving type ) as BillToParty,
@Semantics.text:true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOWOC_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as BillToPartyName,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@ObjectModel: {
text.element: ['SalesEmployeeName']
}
@Consumption.semanticObject: 'Employee'
cast( Cust360SlsOrdWithoutCharge._Partner[ PartnerFunction = 'VE' ].Personnel as sales_empl preserving type ) as SalesEmployee,
@Semantics.text:true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOWOC_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as SalesEmployeeName,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@ObjectModel: {
text.element: ['ResponsibleEmployeeName']
}
@Consumption.semanticObject: 'Employee'
cast( Cust360SlsOrdWithoutCharge._Partner[ PartnerFunction = 'ZM' ].Personnel as resp_empl preserving type ) as ResponsibleEmployee,
@Semantics.text: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOWOC_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as ResponsibleEmployeeName,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
Cust360SlsOrdWithoutCharge.PurchaseOrderByCustomer,
@Semantics.businessDate.at: true
Cust360SlsOrdWithoutCharge.RequestedDeliveryDate,
@ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
@ObjectModel.text.element: ['OverallSDProcessStatusDesc']
Cust360SlsOrdWithoutCharge.OverallSDProcessStatus,
Cust360SlsOrdWithoutCharge._OverallSDProcessStatus._Text[1:Language = $session.system_language].OverallSDProcessStatusDesc,
@ObjectModel.foreignKey.association: '_OverallSDDocumentRejectionSts'
@ObjectModel.text.element: ['OvrlSDDocumentRejectionStsDesc']
Cust360SlsOrdWithoutCharge.OverallSDDocumentRejectionSts,
Cust360SlsOrdWithoutCharge._OverallSDDocumentRejectionSts._Text[1:Language = $session.system_language].OvrlSDDocumentRejectionStsDesc,
@ObjectModel:{ foreignKey.association: '_OverallBillingBlockStatus',
text.element: ['OverallBillingBlockStatusDesc']
}
Cust360SlsOrdWithoutCharge.OverallBillingBlockStatus,
Cust360SlsOrdWithoutCharge._OverallBillingBlockStatus._Text[1:Language = $session.system_language].OverallBillingBlockStatusDesc,
@ObjectModel:{ foreignKey.association: '_SalesDocApprovalStatus',
text.element: ['SalesDocApprovalStatusDesc']
}
Cust360SlsOrdWithoutCharge.SalesDocApprovalStatus,
Cust360SlsOrdWithoutCharge._SalesDocApprovalStatus._Text[1:Language = $session.system_language].SalesDocApprovalStatusDesc,
@ObjectModel:{ foreignKey.association: '_OverallChmlCmplncStatus',
text.element: ['OverallChmlCmplncStatusDesc']
}
Cust360SlsOrdWithoutCharge.OverallChmlCmplncStatus,
Cust360SlsOrdWithoutCharge._OverallChmlCmplncStatus._Text[1:Language = $session.system_language].OverallChmlCmplncStatusDesc,
@ObjectModel:{ foreignKey.association: '_OverallDangerousGoodsStatus',
text.element: ['OverallDangerousGoodsStsDesc']
}
Cust360SlsOrdWithoutCharge.OverallDangerousGoodsStatus,
Cust360SlsOrdWithoutCharge._OverallDangerousGoodsStatus._Text[1:Language = $session.system_language].OverallDangerousGoodsStsDesc,
@ObjectModel:{ foreignKey.association: '_OvrlSftyDataSheetSts',
text.element: ['OverallSafetyDataSheetStsDesc']
}
Cust360SlsOrdWithoutCharge.OverallSafetyDataSheetStatus,
Cust360SlsOrdWithoutCharge._OvrlSftyDataSheetSts._Text[1:Language = $session.system_language].OverallSafetyDataSheetStsDesc,
@ObjectModel:{ foreignKey.association: '_OvrlTradeCmplncEmbargoStatus',
text.element: ['OverallTrdCmplncEmbargoStsDesc']
}
cast(Cust360SlsOrdWithoutCharge.OverallTrdCmplncEmbargoSts as totembargochksts preserving type) as OverallTrdCmplncEmbargoSts,
Cust360SlsOrdWithoutCharge._OvrlTradeCmplncEmbargoStatus._Text[1:Language = $session.system_language].OverallTrdCmplncEmbargoStsDesc,
@ObjectModel:{ foreignKey.association: '_OvTrdCmplncSnctndListChkSts',
text.element: ['OvrlTrdCmplncSnctndListStsDesc']
}
cast(Cust360SlsOrdWithoutCharge.OvrlTrdCmplncSnctndListChkSts as totwatchlistscrngchksts preserving type) as OvrlTrdCmplncSnctndListChkSts,
Cust360SlsOrdWithoutCharge._OvTrdCmplncSnctndListChkSts._Text[1:Language = $session.system_language].OvrlTrdCmplncSnctndListStsDesc,
@ObjectModel:{ foreignKey.association: '_OvrlTrdCmplncLegalCtrlChkSts',
text.element: ['OvrlTrdCmplncLglCtrlChkStsDesc']
}
cast(Cust360SlsOrdWithoutCharge.OvrlTrdCmplncLegalCtrlChkSts as totlglctrlchksts preserving type) as OvrlTrdCmplncLegalCtrlChkSts,
Cust360SlsOrdWithoutCharge._OvrlTrdCmplncLegalCtrlChkSts._Text[1:Language = $session.system_language].OvrlTrdCmplncLglCtrlChkStsDesc,
// @Semantics.currencyCode: true
@ObjectModel.text.element: ['CurrencyName']
Cust360SlsOrdWithoutCharge.TransactionCurrency,
Cust360SlsOrdWithoutCharge._TransactionCurrency._Text[1:Language=$session.system_language].CurrencyName,
@Semantics.amount.currencyCode: 'TransactionCurrency'
Cust360SlsOrdWithoutCharge.TotalNetAmount,
Cust360SlsOrdWithoutCharge.SalesOrderWithoutChargeDate,
@ObjectModel:{ foreignKey.association: '_SalesDocumentType',
text.element: ['SalesDocumentTypeName']
}
Cust360SlsOrdWithoutCharge.SalesOrderWithoutChargeType,
_SalesDocumentType._Text[1:Language=$session.system_language].SalesDocumentTypeName,
Cust360SlsOrdWithoutCharge.CreationDate,
Cust360SlsOrdWithoutCharge.LastChangeDate,
// @ObjectModel.filter.enabled: false
// @ObjectModel.readOnly: true
// cast ( ( case TSTMP_IS_VALID(Cust360SlsOrdWithoutCharge.LastChangeDateTime)
// when 0 then cast( dats_tims_to_tstmp( Cust360SlsOrdWithoutCharge.CreationDate, Cust360SlsOrdWithoutCharge.CreationTime, 'UTC', $session.client, 'NULL' ) as last_changed_date_time )
// else Cust360SlsOrdWithoutCharge.LastChangeDateTime
// end ) as last_changed_date_time preserving type ) as LastChangeDateTime,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@ObjectModel.foreignKey.association: '_CreatedByUser'
@ObjectModel.text.element: ['CreatedByUserDescription']
Cust360SlsOrdWithoutCharge.CreatedByUser,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Search.ranking: #HIGH
Cust360SlsOrdWithoutCharge._CreatedByUser.UserDescription as CreatedByUserDescription,
@ObjectModel.foreignKey.association: '_LastChangedByUser'
@ObjectModel.text.element: ['LastChangedByUserDescription']
Cust360SlsOrdWithoutCharge.LastChangedByUser,
Cust360SlsOrdWithoutCharge._LastChangedByUser.UserDescription as LastChangedByUserDescription,
@ObjectModel:{ foreignKey.association: '_SalesOrganization',
text.element: ['SalesOrganizationName']
}
Cust360SlsOrdWithoutCharge.SalesOrganization,
Cust360SlsOrdWithoutCharge._SalesOrganization._Text[1:Language=$session.system_language].SalesOrganizationName,
@ObjectModel:{foreignKey.association: '_DistributionChannel',
text.element: ['DistributionChannelName']
}
Cust360SlsOrdWithoutCharge.DistributionChannel,
Cust360SlsOrdWithoutCharge._DistributionChannel._Text[1:Language=$session.system_language].DistributionChannelName,
@ObjectModel:{foreignKey.association: '_OrganizationDivision',
text.element: ['DivisionName']
}
Cust360SlsOrdWithoutCharge.OrganizationDivision,
Cust360SlsOrdWithoutCharge._OrganizationDivision._Text[1:Language=$session.system_language].DivisionName,
@ObjectModel:{foreignKey.association: '_SalesOffice',
text.element: ['SalesOfficeName']
}
Cust360SlsOrdWithoutCharge.SalesOffice,
Cust360SlsOrdWithoutCharge._SalesOffice._Text[1:Language=$session.system_language].SalesOfficeName,
@ObjectModel:{foreignKey.association: '_SalesGroup',
text.element: ['SalesGroupName']
}
Cust360SlsOrdWithoutCharge.SalesGroup,
Cust360SlsOrdWithoutCharge._SalesGroup._Text[1:Language=$session.system_language].SalesGroupName,
Cust360SlsOrdWithoutCharge.ReferenceSDDocument,
@ObjectModel:{foreignKey.association: '_SDDocumentReason',
text.element: ['SDDocumentReasonText']
}
Cust360SlsOrdWithoutCharge.SDDocumentReason,
Cust360SlsOrdWithoutCharge._SDDocumentReason._Text[1:Language=$session.system_language].SDDocumentReasonText,
@ObjectModel:{foreignKey.association: '_DeliveryBlockReason',
text.element: ['DeliveryBlockReasonText']
}
Cust360SlsOrdWithoutCharge.DeliveryBlockReason,
Cust360SlsOrdWithoutCharge._DeliveryBlockReason._Text[1:Language=$session.system_language].DeliveryBlockReasonText,
@ObjectModel:{foreignKey.association: '_HeaderBillingBlockReason',
text.element: ['BillingBlockReasonDescription']
}
Cust360SlsOrdWithoutCharge.HeaderBillingBlockReason,
Cust360SlsOrdWithoutCharge._HeaderBillingBlockReason._Text[1:Language=$session.system_language].BillingBlockReasonDescription,
cast(
case
when Cust360SlsOrdWithoutCharge.SalesDocApprovalStatus = 'A' then 2 -- | 2: yellow colour
when Cust360SlsOrdWithoutCharge.SalesDocApprovalStatus = 'B' then 3 -- | 3: green colour
when Cust360SlsOrdWithoutCharge.SalesDocApprovalStatus = 'C' then 1 -- | 1: red colour
when Cust360SlsOrdWithoutCharge.SalesDocApprovalStatus = 'D' then 2 -- | 2: yellow colour
else 0 -- | 0: neutral
end as abap.int1
) as SlsOrdApprovalStsCriticality,
//Associations
Cust360SlsOrdWithoutCharge._TransactionCurrency,
Cust360SlsOrdWithoutCharge._OverallSDProcessStatus,
Cust360SlsOrdWithoutCharge._OverallSDDocumentRejectionSts,
_SalesDocumentType,
Cust360SlsOrdWithoutCharge._SalesOrganization,
Cust360SlsOrdWithoutCharge._DistributionChannel,
// _Division,
Cust360SlsOrdWithoutCharge._OrganizationDivision,
Cust360SlsOrdWithoutCharge._SalesOffice,
Cust360SlsOrdWithoutCharge._SalesGroup,
Cust360SlsOrdWithoutCharge._DeliveryBlockReason,
Cust360SlsOrdWithoutCharge._HeaderBillingBlockReason,
_CreatedByUser,
_LastChangedByUser,
Cust360SlsOrdWithoutCharge._SDDocumentReason,
Cust360SlsOrdWithoutCharge._OverallBillingBlockStatus,
Cust360SlsOrdWithoutCharge._SalesDocApprovalStatus,
Cust360SlsOrdWithoutCharge._OverallChmlCmplncStatus,
Cust360SlsOrdWithoutCharge._OverallDangerousGoodsStatus,
Cust360SlsOrdWithoutCharge._OvrlSftyDataSheetSts,
Cust360SlsOrdWithoutCharge._OvrlTradeCmplncEmbargoStatus,
Cust360SlsOrdWithoutCharge._OvTrdCmplncSnctndListChkSts,
Cust360SlsOrdWithoutCharge._OvrlTrdCmplncLegalCtrlChkSts,
//cfd-2208
Cust360SlsOrdWithoutCharge._SoldToParty
}
where
Cust360SlsOrdWithoutCharge.CreationDate > dats_add_days( tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), -Customer360BusDocSetting.BusDocumentDurationInDays, 'INITIAL')
and Cust360SlsOrdWithoutCharge.CreationDate <= $session.system_date