P_NO_SAFTJournalCustSup

DDL: P_NO_SAFTJOURNALCUSTSUP SQL: PNOSAFTJCS Type: view COMPOSITE Package: GLO_FIN_IS_SAFT_NO

SAF-T Norway Customers and Suppliers

P_NO_SAFTJournalCustSup is a Composite CDS View that provides data about "SAF-T Norway Customers and Suppliers" in SAP S/4HANA. It reads from 10 data sources and exposes 64 fields with key fields CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem, Ledger. Part of development package GLO_FIN_IS_SAFT_NO.

Data Sources (10)

SourceAliasJoin Type
I_Customer Customer inner
I_Customer Customer inner
I_NO_SAFTJournalItem JournalLineItem from
I_NO_SAFTJournalItem JournalLineItem union
I_NO_SAFTJournalItem JournalLineItem union
I_NO_SAFTJournalItem JournalLineItem union
I_JournalEntryItemOneTimeData OTC inner
I_JournalEntryItemOneTimeData OTS inner
I_Supplier Supplier inner
I_Supplier Supplier inner

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PNOSAFTJCS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #P view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.personalData.blocking #REQUIRED view

Fields (64)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_NO_SAFTJournalItem CompanyCode
KEY FiscalYear I_NO_SAFTJournalItem FiscalYear
KEY AccountingDocument I_NO_SAFTJournalItem AccountingDocument
KEY LedgerGLLineItem I_NO_SAFTJournalItem LedgerGLLineItem
KEY Ledger I_NO_SAFTJournalItem Ledger
PostingDate I_NO_SAFTJournalItem PostingDate
Customer I_NO_SAFTJournalItem Customer
Supplier I_NO_SAFTJournalItem Supplier
VATRegistration I_NO_SAFTJournalItem VATRegistration
IsOneTimeAccount
GLAccount I_NO_SAFTJournalItem GLAccount
TaxNumber1 I_Customer TaxNumber1
TaxNumber2 I_Customer TaxNumber2
_CompanyCode I_NO_SAFTJournalItem _CompanyCode
_FiscalYear I_NO_SAFTJournalItem _FiscalYear
_JournalEntry I_NO_SAFTJournalItem _JournalEntry
CompanyCodeasCompanyCode
KEY FiscalYear I_NO_SAFTJournalItem FiscalYear
KEY AccountingDocument I_NO_SAFTJournalItem AccountingDocument
KEY LedgerGLLineItem I_NO_SAFTJournalItem LedgerGLLineItem
KEY Ledger I_NO_SAFTJournalItem Ledger
PostingDate I_NO_SAFTJournalItem PostingDate
Customer I_NO_SAFTJournalItem Customer
Supplier I_NO_SAFTJournalItem Supplier
VATRegistration I_NO_SAFTJournalItem VATRegistration
IsOneTimeAccount
GLAccount I_NO_SAFTJournalItem GLAccount
TaxNumber1 I_Supplier TaxNumber1
TaxNumber2 I_Supplier TaxNumber2
_CompanyCode I_NO_SAFTJournalItem _CompanyCode
_FiscalYear I_NO_SAFTJournalItem _FiscalYear
_JournalEntry I_NO_SAFTJournalItem _JournalEntry
CompanyCodeasCompanyCode
KEY FiscalYear I_NO_SAFTJournalItem FiscalYear
KEY AccountingDocument I_NO_SAFTJournalItem AccountingDocument
KEY LedgerGLLineItem I_NO_SAFTJournalItem LedgerGLLineItem
KEY Ledger I_NO_SAFTJournalItem Ledger
PostingDate I_NO_SAFTJournalItem PostingDate
Customer I_NO_SAFTJournalItem Customer
Supplier I_NO_SAFTJournalItem Supplier
VATRegistration318endasVATRegistration
IsOneTimeAccount
GLAccount
TaxNumber1
TaxNumber2
_CompanyCode I_NO_SAFTJournalItem _CompanyCode
_FiscalYear I_NO_SAFTJournalItem _FiscalYear
_JournalEntry I_NO_SAFTJournalItem _JournalEntry
CompanyCodeasCompanyCode
KEY FiscalYear I_NO_SAFTJournalItem FiscalYear
KEY AccountingDocument I_NO_SAFTJournalItem AccountingDocument
KEY LedgerGLLineItem I_NO_SAFTJournalItem LedgerGLLineItem
KEY Ledger I_NO_SAFTJournalItem Ledger
PostingDate I_NO_SAFTJournalItem PostingDate
Customer I_NO_SAFTJournalItem Customer
Supplier I_NO_SAFTJournalItem Supplier
IsOneTimeAccount
GLAccount
TaxNumber1
TaxNumber2
_CompanyCode I_NO_SAFTJournalItem _CompanyCode
_FiscalYear I_NO_SAFTJournalItem _FiscalYear
_JournalEntry I_NO_SAFTJournalItem _JournalEntry
_Ledger I_NO_SAFTJournalItem _Ledger
@AbapCatalog.sqlViewName: 'PNOSAFTJCS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #P
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #REQUIRED
define view P_NO_SAFTJournalCustSup

  as select from I_NO_SAFTJournalItem as JournalLineItem
    inner join   I_Customer           as Customer on Customer.Customer = JournalLineItem.Customer
{
      @ObjectModel.foreignKey.association: '_CompanyCode'
  key JournalLineItem.CompanyCode        as CompanyCode,
      @ObjectModel.foreignKey.association: '_FiscalYear'
  key JournalLineItem.FiscalYear         as FiscalYear,
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key JournalLineItem.AccountingDocument as AccountingDocument,
  key JournalLineItem.LedgerGLLineItem   as LedgerGLLineItem,
      @ObjectModel.foreignKey.association: '_Ledger'
  key JournalLineItem.Ledger             as Ledger,

      JournalLineItem.PostingDate,
      JournalLineItem.Customer,
      JournalLineItem.Supplier,
      JournalLineItem.VATRegistration,
      ''                                 as IsOneTimeAccount,
      JournalLineItem.GLAccount,
      Customer.TaxNumber1,
      Customer.TaxNumber2,
      
      //Associations

      JournalLineItem._CompanyCode,
      JournalLineItem._FiscalYear,
      JournalLineItem._JournalEntry,
      JournalLineItem._Ledger      
}
where
      Customer.IsOneTimeAccount            = ' '
  and JournalLineItem.FinancialAccountType = 'D'


union select from I_NO_SAFTJournalItem as JournalLineItem
  inner join      I_Supplier           as Supplier on Supplier.Supplier = JournalLineItem.Supplier
{
      @ObjectModel.foreignKey.association: '_CompanyCode'
  key JournalLineItem.CompanyCode        as CompanyCode,
      @ObjectModel.foreignKey.association: '_FiscalYear'
  key JournalLineItem.FiscalYear         as FiscalYear,
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key JournalLineItem.AccountingDocument as AccountingDocument,
  key JournalLineItem.LedgerGLLineItem   as LedgerGLLineItem,
      @ObjectModel.foreignKey.association: '_Ledger'
  key JournalLineItem.Ledger             as Ledger,

      JournalLineItem.PostingDate,
      JournalLineItem.Customer,
      JournalLineItem.Supplier,
      JournalLineItem.VATRegistration,
      ''                                 as IsOneTimeAccount,
      JournalLineItem.GLAccount,
      Supplier.TaxNumber1,
      Supplier.TaxNumber2,
      
      //Associations

      JournalLineItem._CompanyCode,
      JournalLineItem._FiscalYear,
      JournalLineItem._JournalEntry,
      JournalLineItem._Ledger      
}
where
      Supplier.IsOneTimeAccount            = ' '
  and JournalLineItem.FinancialAccountType = 'K'


union select from I_NO_SAFTJournalItem as JournalLineItem
  inner join      I_Customer           as Customer on Customer.Customer = JournalLineItem.Customer
  inner join      I_JournalEntryItemOneTimeData   as OTC      on  JournalLineItem.CompanyCode            = OTC.CompanyCode
                                                   and JournalLineItem.FiscalYear             = OTC.FiscalYear
                                                   and JournalLineItem.AccountingDocument     = OTC.AccountingDocument
                                                   and JournalLineItem.AccountingDocumentItem = OTC.AccountingDocumentItem

{

      @ObjectModel.foreignKey.association: '_CompanyCode'
  key JournalLineItem.CompanyCode        as CompanyCode,
      @ObjectModel.foreignKey.association: '_FiscalYear'
  key JournalLineItem.FiscalYear         as FiscalYear,
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key JournalLineItem.AccountingDocument as AccountingDocument,
  key JournalLineItem.LedgerGLLineItem   as LedgerGLLineItem,
      @ObjectModel.foreignKey.association: '_Ledger'
  key JournalLineItem.Ledger             as Ledger,

      JournalLineItem.PostingDate,
      JournalLineItem.Customer,
      JournalLineItem.Supplier,
      case
        when OTC.TaxID1 is not initial
            then OTC.TaxID1
        else substring(JournalLineItem.VATRegistration ,3,18)
      end                                as VATRegistration,
      'X'                                as IsOneTimeAccount,
      ''                                 as GLAccount,
      ''                                 as TaxNumber1,
      ''                                 as TaxNumber2,
      
      //Associations

      JournalLineItem._CompanyCode,
      JournalLineItem._FiscalYear,
      JournalLineItem._JournalEntry,
      JournalLineItem._Ledger      
      
}
where
      Customer.IsOneTimeAccount            = 'X'
  and JournalLineItem.FinancialAccountType = 'D'


union select from I_NO_SAFTJournalItem as JournalLineItem
  inner join      I_Supplier           as Supplier on Supplier.Supplier = JournalLineItem.Supplier
  inner join      I_JournalEntryItemOneTimeData   as OTS      on  JournalLineItem.CompanyCode            = OTS.CompanyCode
                                                   and JournalLineItem.FiscalYear             = OTS.FiscalYear
                                                   and JournalLineItem.AccountingDocument     = OTS.AccountingDocument
                                                   and JournalLineItem.AccountingDocumentItem = OTS.AccountingDocumentItem

{

      @ObjectModel.foreignKey.association: '_CompanyCode'
  key JournalLineItem.CompanyCode        as CompanyCode,
      @ObjectModel.foreignKey.association: '_FiscalYear'
  key JournalLineItem.FiscalYear         as FiscalYear,
      @ObjectModel.foreignKey.association: '_JournalEntry'
  key JournalLineItem.AccountingDocument as AccountingDocument,
  key JournalLineItem.LedgerGLLineItem   as LedgerGLLineItem,
      @ObjectModel.foreignKey.association: '_Ledger'
  key JournalLineItem.Ledger             as Ledger,

      JournalLineItem.PostingDate,
      JournalLineItem.Customer,
      JournalLineItem.Supplier,
      case
         when OTS.TaxID1 is not initial
             then substring(OTS.TaxID1 ,3,18)
         when JournalLineItem.VATRegistration is not initial
             then substring(JournalLineItem.VATRegistration ,3,18)
       else ''
       end                               as VATRegistration,
      'X'                                as IsOneTimeAccount,
      ''                                 as GLAccount,
      ''                                 as TaxNumber1,
      ''                                 as TaxNumber2,
      
      //Associations

      JournalLineItem._CompanyCode,
      JournalLineItem._FiscalYear,
      JournalLineItem._JournalEntry,
      JournalLineItem._Ledger      
}
where
      Supplier.IsOneTimeAccount            = 'X'
  and JournalLineItem.FinancialAccountType = 'K'