@AbapCatalog.sqlViewName : 'PNZSRTAXRETBOX'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
--@EndUserText.label : 'New Zealand specific base view for TaxBox Reporting'
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #P
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AbapCatalog.preserveKey: true
@VDM.private: true
define view P_NZ_StRpTaxReturnBox
with parameters
P_FromReportingDate : figen_rep_date_from,
P_ToReportingDate : figen_rep_date_to,
P_StatryRptgEntity : srf_reporting_entity,
P_StatryRptCategory : srf_rep_cat_id,
P_StatryRptRunID : srf_report_run_id,
P_ReportingCountry : land1
as select from I_StRpTaxReturnBoxCube ( P_TaxIsDeferredRelevant : 'N',
P_TaxIsMossRelevant : 'N',
P_StatryRptgEntity : :P_StatryRptgEntity ,
P_StatryRptCategory : :P_StatryRptCategory,
P_StatryRptRunID : :P_StatryRptRunID,
P_ReportingCountry : :P_ReportingCountry,
P_TaxBoxConfiguration : '1'
)
{
key CompanyCode,
key AccountingDocument,
key FiscalYear,
key TaxItem,
key TaxCode,
key TransactionTypeDetermination,
key TaxBox,
key Country,
key TaxDeclnAmountType,
key ValidFrom,
--key UnifiedTaxBoxStructureType,
key StatryRptgEntity,
key StatryRptCategory,
key StatryRptRunID,
TaxType,
DebitCreditCode,
--handling the negative posting as debitcreditcode will get switch in case of negative posting
cast (case
when TaxType = 'A' and DebitCreditCode = 'H' and AmountInReportingCurrency < 0 and ( IsNegativePosting = '' or IsNegativePosting = ' ' or IsNegativePosting is null )
then -AmountInReportingCurrency
when TaxType = 'V' and DebitCreditCode = 'S' and AmountInReportingCurrency < 0 and ( IsNegativePosting = '' or IsNegativePosting = ' ' or IsNegativePosting is null )
then -AmountInReportingCurrency
when TaxType = 'A' and DebitCreditCode = 'S' and AmountInReportingCurrency > 0 and ( IsNegativePosting = '' or IsNegativePosting = ' ' or IsNegativePosting is null )
then -AmountInReportingCurrency
when TaxType = 'V' and DebitCreditCode = 'H' and AmountInReportingCurrency > 0 and ( IsNegativePosting = '' or IsNegativePosting = ' ' or IsNegativePosting is null )
then -AmountInReportingCurrency
when TaxType = 'A' and DebitCreditCode = 'S' and AmountInReportingCurrency < 0 and IsNegativePosting = 'X'
then -AmountInReportingCurrency
when TaxType = 'V' and DebitCreditCode = 'H' and AmountInReportingCurrency < 0 and IsNegativePosting = 'X'
then -AmountInReportingCurrency
when TaxType = 'A' and DebitCreditCode = 'H' and AmountInReportingCurrency > 0 and IsNegativePosting = 'X'
then -AmountInReportingCurrency
when TaxType = 'V' and DebitCreditCode = 'S' and AmountInReportingCurrency > 0 and IsNegativePosting = 'X'
then -AmountInReportingCurrency
else
AmountInReportingCurrency
end as glo_amount_rptg_crcy ) as AmountInReportingCurrency ,
ReportingCurrency
}
where ValidFrom <= $parameters .P_FromReportingDate and
ValidTo >= $parameters .P_FromReportingDate
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_STRPTAXRETURNBOXCUBE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_NZ_StRpTaxReturnBox view