P_CN_AcctStdInputVat1

DDL: P_CN_ACCTSTDINPUTVAT1 Type: view_entity COMPOSITE Package: GLO_FIN_IS_CN_ADS

CN Accounting Data Std for Input VAT

P_CN_AcctStdInputVat1 is a Composite CDS View that provides data about "CN Accounting Data Std for Input VAT" in SAP S/4HANA. It reads from 3 data sources (I_AccountingDocument, I_OperationalAcctgDocItem, P_CN_AcctStdInputVatAccDoc2) and exposes 18 fields with key fields CompanyCode, FiscalYear, AccountingDocument, CN_TaxInvcCodeNmbr. Part of development package GLO_FIN_IS_CN_ADS.

Data Sources (3)

SourceAliasJoin Type
I_AccountingDocument DocumentHeader inner
I_OperationalAcctgDocItem DocumentItem inner
P_CN_AcctStdInputVatAccDoc2 VatDcoument from

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
VDM.private true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
VDM.viewType #COMPOSITE view

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode
KEY FiscalYear I_OperationalAcctgDocItem FiscalYear
KEY AccountingDocument I_OperationalAcctgDocItem AccountingDocument
KEY CN_TaxInvcCodeNmbr VAT CN_TaxInvcCodeNmbr
PostingDate I_AccountingDocument PostingDate
AccountingDocumentType I_AccountingDocument AccountingDocumentType
CN_TaxSellerName VAT CN_TaxSellerName
CN_TaxSellerRegnNmbr VAT CN_TaxSellerRegnNmbr
CN_TaxBuyerRegnNmbr VAT CN_TaxBuyerRegnNmbr
CN_TaxInvcGldnTxSystSts VAT CN_TaxInvcGldnTxSystSts
CN_TaxInvcInptProcgSts VAT CN_TaxInvcInptProcgSts
CN_TaxInvcType VAT CN_TaxInvcType
CN_TaxInvcDate VAT CN_TaxInvcDate
IsPostedOnAccount VAT IsPostedOnAccount
CN_TaxInvoiceUsage VAT CN_TaxInvoiceUsage
CN_TaxInvoiceUsageDescription
CN_TaxTransfType VAT CN_TaxTransfType
CN_TaxTransfDrctn VAT CN_TaxTransfDrctn
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@VDM.private:true
@ObjectModel.usageType:{
  serviceQuality: #D,
  sizeCategory: #XXL,
  dataClass: #MIXED
}
@VDM.viewType: #COMPOSITE
define view entity P_CN_AcctStdInputVat1
  as select from    P_CN_AcctStdInputVatAccDoc2  as VatDcoument
    inner join      I_AccountingDocument         as DocumentHeader    on  VatDcoument.CompanyCode        = DocumentHeader.CompanyCode
                                                                      and VatDcoument.FiscalYear         = DocumentHeader.FiscalYear
                                                                      and VatDcoument.AccountingDocument = DocumentHeader.AccountingDocument
    inner join      I_OperationalAcctgDocItem    as DocumentItem      on  VatDcoument.CompanyCode        = DocumentItem.CompanyCode
                                                                      and VatDcoument.AccountingDocument = DocumentItem.AccountingDocument
                                                                      and VatDcoument.FiscalYear         = DocumentItem.FiscalYear

    left outer to one join I_CN_TaxInvoiceAccountingDoc as VAT               on  DocumentItem.CompanyCode        = VAT.CompanyCode
                                                                      and DocumentItem.FiscalYear         = VAT.FiscalYear
                                                                      and DocumentItem.AccountingDocument = VAT.AccountingDocument

    left outer to one join I_PurchaseOrderHistoryBasic  as PurchasingHistory on  DocumentItem.PurchasingDocument     = PurchasingHistory.PurchaseOrder
                                                                      and DocumentItem.PurchasingDocumentItem = PurchasingHistory.PurchaseOrderItem
    left outer to one join I_PurOrdHistDelivCost        as DeliveryCost      on  DocumentItem.PurchasingDocument     = DeliveryCost.PurchaseOrder
                                                                      and DocumentItem.PurchasingDocumentItem = DeliveryCost.PurchaseOrderItem

{
  key DocumentItem.CompanyCode,
  key DocumentItem.FiscalYear,
  key DocumentItem.AccountingDocument,
  key VAT.CN_TaxInvcCodeNmbr,

      DocumentHeader.PostingDate,
      DocumentHeader.AccountingDocumentType,

      VAT.CN_TaxSellerName,
      VAT.CN_TaxSellerRegnNmbr,
      VAT.CN_TaxBuyerRegnNmbr,
      VAT.CN_TaxInvcGldnTxSystSts,
      VAT.CN_TaxInvcInptProcgSts,
      VAT.CN_TaxInvcType,
      VAT.CN_TaxInvcDate,
      VAT.IsPostedOnAccount,
      VAT.CN_TaxInvoiceUsage,
      VAT._VATInvoice._InvoiceUsage.CN_TaxInvoiceUsageDescription,
      VAT.CN_TaxTransfType,
      VAT.CN_TaxTransfDrctn,

      case when PurchasingHistory.PurchasingHistoryDocument is not null
                    then   concat( coalesce(PurchasingHistory.PurchasingHistoryDocument, ''), coalesce(PurchasingHistory.PurchasingHistoryDocumentYear,'') )
              when DeliveryCost.AccountingDocument is not null
                   then   concat( coalesce(DeliveryCost.AccountingDocument , ''), coalesce(DeliveryCost.FiscalYear,'') )
              else  ''
       end as OriginalReferenceDocument

}
where
  VAT.CN_TaxInvcCodeNmbr is not null