P_PL_StRpReportingGroupsCr

DDL: P_PL_STRPREPORTINGGROUPSCR SQL: PSRPLRPGGRPCR Type: view CONSUMPTION

Reporting Groups - Correction Run

P_PL_StRpReportingGroupsCr is a Consumption CDS View that provides data about "Reporting Groups - Correction Run" in SAP S/4HANA. It reads from 4 data sources (I_StRpRepRun, I_StRpJournalEntryLog, I_StRpTaskDetails, I_StRpRepRun) and exposes 7 fields with key fields StatryRptCategory, StatryRptRunID, StatryRptgEntity, CompanyCode, VATRegistration.

Data Sources (4)

SourceAliasJoin Type
I_StRpRepRun CurrRun left_outer
I_StRpJournalEntryLog I_StRpJournalEntryLog left_outer
I_StRpTaskDetails I_StRpTaskDetails left_outer
I_StRpRepRun LastAccRun left_outer

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PSRPLRPGGRPCR view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Reporting Groups - Correction Run view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #BLOCKED_DATA_INCLUDED view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY StatryRptCategory I_StRpTaxItmWithEUTaxClass StatryRptCategory
KEY StatryRptRunID I_StRpTaxItmWithEUTaxClass StatryRptRunID
KEY StatryRptgEntity I_StRpTaxItmWithEUTaxClass StatryRptgEntity
KEY CompanyCode I_StRpTaxItmWithEUTaxClass CompanyCode
KEY VATRegistration VATRegistration
KEY TaxType TaxType
KEY IsEUTriangularDeal IsEUTriangularDeal
@AbapCatalog.sqlViewName: 'PSRPLRPGGRPCR'
@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Reporting Groups - Correction Run'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #BLOCKED_DATA_INCLUDED

define view P_PL_StRpReportingGroupsCr 
  as select distinct from I_StRpTaxItmWithEUTaxClass

        left outer join I_StRpRepRun as CurrRun on  I_StRpTaxItmWithEUTaxClass.StatryRptgEntity  = CurrRun.StatryRptgEntity
                                                and I_StRpTaxItmWithEUTaxClass.StatryRptCategory = CurrRun.StatryRptCategory
                                                and I_StRpTaxItmWithEUTaxClass.StatryRptRunID = CurrRun.StatryRptRunID
        
        left outer join I_StRpRepRun as LastAccRun on  I_StRpTaxItmWithEUTaxClass.StatryRptgEntity  = LastAccRun.StatryRptgEntity
                                                   and I_StRpTaxItmWithEUTaxClass.StatryRptCategory = LastAccRun.StatryRptCategory
                                                   and LastAccRun.StatryRptTaskUUID = CurrRun.StatryRptTaskUUID
                                                   and LastAccRun.StatryRptRunType = 'STAND'
                                                   and LastAccRun.StatryRptRunStatus = 'SOK'
                                                   
        left outer join I_StRpTaskDetails on I_StRpTaskDetails.StatryRptTaskUUID = CurrRun.StatryRptTaskUUID
                                                   
        left outer join I_StRpJournalEntryLog on  LastAccRun.StatryRptgEntity  = I_StRpJournalEntryLog.StatryRptgEntity
                                              and LastAccRun.StatryRptCategory = I_StRpJournalEntryLog.StatryRptCategory
                                              and LastAccRun.StatryRptRunID    = I_StRpJournalEntryLog.StatryRptRunID
                                              and I_StRpJournalEntryLog.CompanyCode = I_StRpTaxItmWithEUTaxClass.CompanyCode 
                                              and I_StRpJournalEntryLog.AccountingDocument = I_StRpTaxItmWithEUTaxClass.AccountingDocument
                                              and I_StRpJournalEntryLog.FiscalYear = I_StRpTaxItmWithEUTaxClass.FiscalYear
                                              
{
  key I_StRpTaxItmWithEUTaxClass.StatryRptCategory,
  key I_StRpTaxItmWithEUTaxClass.StatryRptRunID,
  key I_StRpTaxItmWithEUTaxClass.StatryRptgEntity,
  key I_StRpTaxItmWithEUTaxClass.CompanyCode,
  key VATRegistration,
  key cast((case 
        when EUTaxClassification = '1' or EUTaxClassification = '3' or EUTaxClassification = '9' then 'G' 
        when EUTaxClassification = '4' then 'S' 
      end) as fipl_ecsl_operation_key) as OfficialTaxOperationKey,
  key TaxType, 
  key IsEUTriangularDeal
}
where
      (EUTaxClassification = '1' or EUTaxClassification = '3' or EUTaxClassification = '9' or EUTaxClassification = '4') and 
      ReportingCountry = 'PL' and 
      I_StRpJournalEntryLog.AccountingDocument is null and
      ReportingDate >= I_StRpTaskDetails.StatryRptTaskPeriodStartDate and
      ReportingDate <= I_StRpTaskDetails.StatryRptTaskPeriodEndDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_STRPJOURNALENTRYLOG",
"I_STRPREPRUN",
"I_STRPTASKDETAILS",
"I_STRPTAXITMWITHEUTAXCLASS"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/