P_RU_DSVATReportingExclSubmd

DDL: P_RU_DSVATREPORTINGEXCLSUBMD SQL: PRUDSVATRPTGEXS Type: view CONSUMPTION

P_RU_DSVATReportingExclSubmd is a Consumption CDS View in SAP S/4HANA. It reads from 3 data sources (I_StRpRepRun, I_RU_StRpJournalEntryLog, I_StRpRepRun) and exposes 12 fields.

Data Sources (3)

SourceAliasJoin Type
I_StRpRepRun CurrentRun from
I_RU_StRpJournalEntryLog SubmittedDoc inner
I_StRpRepRun SubmittedRun inner

Annotations (6)

NameValueLevelField
VDM.private true view
VDM.viewType #CONSUMPTION view
AbapCatalog.sqlViewName PRUDSVATRPTGEXS view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (12)

KeyFieldSource TableSource FieldDescription
CompanyCode I_RU_StRpJournalEntryLog CompanyCode
AccountingDocument I_RU_StRpJournalEntryLog AccountingDocument
FiscalYear I_RU_StRpJournalEntryLog FiscalYear
TaxItem I_RU_StRpJournalEntryLog TaxItem
RevisionNumber I_RU_StRpJournalEntryLog RevisionNumber
RU_VATReturnSectionType I_RU_StRpJournalEntryLog RU_VATReturnSectionType
StatryRptgEntity I_StRpRepRun StatryRptgEntity
StatryRptCategory I_StRpRepRun StatryRptCategory
SubmittedStatryRptRunID I_StRpRepRun StatryRptRunID
SubmittedStatryRptRunType I_StRpRepRun StatryRptRunType
CurrentStatryRptRunID I_StRpRepRun StatryRptRunID
CurrentStatryRptRunType I_StRpRepRun StatryRptRunType
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@AbapCatalog.sqlViewName: 'PRUDSVATRPTGEXS'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
define view P_RU_DSVATReportingExclSubmd
  as select from I_StRpRepRun             as CurrentRun

    inner join   I_StRpRepRun             as SubmittedRun on  SubmittedRun.StatryRptgEntity   = CurrentRun.StatryRptgEntity
                                                          and SubmittedRun.StatryRptCategory  = CurrentRun.StatryRptCategory
                                                          and SubmittedRun.StatryRptRunStatus = 'SOK'

    inner join   I_RU_StRpJournalEntryLog as SubmittedDoc on  SubmittedDoc.StatryRptgEntity  = SubmittedRun.StatryRptgEntity
                                                          and SubmittedDoc.StatryRptCategory = SubmittedRun.StatryRptCategory
                                                          and SubmittedDoc.StatryRptRunID    = SubmittedRun.StatryRptRunID

{
  SubmittedDoc.CompanyCode,
  SubmittedDoc.AccountingDocument,
  SubmittedDoc.FiscalYear,
  SubmittedDoc.TaxItem,
  SubmittedDoc.RevisionNumber,
  SubmittedDoc.RU_VATReturnSectionType,

  SubmittedRun.StatryRptgEntity,
  SubmittedRun.StatryRptCategory,
  SubmittedRun.StatryRptRunID             as SubmittedStatryRptRunID,
  SubmittedRun.StatryRptRunType           as SubmittedStatryRptRunType,
  CurrentRun.StatryRptRunID               as CurrentStatryRptRunID,
  CurrentRun.StatryRptRunType             as CurrentStatryRptRunType
}
where
  //default rule: submitted documents in previous periods

       SubmittedRun.StatryRptTaskUUID       <> CurrentRun.StatryRptTaskUUID

  //for SPLedgers: all submitted documents

  or   SubmittedRun.StatryRptCategory       =  'RU_SALES_LEDGER'
  or   SubmittedRun.StatryRptCategory       =  'RU_PURCHASE_LEDGER'

  //for 8/9 sections of VAT Return: submitted documents in previous periods + for ACORR phase: submitted documents in STAND/CORR phases of current period

  or   SubmittedRun.StatryRptCategory       =  'RU_VAT_DCL'
  and(
       SubmittedDoc.RU_VATReturnSectionType =  '8'
    or SubmittedDoc.RU_VATReturnSectionType =  '9'
  )
  and  CurrentRun.StatryRptRunType          =  'ACORR' //correction phase

  and  SubmittedRun.StatryRptRunType        <> 'ACORR' //stadard or additional phase

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RU_STRPJOURNALENTRYLOG",
"I_STRPREPRUN"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0
}
}*/