P_DocToWorkitem

DDL: P_DOCTOWORKITEM SQL: PDOCWFITM Type: view COMPOSITE

P_DocToWorkitem is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_DocWithWorkflowStatus) and exposes 36 fields with key fields CompanyCode, AccountingDocument, FiscalYear, Workflow, WorkItem. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_DocWithWorkflowStatus _doc from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_WorkflowDecisionStatus _WorkflowDecisionStatus $projection.Workflow = _WorkflowDecisionStatus.Workflow and _WorkflowDecisionStatus.AccountingDocumentStatus <> 'N'

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PDOCWFITM view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.representativeKey Workflow view
VDM.private true view
VDM.viewType #COMPOSITE view
AbapCatalog.dbHints.hint USE_HEX_PLAN view

Fields (36)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_DocWithWorkflowStatus CompanyCode Receiver Company Code
KEY AccountingDocument I_DocWithWorkflowStatus AccountingDocument Journal Entry
KEY FiscalYear I_DocWithWorkflowStatus FiscalYear G/L Fiscal Year
KEY Workflow _latestWorkflow Workflow Workflow Template
KEY WorkItem _latestTask WorkItem Work Item ID
AccountingDocumentType I_DocWithWorkflowStatus AccountingDocumentType Journal Entry Type
ReferenceDocument I_DocWithWorkflowStatus ReferenceDocument Reference Document
DocumentDate I_DocWithWorkflowStatus DocumentDate Journal Entry Date
FiscalPeriod I_DocWithWorkflowStatus FiscalPeriod Tax period
LastChangeDate I_DocWithWorkflowStatus LastChangeDate Time Stamp
LedgerGroup I_DocWithWorkflowStatus LedgerGroup Ledger Group
HeaderDescription I_DocWithWorkflowStatus HeaderDescription Header Text
PostingDate I_DocWithWorkflowStatus PostingDate Posting Date for GR
CreatedByUser I_DocWithWorkflowStatus CreatedByUser User Name
CreationDateTime I_DocWithWorkflowStatus CreationDateTime Timestamp
AccountingDocumentCreationDate I_DocWithWorkflowStatus AccountingDocumentCreationDate Journal Entry Date
ObjectKey I_DocWithWorkflowStatus ObjectKey Object Key
TransactionCode I_DocWithWorkflowStatus TransactionCode Transaction Code
ParkingTransactionCode I_DocWithWorkflowStatus ParkingTransactionCode Parked with
Currency I_DocWithWorkflowStatus Currency Valuation Crcy
CompanyCodeCurrency I_DocWithWorkflowStatus CompanyCodeCurrency Local Currency
GlobalCurrency I_DocWithWorkflowStatus GlobalCurrency GM Billing Element: Global Currency
FreeDefinedCurrency1 I_DocWithWorkflowStatus FreeDefinedCurrency1 Freely Defined Currency 1
AccountingDocumentCategory I_DocWithWorkflowStatus AccountingDocumentCategory Journal Entry Category
ParkedByUser I_DocWithWorkflowStatus ParkedByUser JE Parked By
Batch I_DocWithWorkflowStatus Batch Lot No.
IntercompanyTransaction I_DocWithWorkflowStatus IntercompanyTransaction Intercompany Transaction
ReversalReason I_DocWithWorkflowStatus ReversalReason Reversal Reason
PlannedReversalDate I_DocWithWorkflowStatus PlannedReversalDate Reversal Date
ReleaseDateTime _latestWorkflow ReleaseDateTime Composition Released On
WorkflowTaskType _latestTask WorkflowTaskType
WorkflowTaskPriority _latestTask WorkflowTaskPriority
WorkflowTaskStatus _latestTask TaskProcessingStatus
JournalEntryWorkflowStatus _latestWorkflow JournalEntryWorkflowStatus
WorkflowTaskDefinition _latestTask WorkflowTaskDefinition
AccountingDocumentStatus _WorkflowDecisionStatus AccountingDocumentStatus

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_DocToWorkitem.
-- 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: PDOCWFITM

CREATE VIEW P_DocToWorkitem AS
SELECT
  _doc.CompanyCode AS CompanyCode,
  _doc.AccountingDocument AS AccountingDocument,
  _doc.FiscalYear AS FiscalYear,
  _latestWorkflow.Workflow AS Workflow,
  _latestTask.WorkItem AS WorkItem,
  _doc.AccountingDocumentType AS AccountingDocumentType,
  _doc.ReferenceDocument AS ReferenceDocument,
  _doc.DocumentDate AS DocumentDate,
  _doc.FiscalPeriod AS FiscalPeriod,
  _doc.LastChangeDate AS LastChangeDate,
  _doc.LedgerGroup AS LedgerGroup,
  _doc.HeaderDescription AS HeaderDescription,
  _doc.PostingDate AS PostingDate,
  _doc.CreatedByUser AS CreatedByUser,
  _doc.CreationDateTime AS CreationDateTime,
  _doc.AccountingDocumentCreationDate AS AccountingDocumentCreationDate,
  _doc.ObjectKey AS ObjectKey,
  _doc.TransactionCode AS TransactionCode,
  _doc.ParkingTransactionCode AS ParkingTransactionCode,
  _doc.Currency AS Currency,
  _doc.CompanyCodeCurrency AS CompanyCodeCurrency,
  _doc.GlobalCurrency AS GlobalCurrency,
  _doc.FreeDefinedCurrency1 AS FreeDefinedCurrency1,
  _doc.AccountingDocumentCategory AS AccountingDocumentCategory,
  _doc.ParkedByUser AS ParkedByUser,
  _doc.Batch AS Batch,
  _doc.IntercompanyTransaction AS IntercompanyTransaction,
  _doc.ReversalReason AS ReversalReason,
  _doc.PlannedReversalDate AS PlannedReversalDate,
  _latestWorkflow.ReleaseDateTime AS ReleaseDateTime,
  _latestTask.WorkflowTaskType AS WorkflowTaskType,
  _latestTask.WorkflowTaskPriority AS WorkflowTaskPriority,
  _latestTask.TaskProcessingStatus AS WorkflowTaskStatus,
  _latestWorkflow.JournalEntryWorkflowStatus AS JournalEntryWorkflowStatus,
  _latestTask.WorkflowTaskDefinition AS WorkflowTaskDefinition,
  _WorkflowDecisionStatus.AccountingDocumentStatus AS AccountingDocumentStatus
FROM I_DocWithWorkflowStatus AS _doc
LEFT OUTER JOIN I_WorkflowDecisionStatus AS _WorkflowDecisionStatus ON Workflow = _WorkflowDecisionStatus.Workflow AND _WorkflowDecisionStatus.AccountingDocumentStatus <> 'N'  -- association [0..1]
;