P_RO_SAFTPaymentHeader

DDL: P_RO_SAFTPAYMENTHEADER SQL: PROSAFTPAYHDR Type: view CONSUMPTION Package: GLO_FIN_IS_SAFT_RO

RO SAFT Payment Header for totals calculation

P_RO_SAFTPaymentHeader is a Consumption CDS View that provides data about "RO SAFT Payment Header for totals calculation" in SAP S/4HANA. It reads from 4 data sources (I_OperationalAcctgDocItem, I_StRpJournalEntryHeaderLog, P_RO_SAFTJournalEntryItemExc, I_RO_SAFTPaymentMethod) and exposes 8 fields with key fields StatryRptCategory, StatryRptgEntity, StatryRptRunID, SourceLedger, CompanyCode. Part of development package GLO_FIN_IS_SAFT_RO.

Data Sources (4)

SourceAliasJoin Type
I_OperationalAcctgDocItem Bseg inner
I_StRpJournalEntryHeaderLog Log from
P_RO_SAFTJournalEntryItemExc P_RO_SAFTJournalEntryItemExc inner
I_RO_SAFTPaymentMethod PaymentMethod inner

Parameters (1)

NameTypeDefault
P_AlternativeGLAccountIsUsed saft_ro_alt_gl_account_flag

Annotations (11)

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

Fields (8)

KeyFieldSource TableSource FieldDescription
KEY StatryRptCategory I_StRpJournalEntryHeaderLog StatryRptCategory
KEY StatryRptgEntity I_StRpJournalEntryHeaderLog StatryRptgEntity
KEY StatryRptRunID I_StRpJournalEntryHeaderLog StatryRptRunID
KEY SourceLedger Item SourceLedger
KEY CompanyCode Item CompanyCode
KEY FiscalYear Item FiscalYear
KEY AccountingDocument Item AccountingDocument
KEY Ledger Item Ledger
@AbapCatalog.sqlViewName: 'PROSAFTPAYHDR'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #CONSUMPTION
@VDM.private:true
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_RO_SAFTPaymentHeader
  with parameters
    P_AlternativeGLAccountIsUsed : saft_ro_alt_gl_account_flag
  as select from            I_StRpJournalEntryHeaderLog                                                                          as Log

    inner join              P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as Item                        on  Log.AccountingDocument = Item.AccountingDocument
                                                                                                                                                                and Log.CompanyCode        = Item.CompanyCode
                                                                                                                                                                and Log.FiscalYear         = Item.FiscalYear


    inner join              I_OperationalAcctgDocItem                                                                            as Bseg                        on  Bseg.AccountingDocument     = Item.AccountingDocument
                                                                                                                                                                and Bseg.CompanyCode            = Item.CompanyCode
                                                                                                                                                                and Bseg.FiscalYear             = Item.FiscalYear
                                                                                                                                                                and Bseg.AccountingDocumentItem = Item.AccountingDocumentItem

    inner join              I_RO_SAFTPaymentMethod                                                                               as PaymentMethod               on  PaymentMethod.CompanyCode   = Bseg.CompanyCode
                                                                                                                                                                and PaymentMethod.PaymentMethod = Bseg.PaymentMethod

    left outer to one join  I_RO_SAFTPaymentMapping                                                                              as PayMapNoGL                  on  PayMapNoGL.CompanyCode            = Item.CompanyCode
                                                                                                                                                                and PayMapNoGL.AccountingDocumentType = Item.AccountingDocumentType
                                                                                                                                                                and PayMapNoGL.GLAccount              = ' '
                                                                                                                                                                and (
                                                                                                                                                                   Item.FinancialAccountType          = 'D'
                                                                                                                                                                   or Item.FinancialAccountType       = 'K'
                                                                                                                                                                 )

    left outer to one join  I_RO_SAFTPaymentMapping                                                                              as PayMapGL                    on  PayMapGL.CompanyCode            = Item.CompanyCode
                                                                                                                                                                and PayMapGL.AccountingDocumentType = Item.AccountingDocumentType
                                                                                                                                                                and PayMapGL.GLAccount              = Item.ActiveGLAccount

{
  key Log.StatryRptCategory,
  key Log.StatryRptgEntity,
  key Log.StatryRptRunID,
  key Item.SourceLedger,
  key Item.CompanyCode,
  key Item.FiscalYear,
  key Item.AccountingDocument,
  key Item.Ledger
}
where
     PayMapNoGL.CompanyCode is not null
  or PayMapGL.CompanyCode   is not null
group by
Log.StatryRptCategory,
Log.StatryRptgEntity,
Log.StatryRptRunID,
Item.SourceLedger,
Item.CompanyCode,
Item.FiscalYear,
Item.AccountingDocument,
Item.Ledger