P_JP_GRDocumentHeader

DDL: P_JP_GRDOCUMENTHEADER SQL: PJPGRDOCHD Type: view COMPOSITE

P_JP_GRDocumentHeader is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_AccountingDocument) and exposes 14 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, Ledger. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_AccountingDocument Header inner

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_JournalEntry _JournalEntry $projection.CompanyCode = _JournalEntry.CompanyCode and $projection.FiscalYear = _JournalEntry.FiscalYear and $projection.AccountingDocument = _JournalEntry.AccountingDocument

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PJPGRDOCHD view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view

Fields (14)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger I_GLAccountLineItem SourceLedger
KEY CompanyCode I_GLAccountLineItem CompanyCode
KEY FiscalYear I_GLAccountLineItem FiscalYear
KEY AccountingDocument I_GLAccountLineItem AccountingDocument
KEY Ledger I_GLAccountLineItem Ledger
KEY ReferenceDocument I_GLAccountLineItem ReferenceDocument
Supplier I_GLAccountLineItem Supplier
AccountingDocumentHeaderText I_AccountingDocument AccountingDocumentHeaderText
_SourceLedger _SourceLedger
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_JournalEntry _JournalEntry
_Ledger _Ledger
_Supplier _Supplier
@AbapCatalog.sqlViewName: 'PJPGRDOCHD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private:true
@ObjectModel: { usageType.serviceQuality: #D,
                usageType.sizeCategory: #XXL,
                usageType.dataClass: #MIXED }
//@EndUserText.label: 'Goods Receipt Document Header List'


define view P_JP_GRDocumentHeader
  as select distinct from I_GLAccountLineItem  as I_GLAccountLineItem
    inner join            I_AccountingDocument as Header on  I_GLAccountLineItem.CompanyCode        = Header.CompanyCode
                                                         and I_GLAccountLineItem.FiscalYear         = Header.FiscalYear
                                                         and I_GLAccountLineItem.AccountingDocument = Header.AccountingDocument
   association [1..1] to I_JournalEntry as _JournalEntry on  $projection.CompanyCode        = _JournalEntry.CompanyCode
                                                         and $projection.FiscalYear         = _JournalEntry.FiscalYear
                                                         and $projection.AccountingDocument = _JournalEntry.AccountingDocument                                                         
//    left outer to many join P_JP_IRDocumentHeader as IR_Header on I_GLAccountLineItem.SourceLedger       = IR_Header.SourceLedger

//                                                              and I_GLAccountLineItem.CompanyCode        = IR_Header.CompanyCode

//                                                              and I_GLAccountLineItem.FiscalYear         = IR_Header.FiscalYear

//                                                              and I_GLAccountLineItem.AccountingDocument = IR_Header.AccountingDocument

//                                                              and I_GLAccountLineItem.Ledger             = IR_Header.Ledger

{
  key I_GLAccountLineItem.SourceLedger,
  key I_GLAccountLineItem.CompanyCode,
  key I_GLAccountLineItem.FiscalYear,
  key I_GLAccountLineItem.AccountingDocument,
  key I_GLAccountLineItem.Ledger,
  key I_GLAccountLineItem.ReferenceDocument,
      I_GLAccountLineItem.Supplier,
      Header.AccountingDocumentHeaderText,

      _SourceLedger,
      _CompanyCode,
      _FiscalYear,
      _JournalEntry,
      _Ledger,
      _Supplier
}
where
      I_GLAccountLineItem.AccountingDocument     <> I_GLAccountLineItem.ClearingAccountingDocument
  and SpecialGLCode                              =  ''
//  and ( FinancialAccountType                     =  'M' or

//        FinancialAccountType                     =  'S' )

  and I_GLAccountLineItem.Supplier               <> ''
  and Header.ReferenceDocumentType               = 'MKPF'
  and I_GLAccountLineItem.IsReversal <> 'X'
  and I_GLAccountLineItem.IsReversed = ''
  and FollowOnDocumentType is initial
//  and IR_Header.AccountingDocument is null

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACCOUNTINGDOCUMENT",
"I_GLACCOUNTLINEITEM"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_FISCALYEARFORCOMPANYCODE",
"I_JOURNALENTRY",
"I_LEDGER",
"I_SUPPLIER"
],
"BASE":
[
"I_GLACCOUNTLINEITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/