@AbapCatalog.sqlViewName : 'PGLACCTINCOCODE'
@AbapCatalog.compiler.compareFilter: true
@VDM.private:true
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_GLACCTWITHCOCODE
with parameters
p_FinancialStatementHierarchy : hryid,
P_AlternativeGLAccountIsUsed : char1
//as select from I_GLAccountInCompanyCode as GLAccountInCompanyCode
as select distinct from I_GLAccountInCompanyCode as GLAccountInCompanyCode
inner join I_CompanyCode CompanyCode on
CompanyCode.CompanyCode = GLAccountInCompanyCode.CompanyCode
// inner join I_FinancialStatementVersion as FSVERSION
// on FSVERSION.FinancialStatementVariant = $parameters .p_FinancialStatementHierarchy
// FSV migration adaption
inner join I_FinancialStatementHier as FSVERSION
on FSVERSION.FinancialStatementHierarchy = $parameters .p_FinancialStatementHierarchy
left outer join I_GLAccountInChartOfAccounts as CorporateGroupAccount on
CompanyCode.ChartOfAccounts = CorporateGroupAccount.ChartOfAccounts and
CorporateGroupAccount.GLAccount = GLAccountInCompanyCode.GLAccount
left outer join I_ChartOfAccounts ChartOfAccounts on
CorporateGroupAccount.ChartOfAccounts = ChartOfAccounts.ChartOfAccounts
association [0..*] to I_GlAccountTextInCompanycode as _Text on $projection.CompanyCode = _Text.CompanyCode
and $projection.GLAccount = _Text.GLAccount
{
key GLAccountInCompanyCode.GLAccount,
key GLAccountInCompanyCode.CompanyCode,
CorporateGroupAccount.ChartOfAccounts,
cast (case $parameters .P_AlternativeGLAccountIsUsed
when '1' then _CompanyCode.CountryChartOfAccounts
else ''
end as ktop2) as CountryChartOfAccounts,
case $parameters .P_AlternativeGLAccountIsUsed
when '1' then ''
else AlternativeGLAccount
end as AlternativeGLAccount,
case $parameters .P_AlternativeGLAccountIsUsed
when '1' then
case when AlternativeGLAccount = '' then
GLAccountInCompanyCode.GLAccount
else
AlternativeGLAccount
end
// else GLAccountInCompanyCode.GLAccount
else case FSVERSION.GroupChartOfAccountIsUsed
when 'X' then case when CorporateGroupAccount.CorporateGroupAccount = '' then GLAccountInCompanyCode.GLAccount
else CorporateGroupAccount.CorporateGroupAccount
end
else GLAccountInCompanyCode.GLAccount
end
end as GLAccountExternal,
ChartOfAccounts.CorporateGroupChartOfAccounts,
CorporateGroupAccount.CorporateGroupAccount,
_Text
}
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_CHARTOFACCOUNTS",
"I_COMPANYCODE",
"I_FINANCIALSTATEMENTHIER",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_GLACCOUNTINCOMPANYCODE"
],
"ASSOCIATED":
[
"I_GLACCOUNTTEXTINCOMPANYCODE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload