P_GLACCTWITHCOCODE
CDS views for GL accounts in company code
P_GLACCTWITHCOCODE is a Composite CDS View that provides data about "CDS views for GL accounts in company code" in SAP S/4HANA. It reads from 4 data sources (I_GLAccountInChartOfAccounts, I_FinancialStatementHier, I_ChartOfAccounts, I_CompanyCode) and exposes 7 fields with key fields GLAccount, CompanyCode. It has 1 association to related views. Part of development package GLO_FIN_IS_FS_GEN.
Data Sources (4)
| Source | Alias | Join Type |
|---|---|---|
| I_GLAccountInChartOfAccounts | CorporateGroupAccount | left_outer |
| I_FinancialStatementHier | FSVERSION | inner |
| I_ChartOfAccounts | I_ChartOfAccounts | left_outer |
| I_CompanyCode | I_CompanyCode | inner |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| p_FinancialStatementHierarchy | hryid | |
| P_AlternativeGLAccountIsUsed | char1 |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..*] | I_GlAccountTextInCompanycode | _Text | $projection.CompanyCode = _Text.CompanyCode and $projection.GLAccount = _Text.GLAccount |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PGLACCTINCOCODE | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (7)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | GLAccount | GLAccountInCompanyCode | GLAccount | |
| KEY | CompanyCode | GLAccountInCompanyCode | CompanyCode | |
| ChartOfAccounts | I_GLAccountInChartOfAccounts | ChartOfAccounts | ||
| GLAccountendendasGLAccountExternal | ||||
| CorporateGroupChartOfAccounts | ChartOfAccounts | CorporateGroupChartOfAccounts | ||
| CorporateGroupAccount | I_GLAccountInChartOfAccounts | CorporateGroupAccount | ||
| _Text | _Text |
@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
}
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA