P_HR_StRpTaxReturnBox

DDL: P_HR_STRPTAXRETURNBOX Type: view_entity COMPOSITE

Croatia Tax return

P_HR_StRpTaxReturnBox is a Composite CDS View that provides data about "Croatia Tax return" in SAP S/4HANA. It reads from 1 data source (I_StRpTaxReturnBoxCube) and exposes 65 fields with key fields CompanyCode, AccountingDocument, FiscalYear, TaxItem, StatryRptgEntity. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_StRpTaxReturnBoxCube I_StRpTaxReturnBoxCube from

Parameters (11)

NameTypeDefault
P_StatryRptgEntity srf_reporting_entity
P_StatryRptCategory srf_rep_cat_id
P_StatryRptRunID srf_report_run_id
P_ReportingCountry land1
P_TaxIsDeferredRelevant figen_deferred_check
P_TaxIsMossRelevant figen_moss_check
P_TaxBoxConfiguration figen_tdt_taxbox_config
P_FromReportingDate fis_period_date_from
P_ToReportingDate fis_period_date_to
P_SequenceCategory fiisvat_hr_seq_type
P_TaxBoxStructureType fot_atr_tax_box_struct_type

Associations (5)

CardinalityTargetAliasCondition
[0..1] P_HR_DefTaxItem _DefTaxItem TaxReturn.CompanyCode = _DefTaxItem.CompanyCode and TaxReturn.AccountingDocument = _DefTaxItem.TaxTransferDocument and TaxReturn.FiscalYear = _DefTaxItem.TaxTransferDocumentYear and _DefTaxItem.ClearingAccountingDocument is not initial and _DefTaxItem.CAReversalDocumentNumber is initial
[0..1] P_HR_DefTaxItem _DefTaxTransfer TaxReturn.CompanyCode = _DefTaxTransfer.CompanyCode and TaxReturn.AccountingDocument = _DefTaxTransfer.AccountingDocument and TaxReturn.FiscalYear = _DefTaxTransfer.FiscalYear and _DefTaxTransfer.ClearingAccountingDocument is not initial and _DefTaxTransfer.TaxTransferDocument <> 'VIRTUAL' and _DefTaxTransfer.TaxTransferDocument is not initial and _DefTaxTransfer.CAReversalDocumentNumber is initial
[0..1] I_OperationalAcctgDocItem _CustomerLineItem _CustomerLineItem.CompanyCode = $projection.CompanyCode and _CustomerLineItem.AccountingDocument = $projection.AccountingDocument and _CustomerLineItem.FiscalYear = $projection.FiscalYear and _CustomerLineItem.AccountingDocumentItem = $projection.TaxItem and _CustomerLineItem.Customer = $projection.Customer and ( _CustomerLineItem.FinancialAccountType = 'D' or _CustomerLineItem.FinancialAccountType = 'K' )
[0..1] I_TaxBoxStructure2 _TaxBoxStructure _TaxBoxStructure.Country = $projection.Country and _TaxBoxStructure.TaxBoxStructureType = $projection.TaxBoxStructureType and _TaxBoxStructure.ValidFrom = $projection.TaxBoxStrucValidityStartDate and _TaxBoxStructure.TaxGroup = $projection.TaxGroup and _TaxBoxStructure.TaxCode = $projection.TaxCode and _TaxBoxStructure.TransactionTypeDetermination = $projection.TransactionTypeDetermination and _TaxBoxStructure.TaxBox = $projection.TaxBox
[0..1] P_HR_TaxItemSequence _TaxItemSequence _TaxItemSequence.CompanyCode = $projection.CompanyCode and _TaxItemSequence.FiscalYear = $projection.FiscalYear and _TaxItemSequence.AccountingDocument = $projection.AccountingDocument and _TaxItemSequence.TaxItem = $projection.TaxItem and _TaxItemSequence.TaxCode = $projection.TaxCode and _TaxItemSequence.TransactionTypeDetermination = $projection.TransactionTypeDetermination

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Croatia Tax return view
Metadata.ignorePropagatedAnnotations true view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view

Fields (65)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode TaxReturn CompanyCode
KEY AccountingDocument TaxReturn AccountingDocument
KEY FiscalYear TaxReturn FiscalYear
KEY TaxItem TaxReturn TaxItem
KEY StatryRptgEntity TaxReturn StatryRptgEntity
KEY StatryRptCategory TaxReturn StatryRptCategory
KEY StatryRptRunID TaxReturn StatryRptRunID
KEY TransactionTypeDetermination TaxReturn TransactionTypeDetermination
KEY TaxCode TaxReturn TaxCode
KEY TaxBoxStrucValidityStartDate TaxReturn TaxBoxStrucValidityStartDate
DebitCreditCode TaxReturn DebitCreditCode
AccountingDocumentType TaxReturn AccountingDocumentType
TaxBox TaxReturn TaxBox
TaxGroup TaxReturn TaxGroup
Country TaxReturn Country
TaxDeclnAmountType TaxReturn TaxDeclnAmountType
UnifiedTaxBoxStructureType TaxReturn UnifiedTaxBoxStructureType
TaxItemGrpgSupplierAcctGroup TaxReturn TaxItemGrpgSupplierAcctGroup
TaxItemGrpgAcctgDocumentType TaxReturn TaxItemGrpgAcctgDocumentType
TaxItemGrpgDebitCreditCode TaxReturn TaxItemGrpgDebitCreditCode
SupplierAccountGroup TaxReturn SupplierAccountGroup
TaxItemGrpgSpecialGLCode TaxReturn TaxItemGrpgSpecialGLCode
TaxBoxStructureType TaxReturn TaxBoxStructureType
TaxBoxStrucValidityEndDate TaxReturn TaxBoxStrucValidityEndDate
TaxType TaxReturn TaxType
TaxNumber2 TaxReturn TaxNumber2
TaxCalculationProcedure TaxReturn TaxCalculationProcedure
SequenceNumberasSetLineSequenceNumber
TaxReportingDate TaxReturn TaxReportingDate
DocumentDate TaxReturn DocumentDate
PostingDate TaxReturn PostingDate
ReportingDate TaxReturn ReportingDate
TaxReportingDocumentDate TaxReturn TaxReportingDocumentDate
ReportingCountry TaxReturn ReportingCountry
TaxCntryOrCompanyCodeCntry TaxReturn TaxCntryOrCompanyCodeCntry
Customer TaxReturn Customer
BusinessPartnerName TaxReturn BusinessPartnerName
VATRegistration _CustomerLineItem VATRegistration
ClearingDate _CustomerLineItem ClearingDate
TargetTaxCode TaxReturn TargetTaxCode
SourceTaxCode
SrceTransTypeDetermination
CompletePartnerAddress
AccountingDocumentHeaderText TaxReturn AccountingDocumentHeaderText
DocumentReferenceID TaxReturn DocumentReferenceID
Ledger TaxReturn Ledger
SourceReferenceDocument _DefTaxItem AccountingDocument
ReferenceDocumentFiscalYear _DefTaxItem FiscalYear
TaxTransferDocument _DefTaxTransfer TaxTransferDocument
TaxTransferDocumentYear _DefTaxTransfer TaxTransferDocumentYear
TaxTransferPostingDate _DefTaxTransfer PostingDate
AlternativeReferenceDocument TaxReturn AlternativeReferenceDocument
Reference1InDocumentHeader
Reference2InDocumentHeader
ReportingCurrency TaxReturn ReportingCurrency
TaxBaseAmountInRptgCrcy TaxReturn TaxBaseAmountInRptgCrcy
TaxAmountInRptgCrcy TaxReturn TaxAmountInRptgCrcy
AmountInReportingCurrency TaxReturn AmountInReportingCurrency
NetAmountInReportingCurrency
OpenAmountInReportingCurrency
TotalGrossAmount TaxReturn TotalGrossAmount
TaxIsDeferredRelevant TaxReturn TaxIsDeferredRelevant
_CustomerLineItem _CustomerLineItem
_TaxBoxStructure _TaxBoxStructure
_TaxItemSequence _TaxItemSequence
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Croatia Tax return'
@Metadata.ignorePropagatedAnnotations: true
@VDM.private:true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType:{
  serviceQuality: #D,
  sizeCategory: #XL,
  dataClass: #MIXED
}
define view entity P_HR_StRpTaxReturnBox
  with parameters

    P_StatryRptgEntity      : srf_reporting_entity,
    P_StatryRptCategory     : srf_rep_cat_id,
    P_StatryRptRunID        : srf_report_run_id,
    P_ReportingCountry      : land1,
    P_TaxIsDeferredRelevant : figen_deferred_check,
    P_TaxIsMossRelevant     : figen_moss_check,
    P_TaxBoxConfiguration   : figen_tdt_taxbox_config,
    P_FromReportingDate     : fis_period_date_from,
    P_ToReportingDate       : fis_period_date_to,
    P_SequenceCategory      : fiisvat_hr_seq_type,
    P_TaxBoxStructureType   : fot_atr_tax_box_struct_type


  as select from I_StRpTaxReturnBoxCube(  P_TaxIsDeferredRelevant : $parameters.P_TaxIsDeferredRelevant,
                                           P_TaxIsMossRelevant     : $parameters.P_TaxIsMossRelevant,
                                           P_StatryRptgEntity      : $parameters.P_StatryRptgEntity ,
                                           P_StatryRptCategory     : $parameters.P_StatryRptCategory,
                                           P_StatryRptRunID        : $parameters.P_StatryRptRunID,
                                           P_ReportingCountry      : $parameters.P_ReportingCountry,
                                           P_TaxBoxConfiguration   : $parameters.P_TaxBoxConfiguration) as TaxReturn

  association [0..1] to P_HR_DefTaxItem           as _DefTaxItem       on  TaxReturn.CompanyCode                  = _DefTaxItem.CompanyCode
                                                                       and TaxReturn.AccountingDocument           = _DefTaxItem.TaxTransferDocument
                                                                       and TaxReturn.FiscalYear                   = _DefTaxItem.TaxTransferDocumentYear
                                                                       and _DefTaxItem.ClearingAccountingDocument is not initial
                                                                       and _DefTaxItem.CAReversalDocumentNumber   is initial

  association [0..1] to P_HR_DefTaxItem           as _DefTaxTransfer   on  TaxReturn.CompanyCode                      =  _DefTaxTransfer.CompanyCode
                                                                       and TaxReturn.AccountingDocument               =  _DefTaxTransfer.AccountingDocument
                                                                       and TaxReturn.FiscalYear                       =  _DefTaxTransfer.FiscalYear
                                                                       and _DefTaxTransfer.ClearingAccountingDocument is not initial
                                                                       and _DefTaxTransfer.TaxTransferDocument        <> 'VIRTUAL'
                                                                       and _DefTaxTransfer.TaxTransferDocument        is not initial
                                                                       and _DefTaxTransfer.CAReversalDocumentNumber   is initial

  association [0..1] to I_OperationalAcctgDocItem as _CustomerLineItem on  _CustomerLineItem.CompanyCode            = $projection.CompanyCode
                                                                       and _CustomerLineItem.AccountingDocument     = $projection.AccountingDocument
                                                                       and _CustomerLineItem.FiscalYear             = $projection.FiscalYear
                                                                       and _CustomerLineItem.AccountingDocumentItem = $projection.TaxItem
                                                                       and _CustomerLineItem.Customer               = $projection.Customer
                                                                       and (
                                                                          _CustomerLineItem.FinancialAccountType    = 'D'
                                                                          or _CustomerLineItem.FinancialAccountType = 'K'
                                                                        )

  association [0..1] to I_TaxBoxStructure2        as _TaxBoxStructure  on  _TaxBoxStructure.Country                      = $projection.Country
                                                                       and _TaxBoxStructure.TaxBoxStructureType          = $projection.TaxBoxStructureType
                                                                       and _TaxBoxStructure.ValidFrom                    = $projection.TaxBoxStrucValidityStartDate
                                                                       and _TaxBoxStructure.TaxGroup                     = $projection.TaxGroup
                                                                       and _TaxBoxStructure.TaxCode                      = $projection.TaxCode
                                                                       and _TaxBoxStructure.TransactionTypeDetermination = $projection.TransactionTypeDetermination
                                                                       and _TaxBoxStructure.TaxBox                       = $projection.TaxBox

  association [0..1] to P_HR_TaxItemSequence      as _TaxItemSequence  on  _TaxItemSequence.CompanyCode                  = $projection.CompanyCode
                                                                       and _TaxItemSequence.FiscalYear                   = $projection.FiscalYear
                                                                       and _TaxItemSequence.AccountingDocument           = $projection.AccountingDocument
                                                                       and _TaxItemSequence.TaxItem                      = $projection.TaxItem
                                                                       and _TaxItemSequence.TaxCode                      = $projection.TaxCode
                                                                       and _TaxItemSequence.TransactionTypeDetermination = $projection.TransactionTypeDetermination

  //  association [0..1] to I_TaxCode                 as _RefTaxCode       on  _RefTaxCode.TaxCalculationProcedure = $projection.TaxCalculationProcedure

  //                                                                       and _RefTaxCode.TaxCode                 = $projection.SourceTaxCode


  //  association [0..1] to I_TaxCode                 as _TaxCode          on  _TaxCode.TaxCalculationProcedure = $projection.TaxCalculationProcedure

  //                                                                       and _TaxCode.TaxCode                 = $projection.TaxCode


{
  key           TaxReturn.CompanyCode,
  key           TaxReturn.AccountingDocument,
  key           TaxReturn.FiscalYear,
  key           TaxReturn.TaxItem,
  key           TaxReturn.StatryRptgEntity,
  key           TaxReturn.StatryRptCategory,
  key           TaxReturn.StatryRptRunID,
  key           TaxReturn.TransactionTypeDetermination,
  key           TaxReturn.TaxCode,
  key           TaxReturn.TaxBoxStrucValidityStartDate,
                TaxReturn.DebitCreditCode,
                TaxReturn.AccountingDocumentType,
                TaxReturn.TaxBox,
                //                case

                //                when _TaxCode.TargetTaxCode = '' then  TaxReturn.TaxBox

                //                when _TaxCode.TargetTaxCode <> '' and _CustomerLineItem.ClearingDate is not initial and _CustomerLineItem.ClearingDate is not null

                //                then TaxReturn.TaxBox

                //                when _TaxCode.TargetTaxCode <> '' and (_CustomerLineItem.ClearingDate is initial or _CustomerLineItem.ClearingDate is null )

                //                then '999'      end                                                                            as TaxBox,

                TaxReturn.TaxGroup,
                TaxReturn.Country,
                TaxReturn.TaxDeclnAmountType,
                TaxReturn.UnifiedTaxBoxStructureType,
                TaxReturn.TaxItemGrpgSupplierAcctGroup,
                TaxReturn.TaxItemGrpgAcctgDocumentType,
                TaxReturn.TaxItemGrpgDebitCreditCode,
                TaxReturn.SupplierAccountGroup,
                TaxReturn.TaxItemGrpgSpecialGLCode,
                TaxReturn.TaxBoxStructureType,
                TaxReturn.TaxBoxStrucValidityEndDate,
                TaxReturn.TaxType,
                TaxReturn.TaxNumber2,
                TaxReturn.TaxCalculationProcedure,
                _TaxItemSequence( P_SAPClient             : $session.client,
                                  P_TaxIsDeferredRelevant : $parameters.P_TaxIsDeferredRelevant,
                                  P_TaxIsMossRelevant     : $parameters.P_TaxIsMossRelevant,
                                  P_StatryRptgEntity      : $parameters.P_StatryRptgEntity ,
                                  P_StatryRptCategory     : $parameters.P_StatryRptCategory,
                                  P_StatryRptRunID        : $parameters.P_StatryRptRunID,
                                  P_ReportingCountry      : $parameters.P_ReportingCountry,
                                  P_TaxBoxConfiguration   : $parameters.P_TaxBoxConfiguration,
                                  P_SequenceCategory      : $parameters.P_SequenceCategory,
                                  P_TaxBoxStructureType   : $parameters.P_TaxBoxStructureType ).SequenceNumber                                            as SetLineSequenceNumber,
                TaxReturn.TaxReportingDate,
                TaxReturn.DocumentDate,
                //                case

                //                when _TaxCode.TargetTaxCode = '' then  TaxReturn.PostingDate

                //                when _TaxCode.TargetTaxCode <> '' and _CustomerLineItem.ClearingDate is not initial and _CustomerLineItem.ClearingDate is not null

                //                then _CustomerLineItem.ClearingDate

                //                when _TaxCode.TargetTaxCode <> '' and (_CustomerLineItem.ClearingDate is initial or _CustomerLineItem.ClearingDate is null )

                //                then TaxReturn.PostingDate      end                                                            as PostingDate,

                TaxReturn.PostingDate,
                TaxReturn.ReportingDate,
                TaxReturn.TaxReportingDocumentDate,
                TaxReturn.ReportingCountry,
                TaxReturn.TaxCntryOrCompanyCodeCntry,
                TaxReturn.Customer,
                TaxReturn.BusinessPartnerName,
                _CustomerLineItem.VATRegistration,
                _CustomerLineItem.ClearingDate,
                TaxReturn.TargetTaxCode,
                cast(coalesce(_DefTaxItem.TaxCode, '') as dzmwsk )                                                                                        as SourceTaxCode,
                cast(coalesce(_DefTaxItem.TransactionTypeDetermination, '') as fac_ktosl )                                                                as SrceTransTypeDetermination,
                cast (TaxReturn.CustomerSupplierAddress as wlf_partner_complete_address )                                                                 as CompletePartnerAddress,
                cast( ( case when  TaxReturn.TaxNumber2 <> '' then TaxReturn.TaxNumber2
                    when _CustomerLineItem.VATRegistration is not null and _CustomerLineItem.VATRegistration <> '' then lpad( (substring(  _CustomerLineItem.VATRegistration , 3, 18) ), 11, '0' )
                    when TaxReturn.TaxNumber2 is null and _CustomerLineItem.VATRegistration is null then  ''   end   ) as fiisvat_vatreg_without_prefix ) as VATRegistrationWithoutPrefix,

                cast ( ( case when TaxNumber2 is not null then '1'
                              when _CustomerLineItem.VATRegistration is not null then '2'
                              when _CustomerLineItem.VATRegistration is null then '0' end ) as fiisvat_vat_registration_type )                            as VATRegistrationType,
                TaxReturn.AccountingDocumentHeaderText,
                TaxReturn.DocumentReferenceID,
                TaxReturn.Ledger,
                _DefTaxItem.AccountingDocument                                                                                                            as SourceReferenceDocument,
                _DefTaxItem.FiscalYear                                                                                                                    as ReferenceDocumentFiscalYear,
                _DefTaxTransfer.TaxTransferDocument,
                _DefTaxTransfer.TaxTransferDocumentYear,
                _DefTaxTransfer.PostingDate                                                                                                               as TaxTransferPostingDate,
                TaxReturn.AlternativeReferenceDocument,
                TaxReturn._JournalEntry.Reference1InDocumentHeader,
                TaxReturn._JournalEntry.Reference2InDocumentHeader,
                TaxReturn.ReportingCurrency,
                @Aggregation.default:#SUM
                @Semantics.amount.currencyCode: 'ReportingCurrency'
                TaxReturn.TaxBaseAmountInRptgCrcy,

                @Aggregation.default:#SUM
                @Semantics.amount.currencyCode: 'ReportingCurrency'
                TaxReturn.TaxAmountInRptgCrcy,

                @Aggregation.default:#SUM
                @Semantics.amount.currencyCode: 'ReportingCurrency'
                TaxReturn.AmountInReportingCurrency,

                @Aggregation.default:#SUM
                @Semantics.amount.currencyCode: 'ReportingCurrency'
                cast( ( TaxReturn.AmountInReportingCurrency * -1 ) as fiisvat_hr_net_amount )                                                             as NetAmountInReportingCurrency,

                @Aggregation.default:#SUM
                @Semantics.amount.currencyCode: 'ReportingCurrency'
                cast( (abs(TaxReturn.AmountInReportingCurrency)) as fiisvat_hr_positive_amount )                                                          as OpenAmountInReportingCurrency,


                @Aggregation.default:#SUM
                @Semantics.amount.currencyCode: 'ReportingCurrency'
                TaxReturn.TotalGrossAmount,

                TaxReturn.TaxIsDeferredRelevant,
                _CustomerLineItem,
                _TaxBoxStructure,
                _TaxItemSequence

}
where
      TaxReturn.TaxBoxStrucValidityStartDate <= $parameters.P_ToReportingDate
  and TaxReturn.TaxBoxStrucValidityEndDate   >= $parameters.P_FromReportingDate
  and TaxReturn.StatryRptgEntity             = $parameters.P_StatryRptgEntity
  and TaxReturn.StatryRptCategory            = $parameters.P_StatryRptCategory
  and TaxReturn.StatryRptRunID               = $parameters.P_StatryRptRunID
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_JOURNALENTRY",
"I_OPERATIONALACCTGDOCITEM",
"I_STRPTAXRETURNBOXCUBE",
"P_HR_DEFTAXITEM"
],
"ASSOCIATED":
[
"I_OPERATIONALACCTGDOCITEM",
"I_TAXBOXSTRUCTURE2"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/