Material stock accounting document for china turnover report
I_CN_MaterialStockAcctgDoc is a Basic CDS View that provides data about "Material stock accounting document for china turnover report" in SAP S/4HANA. It reads from 2 data sources (acdoca, fmlt_curtp_ml) and exposes 19 fields with key fields AccountingDocument, FiscalYear, GLAccountLineItem, Ledger, CompanyCode. Part of development package APPL_GLO_LOG_ODATA_CN.
@EndUserText.label: 'Material stock accounting document for china turnover report'
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API@AbapCatalog.sqlViewName: 'ICNMATSTKACCTDOC'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@ClientHandling.algorithm: #SESSION_VARIABLE@AccessControl.authorizationCheck: #CHECK@VDM.private: false@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED@VDM.viewType:#BASIC@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XXL,
dataClass: #MIXED
}defineview I_CN_MaterialStockAcctgDoc
asselectfrom
acdoca as accdoc
innerjoin fmlt_curtp_ml as MAPP on MAPP.rbukrs = accdoc.rbukrs and is_logistic_curtype = 'X' and accdoc.rldnr = MAPP.rldnr
//bseg as _bseg
// innerjoin bkpf on bkpf.bukrs = bseg.bukrs and bkpf.belnr = bseg.belnr and bkpf.gjahr = bseg.gjahr
//asselectfrom I_AccountingDocument as _bkpf // on _bkpf.CompanyCode = bseg.bukrs
// and _bkpf.AccountingDocument = bseg.belnr
// and _bkpf.FiscalYear = bseg.gjahr
// association [0..1] to I_AccountingDocument as _bkpf on $projection.AccountingDocument = _bkpf.AccountingDocument and $projection.FiscalYear= _bkpf.FiscalYear
{
key belnr as AccountingDocument,//Document Number
key gjahr as FiscalYear, //Fiscal Year,
key docln as GLAccountLineItem,//Item of a GL account
key accdoc.rldnr as Ledger,
key accdoc.rbukrs as CompanyCode,
buzei as AccountingDocumentItem,//Number of Line Item Within Accounting Document
@Semantics.currencyCode: true
rhcur as CompanyCodeCurrency, //Currency
matnr as StockIdentifyingMaterial,//material
bwkey as Plant,//Valuation Area
bwtar as InventoryValuationType,//Valuation Type
sobkz as InventorySpecialStockType,//Stock Type of Goods Movement (Stock Identifier)
drcrk as DebitCreditCode,//Debit/Credit
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
hsl as GoodsMovementStkAmtInCCCrcy,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@EndUserText.label: 'Total goods Received Value'
@UI.hidden: true
(casewhen hsl > 0 then hsl else 0 end) as MatlStkIncrQtyAmountInCCCrcy,//good receipt value
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@EndUserText.label: 'Total goods Issued Value'
@UI.hidden: true
(casewhen hsl < 0 then hsl else 0 end ) as MatlStkDecrQtyAmountInCCCrcy, // goods issue value
// _bseg.dmbtr as GoodsMovementStkAmtInCCCrcy,//Amount in Companycode Currency
// @Semantics.unitOfMeasure: true//、 rvunit as BaseUnitofMeasure,//Base Unit
// @Semantics.quantity.unitOfMeasure: 'BaseUnitofMeasure'
// menge as QuantityInBaseUnit,//Quantity
budat as PostingDate,//Posting Date
bldat as DocumentDate,//Document Date
blart as AccountingDocumentType,//Document Type
awtyp as ReferenceDocumentType //Reference Transaction
}
where bstat <> 'D'
and bstat <> 'M'
and awtyp <> 'GLYEC'
and koart = 'M'
and matnr <> ''
and ktosl = 'BSX'
and awtyp <> 'MKPF'
and poper <> '000'
and bstat <> 'C'
// and squan = '0'
// and h_budat >= :p_begin_date