P_PL_SAFTAcctgInvcBscVersion2

DDL: P_PL_SAFTACCTGINVCBSCVERSION2 Type: view_entity COMPOSITE Package: GLO_FIN_IS_SAFT_PL

SAFT PL FA Accounting Document Invoice

P_PL_SAFTAcctgInvcBscVersion2 is a Composite CDS View that provides data about "SAFT PL FA Accounting Document Invoice" in SAP S/4HANA. It reads from 1 data source (I_JournalEntry) and exposes 10 fields with key fields CompanyCode, AccountingDocument, FiscalYear. It has 1 association to related views. Part of development package GLO_FIN_IS_SAFT_PL.

Data Sources (1)

SourceAliasJoin Type
I_JournalEntry Entry from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_PL_SAFTAccountingDocTypeMap _AccountingDocTypeMap _AccountingDocTypeMap.AccountingDocumentType = $projection.AccountingDocumentType and _AccountingDocTypeMap.StartDate <= $projection.TaxReportingDate and _AccountingDocTypeMap.EndDate >= $projection.TaxReportingDate

Annotations (7)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode
KEY AccountingDocument I_JournalEntry AccountingDocument
KEY FiscalYear I_JournalEntry FiscalYear
AccountingDocumentType I_JournalEntry AccountingDocumentType
TaxReportingDate I_JournalEntry TaxReportingDate
DocumentReferenceID I_JournalEntry DocumentReferenceID
AlternativeReferenceDocument I_JournalEntry AlternativeReferenceDocument
InvoiceReference ReverseDocumentItem InvoiceReference
InvoiceReferenceFiscalYear ReverseDocumentItem InvoiceReferenceFiscalYear
IsReversal I_JournalEntry IsReversal
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.personalData.blocking : #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private:true
@ObjectModel.usageType.serviceQuality: #P
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED

define view entity P_PL_SAFTAcctgInvcBscVersion2
  as select from            I_JournalEntry                as Entry

    left outer to one join  I_PL_SAFTAccountingDocTypeMap as RevDocTypeMap       on  RevDocTypeMap.AccountingDocumentType =  Entry.AccountingDocumentType
                                                                                 and RevDocTypeMap.StartDate              <= Entry.TaxReportingDate
                                                                                 and RevDocTypeMap.EndDate                >= Entry.TaxReportingDate
                                                                                 and Entry.IsReversal                     =  'X'

    left outer to many join I_OperationalAcctgDocItem     as ReverseDocumentItem on  ReverseDocumentItem.CompanyCode          = Entry.CompanyCode
                                                                                 and ReverseDocumentItem.AccountingDocument   = Entry.AccountingDocument
                                                                                 and ReverseDocumentItem.FiscalYear           = Entry.FiscalYear
                                                                                 and Entry.IsReversal                         = 'X'
                                                                                 and ReverseDocumentItem.FinancialAccountType = 'D'

  association [0..1] to I_PL_SAFTAccountingDocTypeMap as _AccountingDocTypeMap on  _AccountingDocTypeMap.AccountingDocumentType = $projection.AccountingDocumentType
                                                                               and _AccountingDocTypeMap.StartDate              <= $projection.TaxReportingDate
                                                                               and _AccountingDocTypeMap.EndDate                >= $projection.TaxReportingDate


{

  key Entry.CompanyCode,
  key Entry.AccountingDocument,
  key Entry.FiscalYear,


      Entry.AccountingDocumentType,
      Entry.TaxReportingDate,

      Entry.DocumentReferenceID,
      Entry.AlternativeReferenceDocument,
      ReverseDocumentItem.InvoiceReference,
      ReverseDocumentItem.InvoiceReferenceFiscalYear,
      Entry.IsReversal,

      case when Entry.IsReversal = 'X'
        then
          case
          when  Entry.BusinessTransactionType = 'RFBU'
          then RevDocTypeMap.PL_SAFTInvoiceType
         end
        else
          case
          when  Entry.BusinessTransactionType = 'RFBU'
          then _AccountingDocTypeMap.PL_SAFTInvoiceType
          else _AccountingDocTypeMap.PL_SAFTInvoiceType
          end
      end as PL_SAFTInvoiceType



}