@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label : 'Customer 360 Invoice'
@Metadata.allowExtensions: true
@Search.searchable: true
@ObjectModel: {
// compositionRoot: true ,
// representativeKey: 'SalesDocument',
usageType: {
dataClass: #MIXED,
serviceQuality: #C,
sizeCategory: #XXL
}
}
@VDM.viewType: #CONSUMPTION
define view entity C_Customer360Invoice
as select from I_BillingDocument as Invoice
inner join I_Customer360BusDocSetting as Customer360BusDocSetting on Customer360BusDocSetting.Cust360BusDocCategory = 'M'
and Customer360BusDocSetting.BusinessDocumentIsEnabled = 'X'
and Invoice.SDDocumentCategory = 'M'
association [0..1] to I_OverallBillingStatus as _OverallBillingStatus on $projection.OverallBillingStatus = _OverallBillingStatus.OverallBillingStatus
{
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold : 0.8
@Search.ranking: #HIGH
key Invoice.BillingDocument as BillingDocument,
@ObjectModel.text.element: ['CustomerName']
@ObjectModel.foreignKey.association : '_SoldToParty'
Invoice.SoldToParty,
@UI.hidden: true
Invoice._SoldToParty.CustomerName as CustomerName,
@UI.hidden: true
Invoice._BillingDocumentType._Text[1:Language = $session.system_language].BillingDocumentTypeName as BillingDocumentTypeName,
@ObjectModel.text.element: ['BillingDocumentTypeName']
Invoice.BillingDocumentType,
@UI.hidden: true
_OverallBillingStatus._Text[1:Language = $session.system_language].OverallBillingStatusDesc as OverallBillingStatusDesc,
@ObjectModel.text.element: ['OverallBillingStatusDesc']
Invoice.OverallBillingStatus,
Invoice.BillingDocumentDate,
Invoice.CreationDate,
// For DCL
@ObjectModel.text.element: ['SalesOrganizationName']
Invoice.SalesOrganization,
@UI.hidden: true
Invoice._SalesOrganization._Text[1:Language = $session.system_language].SalesOrganizationName as SalesOrganizationName,
//@Semantics.currencyCode: true
// @Consumption.valueHelpDefinition: [ { entity : { name: 'I_CurrencyStdVH',
// element: 'Currency' } } ]
Invoice.TotalNetAmount,
@ObjectModel.text.element: ['CurrencyName']
@ObjectModel.foreignKey.association : '_TransactionCurrency'
Invoice.TransactionCurrency,
@UI.hidden: true
Invoice._TransactionCurrency._Text[1:Language = $session.system_language].CurrencyName as CurrencyName,
Invoice._SoldToParty,
Invoice._OverallBillingStatus,
Invoice._BillingDocumentType,
Invoice._TransactionCurrency
}
where
Invoice.CreationDate > dats_add_days( tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL ' ), $session.client, 'NULL '), -Customer360BusDocSetting.BusDocumentDurationInDays, 'INITIAL')
and Invoice.CreationDate <= $session.system_date
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_BILLINGDOCUMENT",
"I_BILLINGDOCUMENTTYPE",
"I_BILLINGDOCUMENTTYPETEXT",
"I_CURRENCY",
"I_CURRENCYTEXT",
"I_CUSTOMER",
"I_CUSTOMER360BUSDOCSETTING",
"I_OVERALLBILLINGSTATUS",
"I_OVERALLBILLINGSTATUSTEXT",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONTEXT"
],
"ASSOCIATED":
[
"I_BILLINGDOCUMENTTYPE",
"I_CURRENCY",
"I_CUSTOMER",
"I_OVERALLBILLINGSTATUS"
],
"BASE":
[
"I_BILLINGDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
C_Customer360Invoice view_entity