C_SourceOfSupply
Souce of Supply
C_SourceOfSupply is a Consumption CDS View that provides data about "Souce of Supply" in SAP S/4HANA. It reads from 2 data sources (P_PurchaseContractItemSOS, P_SourceOfSupply) and exposes 30 fields with key fields SourceDocument, SourceDocumentItem, PurchaseContract, PurchaseContractItem. It has 8 associations to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_PurchaseContractItemSOS | ContractMaintItem | inner |
| P_SourceOfSupply | SourceOfSupply | from |
Associations (8)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_PurContrCnsmpnInPercentage | Contract | SourceOfSupply.PurchasingSourceType = 'K' and SourceOfSupply.SourceDocument = Contract.PurchaseContract |
| [1..1] | I_Supplier | _Supplier | $projection.Supplier = _Supplier.Supplier |
| [1..1] | I_PurchasingOrganization | _PurchasingOrganization | $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization |
| [1..1] | I_PurchasingGroup | _PurchasingGroup | $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup |
| [1..1] | I_Plant | _Plant | $projection.Plant = _Plant.Plant |
| [1..1] | C_MM_MaterialValueHelp | _Material | $projection.Material = _Material.Material and $projection.Plant = _Material.Plant |
| [1..1] | I_PurchasingObjectCategory | _PurchasingDocumentCategory | $projection.PurchasingSourceType = _PurchasingDocumentCategory.PurchasingDocumentCategory |
| [0..*] | I_PurchasingDocumentTypeText | _PurchasingDocumentTypeText | $projection.PurchasingDocumentType = _PurchasingDocumentTypeText.PurchasingDocumentType and $projection.PurchasingSourceType = _PurchasingDocumentTypeText.PurchasingDocumentCategory |
Annotations (10)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | CMMSRCOFSUPPLY | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AccessControl.personalData.blocking | #BLOCKED_DATA_EXCLUDED | view | |
| EndUserText.label | Souce of Supply | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| VDM.viewType | #CONSUMPTION | view |
Fields (30)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | SourceDocument | P_SourceOfSupply | SourceDocument | Source Document |
| KEY | SourceDocumentItem | P_SourceOfSupply | SourceDocumentItem | Source Document Item |
| KEY | PurchaseContract | P_PurchaseContractItemSOS | PurchaseContract | Purchasing Doc. |
| KEY | PurchaseContractItem | P_PurchaseContractItemSOS | PurchaseContractItem | Item |
| Supplier | P_SourceOfSupply | Supplier | Supplier | |
| SupplierName | _Supplier | SupplierName | Supplier Name | |
| PurchasingOrganization | P_SourceOfSupply | PurchasingOrganization | Purchasing Organization | |
| PurchasingGroup | P_SourceOfSupply | PurchasingGroup | Purchasing Group | |
| PurchasingSourceType | P_SourceOfSupply | PurchasingSourceType | ||
| PurchasingDocumentCategoryName | ||||
| Material | P_SourceOfSupply | Material | Vehicle Model | |
| Plant | P_SourceOfSupply | Plant | Valuation Area | |
| PurchasingDocumentType | P_SourceOfSupply | PurchasingDocumentType | RFQ Type | |
| PurchasingDocumentTypeName | ||||
| ValidityEndDate | P_SourceOfSupply | ValidityEndDate | ValidTo | |
| ValidityStartDate | P_SourceOfSupply | ValidityStartDate | Validity Start Date | |
| CreationDate | P_SourceOfSupply | CreationDate | Time Stamp | |
| DocumentCurrency | P_SourceOfSupply | DocumentCurrency | Document Currency | |
| TargetAmount | P_SourceOfSupply | TargetAmount | Target Value | |
| ContractConsumptionInPct | ||||
| PurContrStatusCriticality | ||||
| PurchaseContractValidityStatus | Validity Status ID | |||
| PurContrValidityStatusName | ||||
| _Supplier | _Supplier | |||
| _PurchasingOrganization | _PurchasingOrganization | |||
| _PurchasingGroup | _PurchasingGroup | |||
| _Plant | _Plant | |||
| _Material | _Material | |||
| _PurchasingDocumentCategory | _PurchasingDocumentCategory | |||
| _PurchasingDocumentTypeText | _PurchasingDocumentTypeText |
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 C_SourceOfSupply.
-- 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: CMMSRCOFSUPPLY
CREATE VIEW C_SourceOfSupply AS
SELECT
SourceOfSupply.SourceDocument AS SourceDocument,
SourceOfSupply.SourceDocumentItem AS SourceDocumentItem,
ContractMaintItem.PurchaseContract AS PurchaseContract,
ContractMaintItem.PurchaseContractItem AS PurchaseContractItem,
SourceOfSupply.Supplier AS Supplier,
_Supplier.SupplierName AS SupplierName,
SourceOfSupply.PurchasingOrganization AS PurchasingOrganization,
SourceOfSupply.PurchasingGroup AS PurchasingGroup,
SourceOfSupply.PurchasingSourceType AS PurchasingSourceType,
cast(_PurchasingDocumentCategory._Text[1: Language = $session.system_language ].PurchasingDocumentCategoryName as purchasingdocumentcategoryname preserving type ) AS PurchasingDocumentCategoryName,
SourceOfSupply.Material AS Material,
SourceOfSupply.Plant AS Plant,
SourceOfSupply.PurchasingDocumentType AS PurchasingDocumentType,
_PurchasingDocumentTypeText[1: Language = $session.system_language].PurchasingDocumentTypeName AS PurchasingDocumentTypeName,
SourceOfSupply.ValidityEndDate AS ValidityEndDate,
SourceOfSupply.ValidityStartDate AS ValidityStartDate,
SourceOfSupply.CreationDate AS CreationDate,
SourceOfSupply.DocumentCurrency AS DocumentCurrency,
SourceOfSupply.TargetAmount AS TargetAmount,
cast( cast( Contract.ContractConsumptionInPct as abap.char( 34 ) ) as mm_contract_consumption_pct preserving type ) AS ContractConsumptionInPct,
cast (3 as mm_oa_validity_criticality preserving type) AS PurContrStatusCriticality,
cast( '02' as mm_contract_status_id ) AS PurchaseContractValidityStatus,
cast( 'Valid' as mm_oa_validity_status ) AS PurContrValidityStatusName
FROM P_SourceOfSupply AS SourceOfSupply
INNER JOIN P_PurchaseContractItemSOS AS ContractMaintItem ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PurContrCnsmpnInPercentage AS Contract ON SourceOfSupply.PurchasingSourceType = 'K' AND SourceOfSupply.SourceDocument = Contract.PurchaseContract -- association [1..1]
LEFT OUTER JOIN I_Supplier AS _Supplier ON Supplier = _Supplier.Supplier -- association [1..1]
LEFT OUTER JOIN I_PurchasingOrganization AS _PurchasingOrganization ON PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization -- association [1..1]
LEFT OUTER JOIN I_PurchasingGroup AS _PurchasingGroup ON PurchasingGroup = _PurchasingGroup.PurchasingGroup -- association [1..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [1..1]
LEFT OUTER JOIN C_MM_MaterialValueHelp AS _Material ON Material = _Material.Material AND Plant = _Material.Plant -- association [1..1]
LEFT OUTER JOIN I_PurchasingObjectCategory AS _PurchasingDocumentCategory ON PurchasingSourceType = _PurchasingDocumentCategory.PurchasingDocumentCategory -- association [1..1]
LEFT OUTER JOIN I_PurchasingDocumentTypeText AS _PurchasingDocumentTypeText ON PurchasingDocumentType = _PurchasingDocumentTypeText.PurchasingDocumentType AND PurchasingSourceType = _PurchasingDocumentTypeText.PurchasingDocumentCategory -- association [0..*]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA