@AbapCatalog.sqlViewName: 'ICSCUOVERVIEW'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType: {
dataClass: #MASTER,
serviceQuality: #D,
sizeCategory: #M
}
@ClientHandling: {
type: #CLIENT_DEPENDENT,
algorithm: #SESSION_VARIABLE
}
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Consolidation Unit Overview'
define view I_CnsldtnUnitOverview
as select from P_CnsldtnUnitOverview as _Overview
inner join I_CnsldtnVersion as _CnsldtnVersion on _Overview.ConsolidationVersion = _CnsldtnVersion.ConsolidationVersion
association [0..1] to P_CnsldtnExtnVersAcctgInteg as _CnsldtnExtnVersAcctgInteg on _Overview.ConsolidationVersion = _CnsldtnExtnVersAcctgInteg.ConsolidationVersion
//do not expose this association in the projection list of the view
association [1..1] to E_CnsldtnUnit as _CnsldtnUnitExtension on _Overview.ConsolidationUnit = _CnsldtnUnitExtension.ConsolidationUnit
//do not expose this association in the projection list of the view
association [0..1] to E_CnsldtnUnitByTimeVersion as _CnsldtnUnitByTimeVrsnExtnsn on _Overview.ConsolidationUnit = _CnsldtnUnitByTimeVrsnExtnsn.ConsolidationUnit
and _Overview.CnsldtnUnitAttributeVersion = _CnsldtnUnitByTimeVrsnExtnsn.CnsldtnUnitAttributeVersion
and _Overview.FiscalYearPeriod = _CnsldtnUnitByTimeVrsnExtnsn.FromFiscalYearPeriod
{
key _Overview.ConsolidationDimension,
key _Overview.ConsolidationUnit,
key _Overview.ConsolidationVersion,
key _Overview.FromFiscalYearPeriod,
_Overview.ToFiscalYearPeriod,
_Overview.CnsldtnUnitAttributeVersion,
_Overview.Country,
_Overview.ConsolidationUnitLink,
_Overview.ConsolidationUnitLinkLabel,
_Overview.ConsolidationUnitLocalCurrency,
//suppression in case of tight accounting integration and plan versions
case
when _Overview.CnsldtnFrmYrForAcctgInteg <> '0000' and _CnsldtnVersion.CnsldtnIsPlanVersion = 'X'
then cast( '' as rcomp_d )
else
_Overview.Company
end as Company,
_Overview.ConsolidationUnitIsPartnerOnly,
//display of deviating fiscal year variant
//do not display deviating fiscal year variant in case of integration and non-plan version for tight accounting integration interval
case
when _Overview.CnsldtnDataTransferMethod = 'H' and _CnsldtnVersion.CnsldtnIsPlanVersion = '' and _Overview.CnsldtnFrmYrForAcctgInteg <> '0000'
then cast( '' as fincs_bunit_periv )
else _Overview.FiscalYearVariant
end as FiscalYearVariant,
//display of data transfer method
//case one - technical interval existing and non-plan version with initial source ledger and integration used as data transfer method then clear data transfer method
//source ledger depending if tight accounting integration is active
//case two - no technical interval existing then display flexible upload as default
case
//case one
when ( _Overview.CnsldtnDataTransferMethod = 'H' and _CnsldtnVersion.CnsldtnIsPlanVersion = '' and _CnsldtnVersion.CnsldtnSourceLedger = '' and ( _Overview.CnsldtnFrmYrForAcctgInteg = '0000' or _Overview.CnsldtnFrmYrForAcctgInteg is null ) ) //no tight accounting integration
or ( _Overview.CnsldtnDataTransferMethod = 'H' and _CnsldtnVersion.CnsldtnIsPlanVersion = '' and _CnsldtnVersion.CnsldtnAccountingSourceLedger = '' and _Overview.CnsldtnFrmYrForAcctgInteg <> '0000' ) //tight accounting integration
or ( _Overview.CnsldtnDataTransferMethod = 'H' and _CnsldtnExtnVersAcctgInteg.CnsldtnUnitAcctgIntegIsDsbld = 'X' ) //data relese task not supported in restatement
then cast( '' as fincs_datatransfermethod )
//case two
when _Overview.CnsldtnDataTransferMethod = '' and _Overview.ConsolidationUnitIsPartnerOnly = '' //no existing technical interval
then cast( 'U' as fincs_datatransfermethod )
else
_Overview.CnsldtnDataTransferMethod
end as CnsldtnDataTransferMethod,
_Overview.CnsldtnUploadMethod,
_Overview.CnsldtnCrcyTranslationMethod,
_Overview.TaxRate,
_Overview.DocumentEntryIsInGroupCurrency,
//suppression of source fields in case of non-plan version with initial source ledger or plan version or tight accounting integration
case
when _Overview.CnsldtnDataTransferMethod = 'H'
and ( _CnsldtnVersion.CnsldtnIsPlanVersion = 'X'
or _CnsldtnExtnVersAcctgInteg.CnsldtnUnitAcctgIntegIsDsbld = 'X' //data relese task not supported in restatement
or ( _CnsldtnVersion.CnsldtnIsPlanVersion = '' and _CnsldtnVersion.CnsldtnSourceLedger = '' and ( _Overview.CnsldtnFrmYrForAcctgInteg = '0000' or _Overview.CnsldtnFrmYrForAcctgInteg is null ) ) //no tight accounting integration
or ( _Overview.CnsldtnFrmYrForAcctgInteg <> '0000' ) //tight accounting integration
)
then cast( '' as fincs_local_curr_source )
else
_Overview.CnsldtnUnitLocalCrcySource
end as CnsldtnUnitLocalCrcySource,
case
when _Overview.CnsldtnDataTransferMethod = 'H'
and ( _CnsldtnVersion.CnsldtnIsPlanVersion = 'X'
or _CnsldtnExtnVersAcctgInteg.CnsldtnUnitAcctgIntegIsDsbld = 'X' //data relese task not supported in restatement
or ( _CnsldtnVersion.CnsldtnIsPlanVersion = '' and _CnsldtnVersion.CnsldtnSourceLedger = '' and ( _Overview.CnsldtnFrmYrForAcctgInteg = '0000' or _Overview.CnsldtnFrmYrForAcctgInteg is null ) ) //no tight accounting integration
or ( _Overview.CnsldtnFrmYrForAcctgInteg <> '0000' ) //tight accounting integration
)
then cast( '' as fincs_group_curr_source )
else
_Overview.CnsldtnUnitGroupCrcySource
end as CnsldtnUnitGroupCrcySource,
_Overview.CnsldtnUnitDataCollection,
_Overview.ConsolidationUnitPartner,
_Overview.ConsolidationUnitPostingRule,
_Overview.ConsolidationUnitValidation,
// purpose: association to extension include view in higher layers of view stack
_Overview.FiscalYearPeriod
}
where
FromFiscalYearPeriod <= ToFiscalYearPeriod
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CNSLDTNVERSION",
"P_CNSLDTNEXTNVERSACCTGINTEG",
"P_CNSLDTNUNITOVERVIEW"
],
"ASSOCIATED":
[
"E_CNSLDTNUNIT",
"E_CNSLDTNUNITBYTIMEVERSION",
"P_CNSLDTNEXTNVERSACCTGINTEG"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/