P_SalesDocumentsForProjects

DDL: P_SALESDOCUMENTSFORPROJECTS Type: view COMPOSITE

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)

SourceAliasJoin Type
I_SalesDocumentItem A from
I_WBSElementBasicData B inner

Annotations (13)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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 */
;