P_DMVCGLAccLineItemMaterial

DDL: P_DMVCGLACCLINEITEMMATERIAL SQL: PDMVCGLACCMATL Type: view COMPOSITE Package: ODATA_ML_MATLVCA_DISP

DMVC: GL Account Line Item & Material

P_DMVCGLAccLineItemMaterial is a Composite CDS View that provides data about "DMVC: GL Account Line Item & Material" in SAP S/4HANA. It has 2 associations to related views. Part of development package ODATA_ML_MATLVCA_DISP.

Parameters (4)

NameTypeDefault
P_DateFrom calendardate
P_DateTo calendardate
P_CurrencyType curtp
P_Ledger rldnr

Associations (2)

CardinalityTargetAliasCondition
[0..1] P_MLProcessCategory _ProcessCategory _MaterialLedgerDocument.ProcessCategory = _ProcessCategory.ProcessCategory
[0..1] P_MLMaterialHeader _MLMaterialHeader $projection.CostEstimate = _MLMaterialHeader.CostEstimate

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PDMVCGLACCMATL view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (14)

KeyFieldSource TableSource FieldDescription
KEY ProductionProcessendasProcess
KEY ProcessCategory _MaterialLedgerDocument ProcessCategory
CostEstimate _MaterialLedgerDocument CostEstimate Cost EstimateNo
Material _MLMaterialHeader Material Vehicle Model
PlantelseendasPlant
CompanyCodeelseendasCompanyCode
ValuationArea _MLMaterialHeader ValuationArea Valuation Area
ReferenceDocument _acdoca awref Reference Doc.
Ledger _acdoca rldnr Ledger (Compat.)
SourceCompanyCode _acdoca rbukrs Company Code
FiscalYear _acdoca gjahr Settlement Year
AccountingDocument _acdoca belnr SD Document
LedgerGLLineItem _acdoca docln Matching Document Line Item
Timestamp _acdoca timestamp UTC Time Stamp in Short Form (YYYYMMDDhhmmss)

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_DMVCGLAccLineItemMaterial.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PDMVCGLACCMATL
-- Parameters: P_DateFrom : calendardate, P_DateTo : calendardate, P_CurrencyType : curtp, P_Ledger : rldnr

CREATE VIEW P_DMVCGLAccLineItemMaterial AS
SELECT
  case when _ConsumptionAlternative.CostEstimate is not initial and (_ProcessCategory.flg_mstuf is null or _ProcessCategory.flg_mstuf is initial) then _ConsumptionAlternative.CostEstimate else _MaterialLedgerDocument.ProductionProcess end as Process AS ProductionProcessendasProcess,
  _MaterialLedgerDocument.ProcessCategory AS ProcessCategory,
  _MaterialLedgerDocument.CostEstimate AS CostEstimate,
  _MLMaterialHeader.Material AS Material,
  case when _ProcurementAlternative.ProcurementAlternative is not null then _ProcurementAlternative.Plant when _ProcurementAlternative.ProcurementProcess is not null and (_ProcurementAlternative.ProcessCategory = 'VF' or _ProcurementAlternative.ProcessCategory = 'BF') and _ProcurementAlternative.ProductionPlant is not null and _ProcurementAlternative.ProductionPlant is not initial then _ProcurementAlternative.ProductionPlant when _ProcurementAlternative.ProcurementProcess is not null and (_ProcurementAlternative.ProcessCategory = 'VF' or _ProcurementAlternative.ProcessCategory = 'BF') and _ProcurementAlternative.Plant is not null and _ProcurementAlternative.Plant is not initial then _ProcurementAlternative.Plant when _ProcurementAlternative.ProcurementProcess is not null and (_ProcurementAlternative.ProcessCategory = 'VBK' or _ProcurementAlternative.ProcessCategory = 'BBK') and _ProcurementAlternative.Plant is not null and _ProcurementAlternative.Plant is not initial then _ProcurementAlternative.Plant when _ConsumptionAlternative.CostEstimate is not initial and (_ProcessCategory.flg_mstuf is null or _ProcessCategory.flg_mstuf is initial) then _ConsumptionAlternative.Plant when _ProcurementAlternative.ProcurementProcess is not null and _ProcurementAlternative.ProcurementProcess is not initial then _ProcurementAlternative.Plant else '' end as Plant AS PlantelseendasPlant,
  case when _t001k_001.CompanyCode is not null then _t001k_001.CompanyCode when _t001k_005.CompanyCode is not null then _t001k_005.CompanyCode else ' ' end as CompanyCode AS CompanyCodeelseendasCompanyCode,
  _MLMaterialHeader.ValuationArea AS ValuationArea,
  _acdoca.awref AS ReferenceDocument,
  _acdoca.rldnr AS Ledger,
  _acdoca.rbukrs AS SourceCompanyCode,
  _acdoca.gjahr AS FiscalYear,
  _acdoca.belnr AS AccountingDocument,
  _acdoca.docln AS LedgerGLLineItem,
  _acdoca.timestamp AS Timestamp
LEFT OUTER JOIN P_MLProcessCategory AS _ProcessCategory ON _MaterialLedgerDocument.ProcessCategory = _ProcessCategory.ProcessCategory  -- association [0..1]
LEFT OUTER JOIN P_MLMaterialHeader AS _MLMaterialHeader ON CostEstimate = _MLMaterialHeader.CostEstimate  -- association [0..1]
;