P_SrvcDocRevenueFor2Years
Service Document Revenue for Last year and Current year
P_SrvcDocRevenueFor2Years is a Composite CDS View that provides data about "Service Document Revenue for Last year and Current year" in SAP S/4HANA. It reads from 1 data source (P_ServiceDocLinItmFinConvData) and exposes 78 fields with key fields Ledger, SourceLedger, CompanyCode, FiscalYear, AccountingDocument. It has 2 associations to related views. Part of development package CRMS4_ANALYTICS_COMMON.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_ServiceDocLinItmFinConvData | P_ServiceDocLinItmFinConvData | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | vdm_v_display_currency |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_CalendarYear | _PostingDate | $projection.PostingDate = _PostingDate.CalendarDate |
| [0..1] | P_CalendarYear | _CurrentDate | _CurrentDate.CalendarDate = $session.system_date |
Annotations (5)
| Name | Value | Level | Field |
|---|---|---|---|
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (78)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Ledger | Ledger | Ledger | |
| KEY | SourceLedger | SourceLedger | Source Ledger | |
| KEY | CompanyCode | CompanyCode | Receiver Company Code | |
| KEY | FiscalYear | FiscalYear | G/L Fiscal Year | |
| KEY | AccountingDocument | AccountingDocument | Journal Entry | |
| KEY | LedgerGLLineItem | LedgerGLLineItem | Journal Entry Item | |
| KEY | GLAccountHierarchy | GLAccountHierarchy | ||
| KEY | SemanticTag | SemanticTag | Semantic Tag | |
| KEY | ValidityStartDate | ValidityStartDate | Validity Start Date | |
| KEY | ValidityEndDate | ValidityEndDate | ValidTo | |
| KEY | ServiceContract | ServiceContract | Transaction ID | |
| KEY | ServiceContractItem | ServiceContractItem | Item Number in Doc. | |
| KEY | ServiceDocument | ServiceDocument | Transaction ID | |
| KEY | ServiceDocumentItem | ServiceDocumentItem | Service Document | |
| ServiceDocumentType | ServiceDocumentType | Transaction Type | ||
| ServiceContractType | ServiceContractType | |||
| CompanyCodeCurrency | CompanyCodeCurrency | Local Currency | ||
| DisplayCurrency | DisplayCurrency | Display Currency | ||
| RevenueAmountInDisplayCrcy | RevenueAmountInDisplayCrcy | |||
| ServiceDocumentItemNetAmount | ServiceDocumentItemNetAmount | |||
| CostAmountInDisplayCurrency | CostAmountInDisplayCurrency | |||
| YTDSrvcContrRevnAmtInDC | YTDSrvcContrRevnAmtInDC | |||
| YTDSrvcContrCostInDC | YTDSrvcContrCostInDC | |||
| YTDSrvcContrPrftMarginAmtInDC | YTDSrvcContrPrftMarginAmtInDC | |||
| Product | Product | Product Sold | ||
| ProductGroup | ProductGroup | Product Sold Group | ||
| CreationDate | CreationDate | Time Stamp | ||
| PostingDate | PostingDate | Posting Date for GR | ||
| DocumentDate | DocumentDate | Journal Entry Date | ||
| CalendarYear | _PostingDate | CalendarYear | Year | |
| CalendarQuarter | _PostingDate | CalendarQuarter | Calendar Quarter | |
| FiscalYearVariant | FiscalYearVariant | FY Variant | ||
| FiscalPeriod | FiscalPeriod | Tax period | ||
| FiscalQuarter | FiscalQuarter | |||
| ServiceObjectType | ServiceObjectType | Object Type | ||
| ServiceDocumentDescription | ServiceDocumentDescription | |||
| SalesOrganization | SalesOrganization | Sales Organization | ||
| DistributionChannel | DistributionChannel | RefDistCh-Cust/Mat. | ||
| Division | Division | Internal Division ID | ||
| SalesOffice | SalesOffice | Sales Office | ||
| SalesGroup | SalesGroup | Sales Group | ||
| SalesOrganizationOrgUnitID | SalesOrganizationOrgUnitID | |||
| SalesOfficeOrgUnitID | SalesOfficeOrgUnitID | |||
| SalesGroupOrgUnitID | SalesGroupOrgUnitID | |||
| ServiceOrganization | ServiceOrganization | |||
| ResponsibleEmployee | ResponsibleEmployee | Employee Resp. | ||
| _Ledger | _Ledger | |||
| _SourceLedger | _SourceLedger | |||
| _CompanyCode | _CompanyCode | |||
| _FiscalYear | _FiscalYear | |||
| _JournalEntry | _JournalEntry | |||
| _Hierarchy | _Hierarchy | |||
| _SemanticTag | _SemanticTag | |||
| _CompanyCodeCurrency | _CompanyCodeCurrency | |||
| _CalendarYear | _PostingDate | _CalendarYear | ||
| _CalendarQuarter | _PostingDate | _CalendarQuarter | ||
| _FiscalYearVariant | _FiscalYearVariant | |||
| _SoldProduct | _SoldProduct | |||
| _SoldProductGroup | _SoldProductGroup | |||
| _ServiceContract | _ServiceContract | |||
| _ServiceContractItem | _ServiceContractItem | |||
| _ServiceContractType | _ServiceContractType | |||
| _ServiceDocument | _ServiceDocument | |||
| _ServiceDocumentItem | _ServiceDocumentItem | |||
| _ServiceDocumentType | _ServiceDocumentType | |||
| _ServiceObjType | _ServiceObjType | |||
| _SalesOrganization | _SalesOrganization | |||
| _DistributionChannel | _DistributionChannel | |||
| _Division | _Division | |||
| _SalesOffice | _SalesOffice | |||
| _SalesGroup | _SalesGroup | |||
| _SalesOrganizationOrgUnit | _SalesOrganizationOrgUnit | |||
| _SalesOrganizationOrgUnit_2 | _SalesOrganizationOrgUnit_2 | |||
| _SalesOfficeOrgUnit | _SalesOfficeOrgUnit | |||
| _SalesOfficeOrgUnit_2 | _SalesOfficeOrgUnit_2 | |||
| _SalesGroupOrgUnit | _SalesGroupOrgUnit | |||
| _SalesGroupOrgUnit_2 | _SalesGroupOrgUnit_2 | |||
| _RespEmployee | _RespEmployee |
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_SrvcDocRevenueFor2Years.
-- 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.
-- Parameters: P_DisplayCurrency : vdm_v_display_currency
CREATE VIEW P_SrvcDocRevenueFor2Years AS
SELECT
Ledger,
SourceLedger,
CompanyCode,
FiscalYear,
AccountingDocument,
LedgerGLLineItem,
GLAccountHierarchy,
SemanticTag,
ValidityStartDate,
ValidityEndDate,
ServiceContract,
ServiceContractItem,
ServiceDocument,
ServiceDocumentItem,
ServiceDocumentType,
ServiceContractType,
CompanyCodeCurrency,
DisplayCurrency,
RevenueAmountInDisplayCrcy,
ServiceDocumentItemNetAmount,
CostAmountInDisplayCurrency,
YTDSrvcContrRevnAmtInDC,
YTDSrvcContrCostInDC,
YTDSrvcContrPrftMarginAmtInDC,
Product,
ProductGroup,
CreationDate,
PostingDate,
DocumentDate,
_PostingDate.CalendarYear AS CalendarYear,
_PostingDate.CalendarQuarter AS CalendarQuarter,
FiscalYearVariant,
FiscalPeriod,
FiscalQuarter,
ServiceObjectType,
ServiceDocumentDescription,
SalesOrganization,
DistributionChannel,
Division,
SalesOffice,
SalesGroup,
SalesOrganizationOrgUnitID,
SalesOfficeOrgUnitID,
SalesGroupOrgUnitID,
ServiceOrganization,
ResponsibleEmployee,
_PostingDate._CalendarYear AS _CalendarYear,
_PostingDate._CalendarQuarter AS _CalendarQuarter
FROM P_ServiceDocLinItmFinConvData
LEFT OUTER JOIN P_CalendarYear AS _PostingDate ON PostingDate = _PostingDate.CalendarDate -- association [0..1]
LEFT OUTER JOIN P_CalendarYear AS _CurrentDate ON _CurrentDate.CalendarDate = $session.system_date -- association [0..1]
;
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