P_RO_SAFTSALINVHDR1
Sales Inv Header for RO SAFT Base 1
P_RO_SAFTSALINVHDR1 is a CDS View in S/4HANA. Sales Inv Header for RO SAFT Base 1. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| C_RO_SAFTSalesInvoiceHeader | view | from | CONSUMPTION | Sales invoice header for RO SAFT |
@AbapCatalog.sqlViewName:'PROSAFTSALIH1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@VDM.viewType: #CONSUMPTION
@VDM.private:true
@EndUserText.label: 'Sales Inv Header for RO SAFT Base 1'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED
/**
- This view selects exactly one item of each sales invoice
- The selected item is a customer item
- In case of more customers it is the item whose AccountingDocumentItem is the highest
**/
define view P_RO_SAFTSalInvHdr1
with parameters
P_AlternativeGLAccountIsUsed : saft_ro_alt_gl_account_flag
as select from I_StRpJournalEntryHeaderLog as Log
inner join P_RO_SAFTInvoiceItemCount(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as ItemCount on ItemCount.AccountingDocument = Log.AccountingDocument
and ItemCount.CompanyCode = Log.CompanyCode
and ItemCount.FiscalYear = Log.FiscalYear
inner join P_RO_SAFTJournalEntryItemExc(P_AlternativeGLAccountIsUsed: $parameters.P_AlternativeGLAccountIsUsed) as Acdoca on Acdoca.AccountingDocument = Log.AccountingDocument
and Acdoca.CompanyCode = Log.CompanyCode
and Acdoca.FiscalYear = Log.FiscalYear
and Acdoca.FinancialAccountType = 'D'
inner join I_RO_SAFTDocumentTypeMap as DocType on Acdoca.AccountingDocumentType = DocType.AccountingDocumentType
and DocType.RO_SAFTSourceDocumentType = '01'
and DocType.CompanyCode = Log.CompanyCode
left outer to one join I_RO_SAFTSpecialGLIndicator as SpecialGLIndicator on Acdoca.CompanyCode = SpecialGLIndicator.CompanyCode
and Acdoca.FinancialAccountType = SpecialGLIndicator.AccountType
and Acdoca.SpecialGLCode = SpecialGLIndicator.SpecialGLCode
{
key Log.StatryRptCategory,
key Log.StatryRptgEntity,
key Log.StatryRptRunID,
key Acdoca.SourceLedger,
key Acdoca.CompanyCode,
key Acdoca.FiscalYear,
key Acdoca.AccountingDocument,
key Acdoca.Ledger,
max(Acdoca.AccountingDocumentItem) as AccountingDocumentItem
}
where SpecialGLIndicator.SpecialGLCode is null
group by
Log.StatryRptCategory,
Log.StatryRptgEntity,
Log.StatryRptRunID,
Acdoca.SourceLedger,
Acdoca.CompanyCode,
Acdoca.FiscalYear,
Acdoca.Ledger,
Acdoca.AccountingDocument
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RO_SAFTDOCUMENTTYPEMAP",
"I_RO_SAFTSPECIALGLINDICATOR",
"I_STRPJOURNALENTRYHEADERLOG",
"P_RO_SAFTINVOICEITEMCOUNT",
"P_RO_SAFTJOURNALENTRYITEMEXC"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/