P_DirectActivityAllocation

DDL: P_DIRECTACTIVITYALLOCATION SQL: PDRCTACTY Type: view COMPOSITE

P_DirectActivityAllocation is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_AccountAssignmentType, I_GLAccountLineItemRawData) and exposes 27 fields with key fields FiscalYear, ReferenceDocument, ControllingArea, LedgerGLLineItem.

Data Sources (2)

SourceAliasJoin Type
I_AccountAssignmentType _AAT inner
I_GLAccountLineItemRawData _Header from

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PDRCTACTY view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY FiscalYear FiscalYear
KEY ReferenceDocument ReferenceDocument
KEY ControllingArea ControllingArea
KEY LedgerGLLineItem LedgerGLLineItem
CompanyCode
SenderCompanyCode
AccountingDocument
AccountingDocumentHeaderText
DocumentDate DocumentDate
PostingDate PostingDate
FiscalPeriod
AccountingDocumentCreationDate
AccountingDocCreatedByUser
IsReversal IsReversal
IsReversed IsReversed
ReferenceDocumentType ReferenceDocumentType
ReferenceDocumentContext ReferenceDocumentContext
ExchangeRateDate
PredecessorReferenceDocument PredecessorReferenceDocument
ReversalReferenceDocument ReversalReferenceDocument
GlobalCurrency GlobalCurrency
AmountInGlobalCurrency AmountInGlobalCurrency
IsSettlement IsSettlement
IsSettled IsSettled
ControllingBusTransacType ControllingBusTransacType
AccountingDocumentType I_GLAccountLineItemRawData AccountingDocumentType
_ReferenceDocumentType _ReferenceDocumentType
@AbapCatalog.sqlViewName: 'PDRCTACTY'
@AbapCatalog.preserveKey:true 
@AbapCatalog.compiler.compareFilter:true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
//@EndUserText.label: 'Direct Activity Allocation Header - private view'

define view P_DirectActivityAllocation 
  as select from I_GLAccountLineItemRawData as _Header
  inner join I_AccountAssignmentType as _AAT
    on _AAT.AccountAssignmentType = _Header.AccountAssignmentType 
  
   
{
  key FiscalYear,      
      
  key ReferenceDocument,
  
  key ControllingArea,
  
  key LedgerGLLineItem,
      
      cast(_Header.CompanyCode as fis_bukrs)                            as CompanyCode, 
      cast(_Header.PartnerCompanyCode as sendercompanycode) as SenderCompanyCode,
                   
      cast(_Header.AccountingDocument as fis_belnr)                         as AccountingDocument,  
                   
      _Header._JournalEntry.AccountingDocumentHeaderText,
      
      DocumentDate,

      PostingDate,

      _Header._JournalEntry.FiscalPeriod,
      
      _Header._JournalEntry.AccountingDocumentCreationDate,
      
      cast(AccountingDocCreatedByUser as fco_cc_createdby) as AccountingDocCreatedByUser,
            
      IsReversal,
      IsReversed,      

      ReferenceDocumentType,  
      ReferenceDocumentContext,
      
      cast(_Header._JournalEntry.ExchangeRateDate as fin_currconvdat) as ExchangeRateDate,
      
      PredecessorReferenceDocument,
      ReversalReferenceDocument,
      
      @Semantics.currencyCode:true
      GlobalCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      AmountInGlobalCurrency,
        
      IsSettlement,
      IsSettled,
      
      ControllingBusTransacType,
      _Header.AccountingDocumentType,
      _ReferenceDocumentType

}

where
  ( //RKL - Leistungsverrechnung; RKLU - Umbuchung Leist.verr.

    ControllingBusTransacType = 'RKL'
    and ( BusinessTransactionCategory = 'RKL' or BusinessTransactionCategory = 'RKLU' )   
  )
  and
  ReferenceDocumentType = 'COBK'
  and
  OriginCtrlgDebitCreditCode = 'S'
  and
  _Ledger.IsLeadingLedger = 'X'
  and _Header.LogicalSystem = '' 
  and _Header._JournalEntry.SenderLogicalSystem = '' 
  and (_Header.SourceLedger = _Header._JournalEntry.LedgerGroup or _Header._JournalEntry.LedgerGroup = '' )