P_PrimaNotaWithoutOthRcvEBDP

DDL: P_PRIMANOTAWITHOUTOTHRCVEBDP Type: view_entity COMPOSITE

Prima nota entries without other receiver EBDP posting

P_PrimaNotaWithoutOthRcvEBDP is a Composite CDS View that provides data about "Prima nota entries without other receiver EBDP posting" in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItemRawData) and exposes 31 fields with key fields CompanyCode, Ledger, AccountingDocument, LedgerGLLineItem, FiscalYear.

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItemRawData prima_nota from

Parameters (2)

NameTypeDefault
P_FiscalPeriodStartDate budat
P_FiscalPeriodEndDate budat

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Prima nota entries without other receiver EBDP posting view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MIXED view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (31)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_GLAccountLineItemRawData CompanyCode
KEY Ledger I_GLAccountLineItemRawData SourceLedger
KEY AccountingDocument I_GLAccountLineItemRawData AccountingDocument
KEY LedgerGLLineItem I_GLAccountLineItemRawData LedgerGLLineItem
KEY FiscalYear I_GLAccountLineItemRawData FiscalYear
ControllingObject I_GLAccountLineItemRawData ControllingObject
ReferenceDocumentType I_GLAccountLineItemRawData ReferenceDocumentType
ReferenceDocumentContext I_GLAccountLineItemRawData ReferenceDocumentContext
ReferenceDocument I_GLAccountLineItemRawData ReferenceDocument
OrderID I_GLAccountLineItemRawData OrderID
OrderItem I_GLAccountLineItemRawData OrderItem
AmountInCompanyCodeCurrency I_GLAccountLineItemRawData AmountInCompanyCodeCurrency
AmountInGlobalCurrency I_GLAccountLineItemRawData AmountInGlobalCurrency
AmountInFreeDefinedCurrency1 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency1
AmountInFreeDefinedCurrency2 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency2
AmountInFreeDefinedCurrency3 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency3
AmountInFreeDefinedCurrency4 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency4
AmountInFreeDefinedCurrency5 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency5
AmountInFreeDefinedCurrency6 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency6
AmountInFreeDefinedCurrency7 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency7
AmountInFreeDefinedCurrency8 I_GLAccountLineItemRawData AmountInFreeDefinedCurrency8
CompanyCodeCurrency I_GLAccountLineItemRawData CompanyCodeCurrency
GlobalCurrency I_GLAccountLineItemRawData GlobalCurrency
FreeDefinedCurrency1 I_GLAccountLineItemRawData FreeDefinedCurrency1
FreeDefinedCurrency2 I_GLAccountLineItemRawData FreeDefinedCurrency2
FreeDefinedCurrency3 I_GLAccountLineItemRawData FreeDefinedCurrency3
FreeDefinedCurrency4 I_GLAccountLineItemRawData FreeDefinedCurrency4
FreeDefinedCurrency5 I_GLAccountLineItemRawData FreeDefinedCurrency5
FreeDefinedCurrency6 I_GLAccountLineItemRawData FreeDefinedCurrency6
FreeDefinedCurrency7 I_GLAccountLineItemRawData FreeDefinedCurrency7
FreeDefinedCurrency8 I_GLAccountLineItemRawData FreeDefinedCurrency8
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Prima nota entries without other receiver EBDP posting'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #S,
  dataClass: #MIXED
}
@VDM.private:true
@VDM.viewType: #COMPOSITE
define view entity P_PrimaNotaWithoutOthRcvEBDP
  with parameters
    P_FiscalPeriodStartDate : budat,
    P_FiscalPeriodEndDate   : budat
  as select from           I_GLAccountLineItemRawData  as prima_nota
  //    inner join             I_Ledger                   as ledger         on  ledger.Ledger     = prima_nota.SourceLedger

  //                                                                        and ledger.LedgerType = '' //standard ledger only

    left outer to one join I_GLAccountLineItemRawData  as posted_ebdp    on  prima_nota.ControllingObject               = posted_ebdp.ControllingObject
                                                                         and prima_nota.SourceLedger                    = posted_ebdp.SourceLedger
                                                                         and prima_nota.CompanyCode                     = posted_ebdp.CompanyCode
                                                                         and prima_nota.ReferenceDocumentType           = posted_ebdp.ReferenceDocumentType
                                                                         and prima_nota.ReferenceDocumentContext        = posted_ebdp.ReferenceDocumentContext
                                                                         and prima_nota.ReferenceDocument               = posted_ebdp.ReferenceDocument
                                                                         and prima_nota.OrderID                         = posted_ebdp.OrderID
                                                                         and posted_ebdp.BusinessTransactionCategory    = 'EBDP'
                                                                         and posted_ebdp.OriginCtrlgDebitCreditCode     = 'A'  //for excluding item cost itself

                                                                         and (
                                                                            posted_ebdp.PartnerAccountAssignmentType    = 'KS'
                                                                            or posted_ebdp.PartnerAccountAssignmentType = 'PR'
                                                                            or posted_ebdp.PartnerAccountAssignmentType = 'OR'
                                                                          )
                                                                         and posted_ebdp.PostingDate                    <= $parameters.P_FiscalPeriodEndDate

    left outer to one join R_EvtBsdProdCostgSettlmtRef as refrence_table on  prima_nota.ControllingObject               = refrence_table.ControllingObject
                                                                         and prima_nota.OrderID                         = refrence_table.OrderID
                                                                         and prima_nota.SourceLedger                    = refrence_table.Ledger
                                                                         and prima_nota.ReferenceDocumentType           = refrence_table.ReferenceDocumentType
                                                                         and prima_nota.ReferenceDocumentContext        = refrence_table.ReferenceDocumentContext
                                                                         and prima_nota.ReferenceDocument               = refrence_table.ReferenceDocument
                                                                         and refrence_table.BusinessTransactionCategory = 'EBDP'
                                                                         and refrence_table.PostingDate                 <= $parameters.P_FiscalPeriodEndDate
{

  key prima_nota.CompanyCode,
  key prima_nota.SourceLedger as Ledger,
  key prima_nota.AccountingDocument,
  key prima_nota.LedgerGLLineItem,
  key prima_nota.FiscalYear,
      prima_nota.ControllingObject,
      prima_nota.ReferenceDocumentType,
      prima_nota.ReferenceDocumentContext,
      prima_nota.ReferenceDocument,
      prima_nota.OrderID,
      prima_nota.OrderItem,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      prima_nota.AmountInCompanyCodeCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      prima_nota.AmountInGlobalCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      prima_nota.AmountInFreeDefinedCurrency1,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      prima_nota.AmountInFreeDefinedCurrency2,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      prima_nota.AmountInFreeDefinedCurrency3,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      prima_nota.AmountInFreeDefinedCurrency4,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      prima_nota.AmountInFreeDefinedCurrency5,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      prima_nota.AmountInFreeDefinedCurrency6,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      prima_nota.AmountInFreeDefinedCurrency7,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      prima_nota.AmountInFreeDefinedCurrency8,

      prima_nota.CompanyCodeCurrency,
      prima_nota.GlobalCurrency,
      prima_nota.FreeDefinedCurrency1,
      prima_nota.FreeDefinedCurrency2,
      prima_nota.FreeDefinedCurrency3,
      prima_nota.FreeDefinedCurrency4,
      prima_nota.FreeDefinedCurrency5,
      prima_nota.FreeDefinedCurrency6,
      prima_nota.FreeDefinedCurrency7,
      prima_nota.FreeDefinedCurrency8,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInCompanyCodeCurrency
            end               as PeriodAmountInCompanyCodeCrcy,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      case
             when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                 prima_nota.AmountInGlobalCurrency
             end              as PeriodAmountInGlobalCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency1
            end               as PeriodAmountInFreeDfndCrcy1,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency2
            end               as PeriodAmountInFreeDfndCrcy2,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency3
            end               as PeriodAmountInFreeDfndCrcy3,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency4
            end               as PeriodAmountInFreeDfndCrcy4,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency5
            end               as PeriodAmountInFreeDfndCrcy5,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency6
            end               as PeriodAmountInFreeDfndCrcy6,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency7
            end               as PeriodAmountInFreeDfndCrcy7,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      case
            when (prima_nota.PostingDate >= $parameters.P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters.P_FiscalPeriodEndDate) then
                prima_nota.AmountInFreeDefinedCurrency8
            end               as PeriodAmountInFreeDfndCrcy8
}
where
  (
    (
              prima_nota.AccountAssignmentType        =  'OP' // Joint production order

      and(
        (
              prima_nota.BusinessTransactionCategory  =  'EBDP'
          and prima_nota.PartnerAccountAssignmentType =  'OR' //items' cost distributed from header

        )
        or(
              prima_nota.OriginCtrlgDebitCreditCode   =  'L'
          and prima_nota.TransactionTypeDetermination =  'GBB' //item's goods receipt

        )
      )
    )
    or(
              prima_nota.AccountAssignmentType        =  'OR' // non joint production order

      and     prima_nota.OriginCtrlgDebitCreditCode   <> 'A' // Exclude Previous Distributed Items

      and     prima_nota.BusinessTransactionCategory  <> 'EBWP' // Exclude event-based WIP on header

    )
  )
  and         prima_nota.PostingDate                  <= $parameters.P_FiscalPeriodEndDate
  and         posted_ebdp.ReferenceDocument           is null
  and         refrence_table.ReferenceDocument        is null