C_NoTrdgPartIntcoJrnlEntr

DDL: C_NOTRDGPARTINTCOJRNLENTR SQL: CGRCNTRPINTCOJE Type: view CONSUMPTION

No Trading Partner Intercompany JE

C_NoTrdgPartIntcoJrnlEntr is a Consumption CDS View that provides data about "No Trading Partner Intercompany JE" in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItemRawData). It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItemRawData I_GLAccountLineItemRawData from

Parameters (1)

NameTypeDefault
P_Ledger rldnr

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_NoTrdgPartIntcoJrnlEntr _NoTrdgPartIntcoJrnlEntr $projection.CompanyCode = _NoTrdgPartIntcoJrnlEntr.CompanyCode and $projection.FiscalYear = _NoTrdgPartIntcoJrnlEntr.FiscalYear and $projection.AccountingDocument = _NoTrdgPartIntcoJrnlEntr.AccountingDocument and $projection.Ledger = _NoTrdgPartIntcoJrnlEntr.Ledger

Annotations (15)

NameValueLevelField
AbapCatalog.sqlViewName CGRCNTRPINTCOJE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
OData.publish true view
AbapCatalog.buffering.status #NOT_ALLOWED view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label No Trading Partner Intercompany JE view
@AbapCatalog.sqlViewName: 'CGRCNTRPINTCOJE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@OData.publish: true
@AbapCatalog.buffering.status: #NOT_ALLOWED
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata: { ignorePropagatedAnnotations: true,
             allowExtensions: true }
@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@EndUserText.label: 'No Trading Partner Intercompany JE'

define view C_NoTrdgPartIntcoJrnlEntr

  with parameters
    @Consumption.valueHelpDefinition: [
            { entity:  { name:    'I_LedgerStdVH',
                         element: 'Ledger' }
            }]
    @EndUserText.label: 'Ledger'
    P_Ledger : rldnr

  as select from I_GLAccountLineItemRawData

  association [0..1] to P_NoTrdgPartIntcoJrnlEntr as _NoTrdgPartIntcoJrnlEntr on  $projection.CompanyCode        = _NoTrdgPartIntcoJrnlEntr.CompanyCode
                                                                              and $projection.FiscalYear         = _NoTrdgPartIntcoJrnlEntr.FiscalYear
                                                                              and $projection.AccountingDocument = _NoTrdgPartIntcoJrnlEntr.AccountingDocument
                                                                              and $projection.Ledger             = _NoTrdgPartIntcoJrnlEntr.Ledger

{
      @Consumption.valueHelpDefinition: [{ entity:  { name: 'I_CompanyCodeStdVH', element: 'CompanyCode' } }]
      @ObjectModel.foreignKey.association: '_CompanyCode'
  key CompanyCode,

      @ObjectModel.foreignKey.association: '_FiscalYear'
  key FiscalYear,

      @Consumption.valueHelpDefinition: [{ entity:  { name: 'I_JournalEntryStdVH', element: 'AccountingDocument' }, additionalBinding: [{ localElement: 'CompanyCode', element: 'CompanyCode' }, { localElement: 'FiscalYear', element: 'FiscalYear' }] }]
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key AccountingDocument,

      @ObjectModel.foreignKey.association: '_Ledger'
  key cast(SourceLedger as rldnr preserving type ) as Ledger,

      @Consumption.valueHelpDefinition: [{ entity:{ name: 'I_AccountingDocumentTypeStdVH', element: 'AccountingDocumentType' } }]
      @ObjectModel.foreignKey.association: '_AccountingDocumentType'
      AccountingDocumentType,
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      sum(case DebitCreditCode  when 'S' then cast( AmountInCompanyCodeCurrency as fis_dr_hsl preserving type )
                                                                else cast( cast( 0 as abap.curr( 23,2) ) as fis_dr_hsl preserving type )
      end)                                         as DebitAmountInCoCodeCrcy,

      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      sum(case DebitCreditCode  when 'H' then cast( AmountInCompanyCodeCurrency as fis_cr_hsl preserving type )
                                                                else cast( cast( 0 as abap.curr( 23,2) ) as fis_cr_hsl preserving type )
      end)                                         as CreditAmountInCoCodeCrcy,
      _JournalEntry.IntercompanyTransaction,
      _JournalEntry.AccountingDocumentCreationDate,
      _JournalEntry.AccountingDocCreatedByUser,
      _JournalEntry.TransactionCode,
      _JournalEntry.DocumentReferenceID,
      DocumentDate,
      _JournalEntry.LastChangeDate,
      @ObjectModel.foreignKey.association: '_AccountingDocumentCategory'
      AccountingDocumentCategory,
      @ObjectModel.foreignKey.association: '_ReferenceDocumentType'
      ReferenceDocumentType,
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      sum(AmountInCompanyCodeCurrency)             as AmountInCompanyCodeCurrency,
      @ObjectModel.foreignKey.association: '_FiscalYearPeriodForVariant'
      @Semantics.fiscal.yearPeriod: true
      FiscalYearPeriod,
      @ObjectModel.foreignKey.association: '_FiscalYearVariant'
      @Semantics.fiscal.yearVariant: true
      FiscalYearVariant,
      @ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
      @Semantics.currencyCode:true
      CompanyCodeCurrency,
      PostingDate,
      _JournalEntry.ReverseDocument,

      _CompanyCode,
      _FiscalYear,
      _JournalEntry,
      _AccountingDocumentType,
      _CompanyCodeCurrency,
      _AccountingDocumentCategory,
      _ReferenceDocumentType,
      _FiscalYearPeriodForVariant,
      _FiscalYearVariant,
      _Ledger
}

where
      ((_NoTrdgPartIntcoJrnlEntr(P_Ledger:$parameters.P_Ledger).P_NumberOfTradingPartner = 0) 
      or (_NoTrdgPartIntcoJrnlEntr (P_Ledger:$parameters.P_Ledger).P_NumberOfTradingPartner is null))
  and _JournalEntry.IntercompanyTransaction                                            <> ''
  and SourceLedger                                                                     = $parameters.P_Ledger
  and AmountInCompanyCodeCurrency                                                      <> 0
  and IsReversal                                                                       =  ''
  and IsReversed                                                                       =  ''

group by

  CompanyCode,
  FiscalYear,
  AccountingDocument,
  AccountingDocumentType,
  _JournalEntry.IntercompanyTransaction,
  _JournalEntry.AccountingDocumentCreationDate,
  _JournalEntry.AccountingDocCreatedByUser,
  _JournalEntry.TransactionCode,
  _JournalEntry.DocumentReferenceID,
  DocumentDate,
  _JournalEntry.LastChangeDate,
  AccountingDocumentCategory,
  ReferenceDocumentType,
  FiscalYearPeriod,
  FiscalYearVariant,
  CompanyCodeCurrency,
  PostingDate,
  _JournalEntry.ReverseDocument,
  SourceLedger