@AbapCatalog.sqlViewName: 'PPLSAFTTAXITMAGG'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_PL_SAFTTaxItemAgg
as select from P_PL_SAFTTaxItemBasicAgg as a
left outer to one join P_PL_SAFTDocumentItemText as t on t.CompanyCode = a.CompanyCode
and t.AccountingDocument = a.AccountingDocument
and t.FiscalYear = a.FiscalYear
association [0..1] to I_Country as _Country on $projection.BusinessPartnerCountry = _Country.Country
{
key a.TaxType,
key a.CompanyCode,
key a.AccountingDocument,
key a.FiscalYear,
a.PL_SAFTTaxAmountBox,
a.PL_SAFTBaseAmountBoxMultiple,
a.PL_SAFTDocumentType,
a.PL_SAFTTaxItemHasMarginAmount,
a.PL_SAFTAddlClassification,
a.PL_SAFTInvcExclRsnFromTotals,
a.TaxReportingDate,
a.TaxReturnCountry,
a.TaxCalculationProcedure,
a.Customer,
a.Supplier,
a.ReferenceDocumentType,
a.OriginalReferenceDocument,
t.DocumentItemText,
a.BusinessPartnerCountry,
a.VATRegistration,
a.BusinessPartnerName,
a.CustomerSupplierAddress,
a.DocumentReferenceID,
a.DocumentDate,
@Semantics.currencyCode: true
a.CompanyCodeCurrency,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
sum(a.TaxAmountInCoCodeCrcy) as TaxAmountInCoCodeCrcy,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
sum(a.TaxBaseAmountInCoCodeCrcy) as TaxBaseAmountInCoCodeCrcy,
@Semantics.currencyCode:true
a.DocumentCurrency,
@Semantics.amount.currencyCode: 'DocumentCurrency'
sum(a.TaxBaseAmountInCountryCrcy) as TaxBaseAmountInCountryCrcy,
@Semantics.amount.currencyCodes : 'DocumentCurrency'
sum(a.TaxAmountInCountryCrcy) as TaxAmountInCountryCrcy,
a._AccountingDocument,
_Country
}
group by
a.TaxType,
a.CompanyCode,
a.AccountingDocument,
a.FiscalYear,
a.PL_SAFTTaxAmountBox,
a.PL_SAFTBaseAmountBoxMultiple,
a.TaxReportingDate,
a.TaxReturnCountry,
a.TaxCalculationProcedure,
a.Customer,
a.Supplier,
a.ReferenceDocumentType,
a.OriginalReferenceDocument,
t.DocumentItemText,
a.BusinessPartnerCountry,
a.VATRegistration,
a.BusinessPartnerName,
a.CustomerSupplierAddress,
a.DocumentReferenceID,
a.DocumentDate,
a.CompanyCodeCurrency,
a.DocumentCurrency,
a.PL_SAFTDocumentType,
a.PL_SAFTTaxItemHasMarginAmount,
a.PL_SAFTAddlClassification,
a.PL_SAFTInvcExclRsnFromTotals
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_PL_SAFTDOCUMENTITEMTEXT",
"P_PL_SAFTTAXITEMBASICAGG"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENT",
"I_COUNTRY"
],
"BASE":
[
"P_PL_SAFTTAXITEMBASICAGG"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/