P_AR_InvoiceAcctgDocuments

DDL: P_AR_INVOICEACCTGDOCUMENTS SQL: PINVACCDOC Type: view COMPOSITE Package: GLO_FIN_IS_VAT_AR

Relevant Documents Of Official Document Numbering

P_AR_InvoiceAcctgDocuments is a Composite CDS View that provides data about "Relevant Documents Of Official Document Numbering" in SAP S/4HANA. It reads from 6 data sources and exposes 25 fields with key fields CompanyCode, AccountingDocument, FiscalYear, DocumentReferenceID, BranchPrefix. Part of development package GLO_FIN_IS_VAT_AR.

Data Sources (6)

SourceAliasJoin Type
I_StRpJournalEntryLog _ReportedItemsLog left_outer
I_StRpJournalEntryLog _ReportedItemsLog left_outer
I_AR_OfficialDocNmbrRnge I_AR_OfficialDocNmbrRnge inner
I_AR_OfficialDocNmbrRnge I_AR_OfficialDocNmbrRnge left_outer
P_AR_BranchPrintCharOfRefDoc P_AR_BranchPrintCharOfRefDoc from
P_AR_BranchPrintCharOfRefDoc P_AR_BranchPrintCharOfRefDoc union_all

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PINVACCDOC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.private true view

Fields (25)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_AR_BranchPrintCharOfRefDoc CompanyCode
KEY AccountingDocument P_AR_BranchPrintCharOfRefDoc AccountingDocument
KEY FiscalYear P_AR_BranchPrintCharOfRefDoc FiscalYear
KEY DocumentReferenceID P_AR_BranchPrintCharOfRefDoc DocumentReferenceID
KEY BranchPrefix P_AR_BranchPrintCharOfRefDoc BranchPrefix
KEY Branch P_AR_BranchPrintCharOfRefDoc Branch
KEY DocumentClass I_AR_OfficialDocNmbrRnge DocumentClass
KEY AR_PrintCharacter P_AR_BranchPrintCharOfRefDoc AR_PrintCharacter
KEY AR_OfficialDocumentNumber AR_OfficialDocumentNumber
KEY StatryRptCategory I_StRpJournalEntryLog StatryRptCategory
KEY StatryRptgEntity I_StRpJournalEntryLog StatryRptgEntity
KEY StatryRptRunID I_StRpJournalEntryLog StatryRptRunID
CompanyCode
KEY AccountingDocument P_AR_BranchPrintCharOfRefDoc AccountingDocument
KEY FiscalYear P_AR_BranchPrintCharOfRefDoc FiscalYear
KEY DocumentReferenceID P_AR_BranchPrintCharOfRefDoc DocumentReferenceID
KEY BranchPrefix P_AR_BranchPrintCharOfRefDoc BranchPrefix
KEY Branch P_AR_BranchPrintCharOfRefDoc Branch
KEY DocumentClass P_AR_BranchPrintCharOfRefDoc DocumentClass
KEY AR_PrintCharacter P_AR_BranchPrintCharOfRefDoc AR_PrintCharacter
KEY AR_OfficialDocumentNumber AR_OfficialDocumentNumber
KEY StatryRptCategory I_StRpJournalEntryLog StatryRptCategory
KEY StatryRptgEntity I_StRpJournalEntryLog StatryRptgEntity
KEY StatryRptRunID I_StRpJournalEntryLog StatryRptRunID
ReportingDate ReportingDate
@AbapCatalog.sqlViewName: 'PINVACCDOC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.private: true
//@EndUserText.label: 'Relevant Documents Of Official Document Numbering'

define view P_AR_InvoiceAcctgDocuments as select from P_AR_BranchPrintCharOfRefDoc 
    
inner join I_AR_OfficialDocNmbrRnge
      on ( P_AR_BranchPrintCharOfRefDoc.CompanyCode =  I_AR_OfficialDocNmbrRnge.CompanyCode )
      //// on ( P_AR_BranchPrintCharOfRefDoc.CompanyCode =  I_AR_OfficialDocNmbrRnge.CompanyCode or P_AR_BranchPrintCharOfRefDoc.CompanyCode is null or P_AR_BranchPrintCharOfRefDoc.CompanyCode = ' ' )

      and  P_AR_BranchPrintCharOfRefDoc.Branch = I_AR_OfficialDocNmbrRnge.Branch
      and  P_AR_BranchPrintCharOfRefDoc.AR_PrintCharacter = I_AR_OfficialDocNmbrRnge.AR_PrintCharacter
      and ( P_AR_BranchPrintCharOfRefDoc.AR_OfficialDocumentNumber  >= I_AR_OfficialDocNmbrRnge.RefDocNmbrRngeLowrLmt 
      and P_AR_BranchPrintCharOfRefDoc.AR_OfficialDocumentNumber  <= I_AR_OfficialDocNmbrRnge.RefDocNmbrRngeUprLmt )
      
left outer join       I_StRpJournalEntryLog                                       as _ReportedItemsLog on  _ReportedItemsLog.CompanyCode        = P_AR_BranchPrintCharOfRefDoc.CompanyCode
                                                                                                           and _ReportedItemsLog.AccountingDocument = P_AR_BranchPrintCharOfRefDoc.AccountingDocument
                                                                                                           and _ReportedItemsLog.FiscalYear         = P_AR_BranchPrintCharOfRefDoc.FiscalYear
       
{
    key P_AR_BranchPrintCharOfRefDoc.CompanyCode,
    key P_AR_BranchPrintCharOfRefDoc.AccountingDocument,
    key P_AR_BranchPrintCharOfRefDoc.FiscalYear,
    key P_AR_BranchPrintCharOfRefDoc.DocumentReferenceID,
    key P_AR_BranchPrintCharOfRefDoc.BranchPrefix,
    key P_AR_BranchPrintCharOfRefDoc.Branch,
    key I_AR_OfficialDocNmbrRnge.DocumentClass,
    key P_AR_BranchPrintCharOfRefDoc.AR_PrintCharacter,
    key AR_OfficialDocumentNumber,
    key _ReportedItemsLog.StatryRptCategory,
    key _ReportedItemsLog.StatryRptgEntity,
    key _ReportedItemsLog.StatryRptRunID,
      ReportingDate

    
   
}

union all
select from  P_AR_BranchPrintCharOfRefDoc

left outer join  I_AR_OfficialDocNmbrRnge
      on  P_AR_BranchPrintCharOfRefDoc.CompanyCode =  I_AR_OfficialDocNmbrRnge.CompanyCode
      and  P_AR_BranchPrintCharOfRefDoc.Branch = I_AR_OfficialDocNmbrRnge.Branch
      and  P_AR_BranchPrintCharOfRefDoc.AR_PrintCharacter = I_AR_OfficialDocNmbrRnge.AR_PrintCharacter
      
left outer join       I_StRpJournalEntryLog    as _ReportedItemsLog on  _ReportedItemsLog.CompanyCode        = P_AR_BranchPrintCharOfRefDoc.CompanyCode
                                                                    and _ReportedItemsLog.AccountingDocument = P_AR_BranchPrintCharOfRefDoc.AccountingDocument
                                                                    and _ReportedItemsLog.FiscalYear         = P_AR_BranchPrintCharOfRefDoc.FiscalYear
  {
    key P_AR_BranchPrintCharOfRefDoc.CompanyCode,
    key P_AR_BranchPrintCharOfRefDoc.AccountingDocument,
    key P_AR_BranchPrintCharOfRefDoc.FiscalYear,
    key P_AR_BranchPrintCharOfRefDoc.DocumentReferenceID,
    key P_AR_BranchPrintCharOfRefDoc.BranchPrefix,
    key P_AR_BranchPrintCharOfRefDoc.Branch,
    key P_AR_BranchPrintCharOfRefDoc.DocumentClass,
    key P_AR_BranchPrintCharOfRefDoc.AR_PrintCharacter,
    key AR_OfficialDocumentNumber,
    key _ReportedItemsLog.StatryRptCategory,
    key _ReportedItemsLog.StatryRptgEntity,
    key _ReportedItemsLog.StatryRptRunID,
        ReportingDate

    
  
  
  }
   where ( I_AR_OfficialDocNmbrRnge.CompanyCode is null ) and ( I_AR_OfficialDocNmbrRnge.AR_PrintCharacter is null 
) and ( I_AR_OfficialDocNmbrRnge.Branch is null )