I_DistrAccountingData
Distribution cost data
I_DistrAccountingData is a Composite CDS View that provides data about "Distribution cost data" in SAP S/4HANA. It reads from 3 data sources (acdoca, tka01, finsc_cmp_versnc) and exposes 36 fields with key fields Ledger, CompanyCode, FiscalYear, AccountingDocument, GLAccountLineItem.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| acdoca | a | from |
| tka01 | t | inner |
| finsc_cmp_versnc | v | inner |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Distribution cost data | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (36)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Ledger | acdoca | rldnr | |
| KEY | CompanyCode | acdoca | rbukrs | |
| KEY | FiscalYear | acdoca | gjahr | |
| KEY | AccountingDocument | acdoca | belnr | |
| KEY | GLAccountLineItem | acdoca | docln | |
| CostElement | acdoca | racct | ||
| ControllingArea | acdoca | kokrs | ||
| FiscalYearPostingPeriod | acdoca | poper | ||
| ControllingBusTransacType | acdoca | vrgng | ||
| OrderID | acdoca | aufnr | ||
| wsl3endasAmountInTransactionCurrency | ||||
| TransactionCurrency | acdoca | rwcur | ||
| kslendasAmountInCtrlgObjectCurrency | ||||
| rco_ocurendasControllingObjectCurrency | ||||
| hslendasAmountInCtrlgAreaCrcy | ||||
| ControllingAreaCurrency | tka01 | waers | ||
| DistrdTotalMaterialQuantity | acdoca | vmsl | ||
| DistrdTotalMaterialQtyUnit | acdoca | rvunit | ||
| PurchasingDocument | acdoca | ebeln | ||
| PurchasingDocumentItem | acdoca | ebelp | ||
| Material | acdoca | matnr | ||
| Plant | acdoca | werks | ||
| ControllingObject | acdoca | objnr | ||
| ControllingKeySubNumber | acdoca | hrkft | ||
| PartnerControllingObject | acdoca | parob1 | ||
| PartnerCompanyCode | acdoca | pbukrs | ||
| OriginSenderObject | acdoca | uspob | ||
| OriginCostCtrActivityType | acdoca | ulstar | ||
| ControllingDebitCreditCode | ||||
| ControllingObjectType | acdoca | accasty | ||
| ControllingDocument | acdoca | co_belnr | ||
| ControllingDocumentItem | acdoca | co_buzei | ||
| WBSElementInternalID | ||||
| DistributionPostingDate | acdoca | budat | ||
| ChartOfAccounts | acdoca | ktopl | ||
| LastChangeDateTime | acdoca | timestamp |
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Distribution cost data'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM.viewType: #COMPOSITE
define view entity I_DistrAccountingData
as select from acdoca as a
inner join finsc_cmp_versnc as v on a.rbukrs = v.bukrs //TODO - V_COEP( in V_Coep_Acdoca_R1_view) reads from finsc_cmp_versnd instead of this one
and a.rldnr = v.rldnr
and v.versn = '000'
inner join tka01 as t on t.kokrs = a.kokrs
{
key a.rldnr as Ledger,
key a.rbukrs as CompanyCode,
key a.gjahr as FiscalYear,
key a.belnr as AccountingDocument,
key a.docln as GLAccountLineItem,
a.racct as CostElement,
a.kokrs as ControllingArea,
a.poper as FiscalYearPostingPeriod,
a.vrgng as ControllingBusTransacType,
a.aufnr as OrderID,
@Semantics.amount.currencyCode: 'TransactionCurrency'
case v.wtgbtr
when 'WSL' then a.wsl
when 'WSL2' then a.wsl2
when 'WSL3' then a.wsl3
end as AmountInTransactionCurrency,
a.rwcur as TransactionCurrency,
@Semantics.amount.currencyCode: 'ControllingObjectCurrency'
case v.wogbtr
when 'CO_OSL' then a.co_osl
when 'HSL' then a.hsl
when 'OSL' then a.osl
when 'VSL' then a.vsl
when 'BSL' then a.bsl
when 'CSL' then a.csl
when 'DSL' then a.dsl
when 'ESL' then a.esl
when 'FSL' then a.fsl
when 'GSL' then a.gsl
when 'KSL' then a.ksl
end as AmountInCtrlgObjectCurrency,
case
when ( a.rco_ocur is null or a.rco_ocur = '' or t.xwbuk = 'X' ) then a.rhcur
else a.rco_ocur
end as ControllingObjectCurrency,
@Semantics.amount.currencyCode: 'ControllingAreaCurrency'
case v.wkgbtr
when 'KSL' then a.ksl
when 'OSL' then a.osl
when 'VSL' then a.vsl
when 'BSL' then a.bsl
when 'CSL' then a.csl
when 'DSL' then a.dsl
when 'ESL' then a.esl
when 'FSL' then a.fsl
when 'GSL' then a.gsl
when 'HSL' then a.hsl
end as AmountInCtrlgAreaCrcy,
t.waers as ControllingAreaCurrency,
@Semantics.quantity.unitOfMeasure: 'DistrdTotalMaterialQtyUnit'
a.vmsl as DistrdTotalMaterialQuantity,
a.rvunit as DistrdTotalMaterialQtyUnit, //Unit of Measure for Valuation Quantity
a.ebeln as PurchasingDocument,
a.ebelp as PurchasingDocumentItem,
a.matnr as Material,
a.werks as Plant,
a.objnr as ControllingObject,
a.hrkft as ControllingKeySubNumber,
a.parob1 as PartnerControllingObject,
a.pbukrs as PartnerCompanyCode,
a.uspob as OriginSenderObject,
a.ulstar as OriginCostCtrActivityType,
cast(a.co_beknz as co_belkz preserving type) as ControllingDebitCreditCode,
a.accasty as ControllingObjectType,
a.co_belnr as ControllingDocument,
a.co_buzei as ControllingDocumentItem,
cast ( a.ps_psp_pnr as ps_s4_pspnr preserving type ) as WBSElementInternalID,
a.budat as DistributionPostingDate,
a.ktopl as ChartOfAccounts,
@Semantics.systemDateTime.lastChangedAt: true
a.timestamp as LastChangeDateTime
}
where
a.co_belnr <> ''
and a.co_buzei <> '000'
and a.accasty <> ''
and(
a.vrgng = 'GPDP' //Primary Cost
or a.vrgng = 'GPDS' //Secondary Cost
)
and a.co_beknz = 'H' //Credit
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"ACDOCA",
"FINSC_CMP_VERSNC",
"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