P_NZ_StRpTaxReturnBox

DDL: P_NZ_STRPTAXRETURNBOX SQL: PNZSRTAXRETBOX Type: view COMPOSITE

New Zealand specific base view for TaxBox Reporting

P_NZ_StRpTaxReturnBox is a Composite CDS View that provides data about "New Zealand specific base view for TaxBox Reporting" in SAP S/4HANA. It reads from 1 data source (I_StRpTaxReturnBoxCube) and exposes 17 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, TaxCode.

Data Sources (1)

SourceAliasJoin Type
I_StRpTaxReturnBoxCube I_StRpTaxReturnBoxCube from

Parameters (6)

NameTypeDefault
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

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PNZSRTAXRETBOX view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label New Zealand specific base view for TaxBox Reporting view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
AbapCatalog.preserveKey true view
VDM.private true view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode CompanyCode
KEY AccountingDocument AccountingDocument
KEY FiscalYear FiscalYear
KEY TaxItem TaxItem
KEY TaxCode TaxCode
KEY TransactionTypeDetermination TransactionTypeDetermination
KEY TaxBox TaxBox
KEY Country Country
KEY TaxDeclnAmountType TaxDeclnAmountType
KEY ValidFrom ValidFrom
keyUnifiedTaxBoxStructureType
KEY StatryRptgEntity StatryRptgEntity
KEY StatryRptCategory StatryRptCategory
KEY StatryRptRunID StatryRptRunID
TaxType TaxType
DebitCreditCode DebitCreditCode
ReportingCurrency ReportingCurrency
@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":""
}
}*/