V_Coss_R_8_View
CO Object: Cost Totals for Internal Postings ("Rev.") Part 8
V_Coss_R_8_View is a CDS View that provides data about "CO Object: Cost Totals for Internal Postings ("Rev.") Part 8" in SAP S/4HANA. It reads from 4 data sources (t000, tj01, tka01, finsc_cmp_versnc).
Data Sources (4)
| Source | Alias | Join Type |
|---|---|---|
| t000 | s | inner |
| tj01 | t | inner |
| tka01 | tk | inner |
| finsc_cmp_versnc | v | inner |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | V_COSS_R_8 | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| EndUserText.label | CO Object: Cost Totals for Internal Postings ("Rev.") Part 8 | view |
@AbapCatalog.sqlViewName: 'V_COSS_R_8'
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #P
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'CO Object: Cost Totals for Internal Postings ("Rev.") Part 8'
define view V_Coss_R_8_View as
select
-- key fields for totals (w/o period block)
key a.rclnt as mandt,
key '00' as lednr,
key a.objnr as objnr,
key a.ryear as gjahr, --- a.gjahr as GJAHR
key case when a.accasty > '' then '04' else '11' end as wrttp,
key v.versn as versn,
key a.racct as kstar,
key a.hrkft as hrkft,
key a.vrgng as vrgng,
key case when parobsrc = '1' then parob1 else case when parobsrc = '2' then paccasty else '' end end as parob,
key a.uspob as uspob,
key a.co_beknz as beknz,
key a.rwcur as twaer,
-- period
a.poper as perio,
-- a.rvunit as meinh,
a.co_meinh as meinh,
-- value fields
case
// when ( tk.xwbuk = '' ) and ( ( bstat = 'C' and co_osl <> 0 )
// or ( bstat <> 'C' and rco_ocur <> '' ) )
// then co_osl
when wogbtr = 'CO_OSL' then co_osl
when wogbtr = 'KSL' then ksl
when wogbtr = 'HSL' then hsl
when wogbtr = 'OSL' then osl
when wogbtr = 'VSL' then vsl
when wogbtr = 'BSL' then bsl
when wogbtr = 'CSL' then csl
when wogbtr = 'DSL' then dsl
when wogbtr = 'ESL' then esl
when wogbtr = 'FSL' then fsl
when wogbtr = 'GSL' then gsl
else 0
end as wogbtr,
case wtgbtr
when 'WSL' then wsl
when 'WSL2' then wsl2
when 'WSL3' then wsl3
else 0
end as wtgbtr,
case wkgbtr
when 'KSL' then ksl
when 'HSL' then hsl
when 'OSL' then osl
when 'VSL' then vsl
when 'BSL' then bsl
when 'CSL' then csl
when 'DSL' then dsl
when 'ESL' then esl
when 'FSL' then fsl
when 'GSL' then gsl
else 0
end as wkgbtr,
case wkfbtr
when 'KFSL' then kfsl
when 'KFSL2' then kfsl2
when 'KFSL3' then kfsl3
else 0
end as wkfbtr,
case pagbtr
when 'PSL' then psl
when 'PSL2' then psl2
when 'PSL3' then psl3
else 0
end as pagbtr,
case pafbtr
when 'PFSL' then pfsl
when 'PFSL2' then pfsl2
when 'PFSL3' then pfsl3
else 0
end as pafbtr,
-- a.vmsl as megbtr,
-- a.vmfsl as mefbtr,
a.co_megbtr as megbtr,
a.co_mefbtr as mefbtr,
cast(a.muvflg as abap.int1) as muvflg,
-- additional fields
a.vsl as wvgbtr,
a.fsl as wfgbtr,
a.rvcur as vwaer,
a.rfcur as fwaer,
-- add attributes
a.beltp as beltp,
a.rbukrs as bukrs,
a.rfarea as fkber,
a.segment as segment,
a.rfund as geber,
a.rgrant_nbr as grant_nbr,
a.rbudget_pd as budget_pd,
-----------------------------------------
--- timestamp as TIMESTMP, --- calculation on higher level
--- ACDOCA, timestamp in YYYY MM DD HH MM SS 20.141.030.145.000 / COEP, timestmp in seconds: 7.835.286.530.000
case when a.timestamp > 0 then cast(substring(cast(a.timestamp as abap.char(19)),1,4) as abap.numc(4)) else '0000' end as tsgjahr,
case when a.timestamp > 0 then cast(substring(cast(a.timestamp as abap.char(19)),5,2) as abap.numc(2)) else '00' end as tsmonth,
case when a.timestamp > 0 then cast(substring(cast(a.timestamp as abap.char(19)),7,2) as abap.numc(2)) else '00' end as tsday,
case when a.timestamp > 0 then cast(substring(cast(a.timestamp as abap.char(19)),9,2) as abap.numc(2)) else '00' end as tshour,
case when a.timestamp > 0 then cast(substring(cast(a.timestamp as abap.char(19)),11,2) as abap.numc(2)) else '00' end as tsminute,
case when a.timestamp > 0 then cast(substring(cast(a.timestamp as abap.char(19)),13,2) as abap.numc(2)) else '00' end as tssecond
from acdoca as a
inner join finsc_cmp_versnc as v on a.rbukrs = v.bukrs --- select only the ledger which is assigned to version 000;
and a.rldnr = v.rldnr
and v.versn = '000'
inner join tj01 as t on t.vrgng = a.vrgng --- only actuals relevant for primary postings
and t.xcosp = ''
and t.xcoss = 'X'
--- redundant check: and t.wtkat = 'A'
inner join tka01 as tk on tk.mandt = a.rclnt --- check logical system for relevanz for totals
and tk.kokrs = a.kokrs
inner join t000 as s on s.mandt = a.rclnt
and ( s.logsys = a.logsyso
or a.logsyso = ''
or ( ( a.accasty = 'KS' or a.accasty = 'KL' )
and ( s.logsys = tk.logsystem or tk.logsystem = '' )
)
)
where ( a.co_buzei <> '000' and not a.accasty = '' ) or --- real actuals with CO document numbers ; ... where a.co_belnr <> '' is redundant
( a.mig_source = 'C' and a.bstat = 'C' ) --- real + statistical actuals from CO balances migration
;
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"ACDOCA",
"FINSC_CMP_VERSNC",
"T000",
"TJ01",
"TKA01"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
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