v_coss_wdv_1_view
COSS with delta versions (parallel valuation/COGM) - part 1
v_coss_wdv_1_view is a CDS View that provides data about "COSS with delta versions (parallel valuation/COGM) - part 1" in SAP S/4HANA. It reads from 4 data sources (t000, tj01, tka01, finsc_cmp_versnd).
Data Sources (4)
| Source | Alias | Join Type |
|---|---|---|
| t000 | s | inner |
| tj01 | t | inner |
| tka01 | tk | inner |
| finsc_cmp_versnd | v | inner |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | V_COSS_WDV_1 | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.serviceQuality | #P | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| EndUserText.label | COSS with delta versions (parallel valuation/COGM) - part 1 | view |
@AbapCatalog.sqlViewName: 'V_COSS_WDV_1'
//@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.serviceQuality: #P
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'COSS with delta versions (parallel valuation/COGM) - part 1'
define view v_coss_wdv_1_view as
select
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,
case when v.field_name_buzei = 'CO_BUZEI' then a.co_buzei
when v.field_name_buzei = 'CO_BUZEI1' then a.co_buzei1
when v.field_name_buzei = 'CO_BUZEI2' then a.co_buzei2
when v.field_name_buzei = 'CO_BUZEI5' then a.co_buzei5
when v.field_name_buzei = 'CO_BUZEI6' then a.co_buzei6
when v.field_name_buzei = 'CO_BUZEI7' then a.co_buzei7
else a.co_buzei
end as buzei,
a.rldnr as rldnr,
a.poper as perio,
-- a.rvunit as meinh,
a.co_meinh as meinh,
-- value fields
case field_name_wtgbtr_add
when 'WSL' then wsl
when 'WSL2' then wsl2
when 'WSL3' then wsl3
else 0
end as wtgbtr_add,
case field_name_wtgbtr_subtract
when 'WSL' then wsl
when 'WSL2' then wsl2
when 'WSL3' then wsl3
else 0
end as wtgbtr_subtract,
case
when v.set_to_zero = 'X' then 0
// when ( tk.xwbuk = '' ) and ( ( bstat = 'C' and co_osl <> 0 )
// or ( bstat <> 'C' and rco_ocur <> '' ) )
// then co_osl
when field_name_wogbtr_add = 'CO_OSL' then co_osl
when field_name_wogbtr_add = 'HSL' then hsl
when field_name_wogbtr_add = 'OSL' then osl
when field_name_wogbtr_add = 'VSL' then vsl
when field_name_wogbtr_add = 'BSL' then bsl
when field_name_wogbtr_add = 'CSL' then csl
when field_name_wogbtr_add = 'DSL' then dsl
when field_name_wogbtr_add = 'ESL' then esl
when field_name_wogbtr_add = 'FSL' then fsl
when field_name_wogbtr_add = 'GSL' then gsl
when field_name_wogbtr_add = 'KSL' then ksl
else 0
end as wogbtr_add, --- 1. CO_OSL; 2. HSL
case field_name_wogbtr_subtract -- if parallel valuation or COGM is active => HSL is but CO_OSL is not relevant
when 'HSL' then hsl
when 'OSL' then osl
when 'CO_OSL' then co_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
when 'KSL' then ksl
else 0
end as WOGBTR_SUBTRACT,
case field_name_wkgbtr_add
when 'KSL' then ksl
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
when 'HSL' then hsl
else 0
end as WKGBTR_ADD,
case field_name_wkgbtr_subtract
when 'KSL' then ksl
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
when 'HSL' then hsl
else 0
end as WKGBTR_SUBTRACT,
case field_name_wkfbtr_add
when 'KFSL' then kfsl
when 'KFSL2' then kfsl2
when 'KFSL3' then kfsl3
else 0
end as WKFBTR_ADD,
case field_name_wkfbtr_subtract
when 'KFSL' then kfsl
when 'KFSL2' then kfsl2
when 'KFSL3' then kfsl3
else 0
end as WKFBTR_SUBTRACT,
case field_name_pagbtr_add
when 'PSL' then psl
when 'PSL2' then psl2
when 'PSL3' then psl3
else 0
end as PAGBTR_ADD,
case field_name_pagbtr_subtract
when 'PSL' then psl
when 'PSL2' then psl2
when 'PSL3' then psl3
else 0
end as PAGBTR_SUBTRACT,
case field_name_pafbtr_add
when 'PFSL' then pfsl
when 'PFSL2' then pfsl2
when 'PFSL3' then pfsl3
else 0
end as PAFBTR_ADD,
case field_name_pafbtr_subtract
when 'PFSL' then pfsl
when 'PFSL2' then pfsl2
when 'PFSL3' then pfsl3
else 0
end as PAFBTR_SUBTRACT,
case
when v.versn <> '000' or v.set_to_zero = 'X' then 0
else co_megbtr -- vmsl
end as MEGBTR,
case
when v.versn <> '000' or v.set_to_zero = 'X' then 0
else co_mefbtr -- vmfsl
end as MEFBTR,
case
when v.versn <> '000' or v.set_to_zero = 'X' then 0
else msl
end as MBGBTR,
case
when v.versn <> '000' or v.set_to_zero = 'X' then 0
else mfsl
end as MBFBTR,
cast(a.muvflg as abap.int1) as muvflg,
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,
a.mig_source as mig_source,
a.bstat as bstat,
-----------------------------------------
timestamp --- calculation on higher level
from acdoca as a
inner join finsc_cmp_versnd as v on v.mandt = a.rclnt
and v.bukrs = a.rbukrs
and v.rldnr = a.rldnr
// inner join v_co_versn2rdlnr as v on v.mandt = a.rclnt
// and v.bukrs = a.rbukrs
// and v.rldnr = a.rldnr
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 --- actuals with CO document numbers ; ... where a.co_belnr <> '' is redundant
( a.mig_source = 'C' and a.bstat = 'C' ) --- actuals + statisticals from CO balances migration
) and
a.objnr <> '' --- in case CO has been archive OBJNR is initial!
;
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"ACDOCA",
"FINSC_CMP_VERSND",
"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