@AbapCatalog: {
sqlViewName: 'CBDREDACTED',
compiler.compareFilter: true,
preserveKey: true
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.allowExtensions: true
@ObjectModel: {
semanticKey: ['BillingDocument'],
usageType: {
serviceQuality: #D,
sizeCategory: #XL,
dataClass: #MIXED
}
}
@Search.searchable: true
@VDM.viewType: #CONSUMPTION
define view C_BillgDocRedacted as select from I_BillingDocument as BillingDocument
left outer to one join I_Customer_to_BusinessPartner as SoldToPartyCustomerToBuPa on BillingDocument.SoldToParty = SoldToPartyCustomerToBuPa.Customer
left outer to one join I_BusinessPartner as SoldToPartyBuPa on SoldToPartyCustomerToBuPa.BusinessPartnerUUID = SoldToPartyBuPa.BusinessPartnerUUID
left outer to one join I_BuPaIdentification as SoldToPartyBuPaIdentification on SoldToPartyBuPa.BusinessPartner = SoldToPartyBuPaIdentification.BusinessPartner and SoldToPartyBuPaIdentification.BPIdentificationType = 'BPCU01'
left outer to one join I_Customer_to_BusinessPartner as PayerCustomerToBuPa on BillingDocument.PayerParty = PayerCustomerToBuPa.Customer
left outer to one join I_BusinessPartner as PayerBuPa on PayerCustomerToBuPa.BusinessPartnerUUID = PayerBuPa.BusinessPartnerUUID
left outer to one join I_BuPaIdentification as PayerBuPaIdentification on PayerBuPa.BusinessPartner = PayerBuPaIdentification.BusinessPartner and PayerBuPaIdentification.BPIdentificationType = 'BPCU01'
left outer to one join I_BillingDocumentPartner as BillToPartyPartner on BillingDocument.BillingDocument = BillToPartyPartner.BillingDocument and BillToPartyPartner.PartnerFunction = 'RE'
left outer to one join I_Customer_to_BusinessPartner as BillToPartyCustomerToBuPa on BillToPartyPartner.Customer = BillToPartyCustomerToBuPa.Customer
left outer to one join I_BusinessPartner as BillToPartyBuPa on BillToPartyCustomerToBuPa.BusinessPartnerUUID = BillToPartyBuPa.BusinessPartnerUUID
left outer to one join I_BuPaIdentification as BillToPartyBuPaIdentification on BillToPartyBuPa.BusinessPartner = BillToPartyBuPaIdentification.BusinessPartner and BillToPartyBuPaIdentification.BPIdentificationType = 'BPCU01'
association [0..1] to C_SalesDocPaymentMethodVH as _PaymentMethod on $projection.PaymentMethod = _PaymentMethod.PaymentMethod and $projection.CompanyCode = _PaymentMethod.BillingCompanyCode
association [0..*] to C_BillgDocItemRedacted as _Item on $projection.BillingDocument = _Item.BillingDocument {
key BillingDocument.BillingDocument,
BillingDocument.BillingDocumentType,
BillingDocument._BillingDocumentType._Text[1: Language=$session.system_language].BillingDocumentTypeName as BillingDocumentTypeName,
PayerBuPaIdentification.BPIdentificationNumber as PayerParty,
BillingDocument.OverallBillingStatus,
BillToPartyBuPaIdentification.BPIdentificationNumber as BillToParty,
SoldToPartyBuPaIdentification.BPIdentificationNumber as SoldToParty,
BillingDocument.CompanyCode,
BillingDocument.SalesOrganization,
BillingDocument.DistributionChannel,
BillingDocument.Division,
BillingDocument.BillingDocumentDate,
@ObjectModel: {
foreignKey.association: '_PaymentMethod'
}
BillingDocument.PaymentMethod,
BillingDocument.CustomerPaymentTerms,
BillingDocument.IncotermsVersion,
BillingDocument.IncotermsClassification,
BillingDocument.IncotermsLocation1,
BillingDocument.IncotermsLocation2,
cast(BillingDocument.DocumentReferenceID as xblnr_v1_case_sensitive ) as DocumentReferenceID,
BillingDocument.AssignmentReference,
BillingDocument.TotalTaxAmount,
BillingDocument.TotalNetAmount,
BillingDocument._EnhancedFields.TotalGrossAmount,
BillingDocument.TransactionCurrency,
cast(BillingDocument.AccountingDocument as accounting_document_number preserving type ) as AccountingDocument,
BillingDocument.FiscalYear,
BillingDocument.CancelledBillingDocument,
BillingDocument.BillingIssueType,
// Taxes
BillingDocument.Country,
BillingDocument.TaxDepartureCountry,
BillingDocument.CustomerTaxClassification1,
BillingDocument.CustomerTaxClassification2,
BillingDocument.CustomerTaxClassification3,
BillingDocument.CustomerTaxClassification4,
BillingDocument.CustomerTaxClassification5,
BillingDocument.CustomerTaxClassification6,
BillingDocument.CustomerTaxClassification7,
BillingDocument.CustomerTaxClassification8,
BillingDocument.CustomerTaxClassification9,
BillingDocument.CityCode,
BillingDocument.County,
BillingDocument.Region,
BillingDocument.VATRegistrationCountry,
BillingDocument.VATRegistrationOrigin,
BillingDocument.IsEUTriangularDeal,
@Search.defaultSearchElement: false
BillingDocument._CompanyCode,
@Search.defaultSearchElement: false
BillingDocument._SalesOrganization,
@Search.defaultSearchElement: false
BillingDocument._DistributionChannel,
@Search.defaultSearchElement: false
BillingDocument._Division,
@Search.defaultSearchElement: false
BillingDocument._CustomerPaymentTerms,
@Search.defaultSearchElement: false
BillingDocument._IncotermsVersion,
@Search.defaultSearchElement: false
BillingDocument._IncotermsClassification,
@Search.defaultSearchElement: false
BillingDocument._BillingDocumentType,
@Search.defaultSearchElement: false
BillingDocument._OverallBillingStatus,
@Search.defaultSearchElement: false
BillingDocument._BillingIssueType,
@Search.defaultSearchElement: false
BillingDocument._Country,
@Search.defaultSearchElement: false
BillingDocument._TaxDepartureCountry,
@Search.defaultSearchElement: false
BillingDocument._CityCode,
@Search.defaultSearchElement: false
BillingDocument._County_2,
@Search.defaultSearchElement: false
BillingDocument._Region,
@Search.defaultSearchElement: false
BillingDocument._VATRegistrationCountry,
@Search.defaultSearchElement: false
BillingDocument._VATRegistrationOrigin,
@Search.defaultSearchElement: false
_PaymentMethod,
@Search.defaultSearchElement: false
_Item
}
where BillingDocument.BillingDocumentIsTemporary = ' ' and
BillingDocument.BillingDocumentCategory <> 'R'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCENHANCEDFIELDS",
"I_BILLINGDOCUMENT",
"I_BILLINGDOCUMENTPARTNER",
"I_BILLINGDOCUMENTTYPE",
"I_BILLINGDOCUMENTTYPETEXT",
"I_BUPAIDENTIFICATION",
"I_BUSINESSPARTNER",
"I_CUSTOMER_TO_BUSINESSPARTNER"
],
"ASSOCIATED":
[
"C_BILLGDOCITEMREDACTED",
"C_SALESDOCPAYMENTMETHODVH",
"I_BILLINGDOCUMENTTYPE",
"I_BILLINGISSUETYPE",
"I_CITYCODE",
"I_COMPANYCODE",
"I_COUNTRY",
"I_CUSTOMERPAYMENTTERMS",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_INCOTERMSCLASSIFICATION",
"I_INCOTERMSVERSION",
"I_OVERALLBILLINGSTATUS",
"I_REGION",
"I_SALESORGANIZATION",
"I_TAXINGCOUNTY",
"I_VATREGISTRATIONORIGIN"
],
"BASE":
[
"I_BILLINGDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/