P_SalesDocumentsForProjects
P_SalesDocumentsForProjects is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_SalesDocumentItem, I_WBSElementBasicData) and exposes 18 fields.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_SalesDocumentItem | A | from |
| I_WBSElementBasicData | B | inner |
Annotations (13)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PSDSALESFORPROJ | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #B | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| VDM.private | true | view | |
| VDM.lifecycle.contract.type | #NONE | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (18)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| ReferenceSDDocumentelseendasSalesOrder | ||||
| SalesDocumentelseendasDebitMemoRequest | ||||
| NetAmountelse0endasSalesOrderNetAmount | ||||
| TransactionCurrencyendasProjectCurrency | ||||
| CurrentDate | ||||
| FiscalPeriod | I_SalesDocumentItem | FiscalPeriod | Tax period | |
| FiscalYear | I_SalesDocumentItem | FiscalYear | G/L Fiscal Year | |
| Material | I_SalesDocumentItem | Product | Product Sold | |
| BillingPlan | I_SalesDocumentItem | BillingPlan | Bill. Plan No. | |
| SalesDocumentItemCategory | I_SalesDocumentItem | SalesDocumentItemCategory | Item Category | |
| SDDocumentCategory | I_SalesDocumentItem | SDDocumentCategory | Document Cat. | |
| ReferenceSDDocumentCategory | I_SalesDocumentItem | ReferenceSDDocumentCategory | Prec.Doc.Categ. | |
| SDDocumentRejectionStatus | I_SalesDocumentItem | SDDocumentRejectionStatus | Rejection Sts | |
| OrderRelatedBillingStatus | I_SalesDocumentItem | OrderRelatedBillingStatus | ||
| BillingDocumentDate | I_SalesDocumentItem | BillingDocumentDate | Billing Date | |
| Project | ||||
| ProjectProfileCode | ||||
| WBSElement | I_WBSElementBasicData | WBSElement | WBS Internal ID |
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_SalesDocumentsForProjects.
-- 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.
CREATE VIEW P_SalesDocumentsForProjects AS
SELECT
case when A.SDDocumentCategory = 'C' then A.SalesDocument when A.ReferenceSDDocumentCategory = 'C' then A.ReferenceSDDocument else '' end as SalesOrder AS ReferenceSDDocumentelseendasSalesOrder,
case when A.SDDocumentCategory = 'L' and A.ReferenceSDDocumentCategory = 'C' then A.SalesDocument else '' end as DebitMemoRequest AS SalesDocumentelseendasDebitMemoRequest,
case when A.SDDocumentCategory = 'C' then A.NetAmount else 0 end as SalesOrderNetAmount AS NetAmountelse0endasSalesOrderNetAmount,
case when A.TransactionCurrency = '' then B._Project.ProjectCurrency else A.TransactionCurrency end as ProjectCurrency AS TransactionCurrencyendasProjectCurrency,
$session.system_date AS CurrentDate,
A.FiscalPeriod AS FiscalPeriod,
A.FiscalYear AS FiscalYear,
A.Product AS Material,
A.BillingPlan AS BillingPlan,
A.SalesDocumentItemCategory AS SalesDocumentItemCategory,
A.SDDocumentCategory AS SDDocumentCategory,
A.ReferenceSDDocumentCategory AS ReferenceSDDocumentCategory,
A.SDDocumentRejectionStatus AS SDDocumentRejectionStatus,
A.OrderRelatedBillingStatus AS OrderRelatedBillingStatus,
A.BillingDocumentDate AS BillingDocumentDate,
B._Project.Project AS Project,
B._Project.ProjectProfileCode AS ProjectProfileCode,
B.WBSElement AS WBSElement
FROM I_SalesDocumentItem AS A
INNER JOIN I_WBSElementBasicData AS B ON /* join condition not captured in parsed metadata */
;
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