R_NO_OpAccDocWthRecnclnKey

DDL: R_NO_OPACCDOCWTHRECNCLNKEY Type: view_entity COMPOSITE Package: FKK_ID_NO_REP

Norway Acc Docs with Reconciliation Key

R_NO_OpAccDocWthRecnclnKey is a Composite CDS View that provides data about "Norway Acc Docs with Reconciliation Key" in SAP S/4HANA. It reads from 1 data source (I_JournalEntry) and exposes 6 fields with key fields CompanyCode, FiscalYear, AccountingDocument, AccountingDocumentItem. Part of development package FKK_ID_NO_REP.

Data Sources (1)

SourceAliasJoin Type
I_JournalEntry doc from

Annotations (9)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Norway Acc Docs with Reconciliation Key view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_JournalEntry CompanyCode
KEY FiscalYear
KEY AccountingDocument I_JournalEntry AccountingDocument
KEY AccountingDocumentItem doc_itm AccountingDocumentItem
CADocumentNumberendasCADocumentNumber
ExtractedReconciliationKeyText
@AbapCatalog.viewEnhancementCategory: [ #NONE ]

@AccessControl.authorizationCheck: #MANDATORY

@Metadata.ignorePropagatedAnnotations: true

@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@ObjectModel.usageType: { serviceQuality: #D, sizeCategory: #L, dataClass: #TRANSACTIONAL }
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@Consumption.dbHints: ['USE_HEX_PLAN', 'NO_CYCLIC_JOIN']
@EndUserText.label: 'Norway Acc Docs with Reconciliation Key'

define view entity R_NO_OpAccDocWthRecnclnKey
  as select from           I_JournalEntry      as doc 

    join                   I_OperationalAcctgDocItem as doc_itm
      on  doc.CompanyCode        = doc_itm.CompanyCode
      and doc_itm.FiscalYear     = cast( doc.FiscalYear as fis_gjahr_no_conv) 
      and doc.AccountingDocument = doc_itm.AccountingDocument
      and doc.TransactionCurrency = doc_itm.TransactionCurrency

    left outer to one join I_CATotalsRecord          as ca_tot_direct
      on  doc.CompanyCode                            = ca_tot_direct.CompanyCode
      and ca_tot_direct.CAReconciliationKey          = substring( doc.OriginalReferenceDocument, 1, 12 )
      and doc_itm.DebitCreditCode                    = ca_tot_direct.DebitCreditCode
      and doc_itm.GLAccount                          = ca_tot_direct.GLAccount
      and doc_itm.PostingDate                        = ca_tot_direct.CAPostingDate
      and doc_itm.Reference1IDByBusinessPartner      = cast( ca_tot_direct.CATotalsRecordSequenceNumber      as char12 )
      and ca_tot_direct.CATotalsRecdIsDrctTrnsfdToGL = 'X'
      and ca_tot_direct.CANrOfDocsTrnsfdToGLRefVal   = right(doc_itm.OriginalReferenceDocument, 7)
      and ca_tot_direct.CADocumentNumber             is not initial
      and ca_tot_direct.TransactionCurrency          = doc_itm.TransactionCurrency
      
    left outer to one join I_CATotalsRecord          as ca_tot_single
      on  doc.CompanyCode                            = ca_tot_single.CompanyCode
      and ca_tot_single.CAReconciliationKey          = substring( doc.OriginalReferenceDocument, 1, 12 )
      and doc_itm.DebitCreditCode                    = ca_tot_single.DebitCreditCode
      and doc_itm.GLAccount                          = ca_tot_single.GLAccount
      and doc_itm.PostingDate                        = ca_tot_single.CAPostingDate
      and doc_itm.Reference1IDByBusinessPartner      = cast( ca_tot_single.CATotalsRecordSequenceNumber      as char12 )
      and ca_tot_direct.CADocumentNumber             is null
      and ca_tot_single.CATotalsRecdIsDrctTrnsfdToGL is initial
      and ca_tot_single.CADocumentNumber             is not initial
      and ca_tot_single.TransactionCurrency          = doc_itm.TransactionCurrency

    left outer to one join I_CATotalsRecord          as ca_tot_normal
      on  doc.CompanyCode                        = ca_tot_normal.CompanyCode
      and ca_tot_normal.CAReconciliationKey      = substring( doc.OriginalReferenceDocument, 1, 12 )
      and doc_itm.DebitCreditCode                = ca_tot_normal.DebitCreditCode
      and doc_itm.GLAccount                      = ca_tot_normal.GLAccount
      and doc_itm.PostingDate                    = ca_tot_normal.CAPostingDate
      and doc_itm.Reference1IDByBusinessPartner  = cast( ca_tot_normal.CATotalsRecordSequenceNumber      as char12 )
      and ca_tot_direct.CADocumentNumber        is null
      and ca_tot_single.CADocumentNumber        is null
      and ca_tot_normal.TransactionCurrency      = doc_itm.TransactionCurrency

    left outer to many join I_CADocument              as ca_document
      on  ca_document.CAReconciliationKey = substring( doc.OriginalReferenceDocument, 1, 12 )
      and doc_itm.PostingDate             = ca_document.CAPostingDate
      and ca_document.TransactionCurrency = doc.TransactionCurrency

{
  key doc.CompanyCode,
  key cast(doc.FiscalYear as fis_gjahr_no_conv)   as FiscalYear,
  key doc.AccountingDocument,
key doc_itm.AccountingDocumentItem, 
      case
                when (ca_tot_direct.CADocumentNumber is not null and ca_tot_direct.CADocumentNumber <> '') then ca_tot_direct.CADocumentNumber
                when (ca_tot_single.CADocumentNumber is not null and ca_tot_single.CADocumentNumber <> '') then ca_tot_single.CADocumentNumber
                when (ca_tot_normal.CADocumentNumber is not null and ca_tot_normal.CADocumentNumber <> '') then ca_tot_normal.CADocumentNumber
                else ca_document.CADocumentNumber
            end                                       as CADocumentNumber,

   
            substring(doc.OriginalReferenceDocument, 1, 12) as ExtractedReconciliationKeyText
      
}

where doc.ReferenceDocumentType = 'FKKSU'
   or doc.ReferenceDocumentType = 'FKKKO'