@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@AccessControl.personalData.blockingIndicator: [ 'IsBusinessPurposeCompleted' ]
@EndUserText.label: 'Customer 360'
@Metadata.allowExtensions: true
@ObjectModel: {
// compositionRoot: true,
// representativeKey: 'SalesDocument',
usageType: {
dataClass: #MASTER,
serviceQuality: #C,
sizeCategory: #XL
}
}
@VDM.viewType: #CONSUMPTION
@Search.searchable: true
@Consumption.dbHints: [ 'USE_HEX_PLAN' ]
define view entity C_Customer360
// with parameters
//@Consumption.valueHelpDefinition: [{ entity:{ name: 'C_CurrencyValueHelp', element: 'Currency' }, label: 'Display Currency' }]
// P_DisplayCurrency : vdm_v_display_currency
as select from I_Customer as Customer
association [1..*] to C_Customer360RecentBusDoc as _Customer360RecentBusDoc on $projection.Customer = _Customer360RecentBusDoc.SoldToParty
association [1..*] to C_Customer360FulfillmentIssue as _Customer360FulfillmentIssue on $projection.Customer = _Customer360FulfillmentIssue.SoldToParty
// Removed because of no usage
// association [1..*] to C_Cust360FulfillmentIssueCnt as _Cust360FulfillmentIssueCnt on $projection.Customer = _Cust360FulfillmentIssueCnt.SoldToParty
association [1..*] to C_Customer360ApprovalBusDoc as _Cust360ApprovalBusDoc on $projection.Customer = _Cust360ApprovalBusDoc.SoldToParty
association [1..*] to C_Customer360ServiceQuotation as _Cust360ServiceQuotation on $projection.Customer = _Cust360ServiceQuotation.SoldToParty
association [1..*] to C_Customer360SalesOrder as _Cust360SalesOrder on $projection.Customer = _Cust360SalesOrder.SoldToParty
association [1..*] to C_Customer360ServiceContract as _Cust360ServiceContract on $projection.Customer = _Cust360ServiceContract.SoldToParty
association [1..*] to C_Customer360SolutionOrder as _Cust360SolutionOrder on $projection.Customer = _Cust360SolutionOrder.SoldToParty
association [1..*] to C_Customer360ServiceOrder as _Cust360ServiceOrder on $projection.Customer = _Cust360ServiceOrder.SoldToParty
association [1..*] to C_Customer360InternalContact as _Customer360InternalContact on $projection.Customer = _Customer360InternalContact.Customer
association [1..*] to C_Customer360ExternalContact as _Customer360ExternalContact on $projection.Customer = _Customer360ExternalContact.Customer
association [1..*] to C_Cust360RecentDeliveryDoc as _Cust360RecentDelivery on $projection.Customer = _Cust360RecentDelivery.SoldToParty
association [1..*] to C_Customer360SalesContract as _Cust360SalesContract on $projection.Customer = _Cust360SalesContract.SoldToParty
association [1..*] to C_Cust360SalesSchedgAgrmt as _Cust360SalesSchedgAgrmt on $projection.Customer = _Cust360SalesSchedgAgrmt.SoldToParty
association [1..*] to C_Customer360SalesQuotation as _Customer360SalesQuotation on $projection.Customer = _Customer360SalesQuotation.SoldToParty
association [1..*] to C_Customer360CreditMemoRequest as _Customer360CreditMemoRequest on $projection.Customer = _Customer360CreditMemoRequest.SoldToParty
association [1..*] to C_Cust360SlsOrdWithoutCharge as _Cust360SlsOrdWithoutCharge on $projection.Customer = _Cust360SlsOrdWithoutCharge.SoldToParty
association [1..*] to C_Customer360DebitMemoRequest as _Customer360DebitMemoRequest on $projection.Customer = _Customer360DebitMemoRequest.SoldToParty
association [1..*] to C_Customer360CustomerReturn as _Cust360CustomerReturn on $projection.Customer = _Cust360CustomerReturn.SoldToParty
association [1..*] to C_Customer360DeliveryDocument as _Customer360DeliveryDocument on $projection.Customer = _Customer360DeliveryDocument.ShipToParty
association [1..*] to C_Customer360Invoice as _Customer360Invoice on $projection.Customer = _Customer360Invoice.SoldToParty
association [1..*] to C_Customer360CancelledInvoice as _Customer360CancelledInvoice on $projection.Customer = _Customer360CancelledInvoice.SoldToParty
association [1..*] to C_Customer360InvoiceList as _Customer360InvoiceList on $projection.Customer = _Customer360InvoiceList.SoldToParty
association [1..*] to C_Cust360BillingDocReq as _Cust360BillingDocReq on $projection.Customer = _Cust360BillingDocReq.SoldToParty
association [1..*] to C_Cust360PreliminaryBillDoc as _Cust360PreliminaryBillDoc on $projection.Customer = _Cust360PreliminaryBillDoc.SoldToParty
association [0..*] to I_Customer360BusDocSetting as _Customer360BusDocSetting on _Customer360BusDocSetting.BusinessDocumentIsEnabled = 'X'
association [1..*] to C_Customer360SalesArea as _Customer360SalesArea on $projection.Customer = _Customer360SalesArea.Customer
association [1..*] to C_Cust360SoldProductWithPrice as _Cust360SoldProductEnt on $projection.Customer = _Cust360SoldProductEnt.SoldToParty
//association [1..*] to C_Cust360BizPartnerAddress as _Cust360BizPartnerAddress on $projection.Customer = _Cust360BizPartnerAddress.Customer
association [1..1] to I_Customer360GeneralSetting as _Customer360GeneralSetting on _Customer360GeneralSetting.CustomerViewProfileName = 'CUSTPROFL'
association [1..1] to I_CountryVH as _CountryVH on $projection.Country = _CountryVH.Country
association [0..1] to I_BPStreetValueHelpTmp as _StreetValueHelpTmp on $projection.Country = _StreetValueHelpTmp.Country
and $projection.StreetName = _StreetValueHelpTmp.StreetName
and $projection.CityName = _StreetValueHelpTmp.BusinessPartnerCityCode
association [0..1] to C_Q2CCustomerQuickView as _SoldToParty on $projection.Customer = _SoldToParty.Customer
// association [0..1] to I_PostalCity as _PostalCity on $projection.CityCode = _PostalCity.CityNumber
// and $projection.Country = _PostalCity.Country
{
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Consumption: {
semanticObject: 'Customer'
}
@ObjectModel: {
foreignKey.association: '_SoldToParty',
text.element: ['CustomerName']
}
key Customer,
@UI.hidden: true
@Consumption.filter.hidden: true
//@Search:{ defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.9}
_CustomerToBusinessPartner.BusinessPartnerUUID as BusinessPartnerUUID,
@UI.hidden: true
@Consumption.filter.hidden: true
_CustomerToBusinessPartner._BusinessPartner.BusinessPartnerType,
@UI.hidden: true
@Consumption.filter.hidden: true
_CustomerToBusinessPartner._BusinessPartner.BusinessPartnerCategory as BusinessPartnerCategory,
@Semantics.imageUrl: true
@Consumption.filter.hidden: true
@UI.hidden: true
cast (
case
when _CustomerToBusinessPartner._BusinessPartner.BusinessPartnerCategory = '1'
then 'sap-icon://customer'
else 'sap-icon://building'
end as abap.sstring( 500 ) ) as BusinessPartnerImageURL,
// @UI.hidden: true
// $parameters.P_DisplayCurrency as DisplayCurrency,
@UI.hidden: true
cast( 'EUR' as vdm_v_display_currency ) as DisplayCurrency,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@Semantics.amount.currencyCode: 'DisplayCurrency'
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('0' as abap.curr( 15, 2 )) as SlsVolumeNetAmtInDspCrcy,
@EndUserText.label: 'Sales Quotation Active flag'
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'B'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360SalesQuotationIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'C'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Customer360SalesOrderIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'E'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360SlsSchedAgrmtIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'G'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360SalesContractIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'H'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360CustomerReturnIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'I'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360SlsOrdWthoutChrgIsActv,
cast(case
when _Customer360BusDocSetting[1:Cust360BusDocCategory = 'B'].BusinessDocumentIsEnabled ='' and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'C'].BusinessDocumentIsEnabled ='' and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'E'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'G'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'H'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'I'].BusinessDocumentIsEnabled =''
then 'X'
else ''
end as boole_d ) as Customer360SalesIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'J'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360OutbDeliveryIsActive,
cast( case
when _Customer360BusDocSetting[1:Cust360BusDocCategory = 'J'].BusinessDocumentIsEnabled =''
then 'X'
else ''
end as boole_d ) as Customer360DeliveryIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'K'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360CreditMemoReqIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'L'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360DbtMemoRequestIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'M'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Customer360InvoiceIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'N'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360CancldInvoiceIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = '3'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Customer360InvoiceListIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'EBDR'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360BillgDocRequestIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'PBD'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360PrelimBillgDocIsActive,
cast(case
when _Customer360BusDocSetting[1:Cust360BusDocCategory = 'K'].BusinessDocumentIsEnabled ='' and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'L'].BusinessDocumentIsEnabled ='' and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'M'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'N'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = '3'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'EBDR'].BusinessDocumentIsEnabled =''and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'PBD'].BusinessDocumentIsEnabled =''
then 'X'
else ''
end as boole_d ) as Customer360BillingIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'SVQ'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360SrvcQuotationIsActive,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'SVO'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360ServiceOrderIsActive,
// The pattern of "isActive" is not proper, as the field is used to hide the facet
// So for this new doc type we use "IsHidden" which is semantically correct.
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'SVC'].BusinessDocumentIsEnabled
when 'X'
then ''
else 'X'
end as boole_d ) as Cust360SrvcContractIsHidden,
cast( case _Customer360BusDocSetting[1:Cust360BusDocCategory = 'SOLO'].BusinessDocumentIsEnabled
when 'X' then ''
else 'X'
end as boole_d ) as Cust360SolutionOrderIsHidden,
cast( case
when _Customer360BusDocSetting[1:Cust360BusDocCategory = 'SVQ'].BusinessDocumentIsEnabled ='' and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'SVO'].BusinessDocumentIsEnabled ='' and
_Customer360BusDocSetting[1:Cust360BusDocCategory = 'SVC'].BusinessDocumentIsEnabled =''
then 'X'
else ''
end as boole_d ) as Customer360ServiceIsActive,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteSlsQtanIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteSalesOrderIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360SlsSchedAgrmtIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteSlsContractIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteCustReturnIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360OrdWthoutChrgIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteCrdtMemoReqIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteDbtMemoReqIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteSrvcQtanIsAuthzd,
@Consumption.filter.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast('' as boole_d ) as Cust360CrteSrvcOrdIsAuthzd,
@UI.lineItem: [{ hidden: true }]
CustomerName,
@Search:{ defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.9}
@ObjectModel.text.element: ['CustomerStreetName']
StreetName,
@UI.hidden: true
_StreetValueHelpTmp._Text[1:Language = $session.system_language ].StreetName as CustomerStreetName,
PostalCode,
// @ObjectModel.text.element: ['CityName']
CityName,
@ObjectModel.text.element: ['CountryName']
Country,
@UI.hidden: true
_CountryVH.Description as CountryName,
@Consumption.filter.hidden: true
@ObjectModel.text.element: ['AddressLine1']
AddressID,
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast( ' ' as ad_line_s) as AddressLine1,
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast( ' ' as ad_line_s) as AddressLine2,
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_ADVNCD_CUST360_UI_UTIL'
cast( ' ' as ad_line_s) as AddressLine3,
@ObjectModel.virtualElement:true
@ObjectModel.filter.transformedBy: 'ABAP:CL_SD_ADVNCD_CUST360_FLT_TRANS'
@UI.lineItem: [{ hidden: true }]
@ObjectModel.text.element: [ 'SalesOrganizationName' ]
cast( ' ' as vkorg) as SalesOrganization,
@UI.hidden: true
@Consumption.filter.hidden: true
cast( ' ' as vkorg) as SalesOrganizationName,
@ObjectModel.virtualElement:true
@ObjectModel.filter.transformedBy: 'ABAP:CL_SD_ADVNCD_CUST360_FLT_TRANS'
@UI.lineItem: [{ hidden: true }]
@ObjectModel.text.element: [ 'DistributionChannelName' ]
cast( ' ' as vtweg) as DistributionChannel,
@UI.hidden: true
@Consumption.filter.hidden: true
cast( ' ' as vtweg) as DistributionChannelName,
@ObjectModel.virtualElement:true
@ObjectModel.filter.transformedBy: 'ABAP:CL_SD_ADVNCD_CUST360_FLT_TRANS'
@UI.lineItem: [{ hidden: true }]
@ObjectModel.text.element: [ 'DivisionName' ]
cast( ' ' as spart) as Division,
@UI.hidden: true
@Consumption.filter.hidden: true
cast( ' ' as spart) as DivisionName,
@ObjectModel.virtualElement:true
@ObjectModel.filter.transformedBy: 'ABAP:CL_SD_ADVNCD_CUST360_FLT_TRANS'
@UI.lineItem: [{ hidden: true }]
@ObjectModel.text.element: [ 'SalesGroupName' ]
cast( ' ' as vkgrp) as SalesGroup,
@UI.hidden: true
@Consumption.filter.hidden: true
cast( ' ' as vkgrp) as SalesGroupName,
@ObjectModel.virtualElement:true
@ObjectModel.filter.transformedBy: 'ABAP:CL_SD_ADVNCD_CUST360_FLT_TRANS'
@ObjectModel.text.element: [ 'SalesOfficeName' ]
@UI.lineItem: [{ hidden: true }]
cast( ' ' as vkbur) as SalesOffice,
@UI.hidden: true
@Consumption.filter.hidden: true
cast( ' ' as vkbur) as SalesOfficeName,
@Consumption.filter.hidden: true
@UI.hidden: true
AuthorizationGroup,
@Consumption.filter.hidden: true
@UI.hidden: true
CustomerAccountGroup,
@UI.hidden: true
IsBusinessPurposeCompleted,
@UI.hidden: true
OrganizationBPName1,
@UI.hidden: true
OrganizationBPName2,
/*Fields for DCL - BP Data Contoller*/
@Consumption.hidden:true
@UI.hidden:true
Customer.DataControllerSet,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController1,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController2,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController3,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController4,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController5,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController6,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController7,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController8,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController9,
@Consumption.hidden:true
@UI.hidden:true
Customer.DataController10,
// _ExchangeRateType,
@ObjectModel.filter.enabled: false
_Customer360RecentBusDoc,
_Customer360FulfillmentIssue,
_Customer360BusDocSetting,
// _Cust360RecentBusinessDocs,
_CustomerToBusinessPartner,
_Cust360ApprovalBusDoc,
_Cust360ServiceQuotation,
_Cust360ServiceContract,
_Cust360SolutionOrder,
_Cust360SalesOrder,
_Cust360ServiceOrder,
_Customer360InternalContact,
_Customer360ExternalContact,
_Cust360RecentDelivery,
_Cust360SalesContract,
_Cust360SalesSchedgAgrmt,
_Customer360SalesQuotation,
_Customer360CreditMemoRequest,
_Customer360DebitMemoRequest,
_Cust360SlsOrdWithoutCharge,
_Customer360DeliveryDocument,
_Customer360Invoice,
_Customer360CancelledInvoice,
_Customer360InvoiceList,
_Cust360CustomerReturn,
_Cust360BillingDocReq,
_Cust360PreliminaryBillDoc,
_Customer360SalesArea,
@ObjectModel.filter.enabled: false
_Cust360SoldProductEnt,
@ObjectModel.filter.enabled: false
//_Cust360BizPartnerAddress,
_Customer360GeneralSetting,
_SoldToParty,
@ObjectModel.filter.enabled: false
@UI.lineItem: [{hidden: true}]
@UI.hidden: true
_StreetValueHelpTmp
}