C_ReturnsReferenceDocument

DDL: C_RETURNSREFERENCEDOCUMENT Type: view_entity CONSUMPTION Package: ODATA_SD_RETURN_V2

Return Reference Document

C_ReturnsReferenceDocument is a Consumption CDS View that provides data about "Return Reference Document" in SAP S/4HANA. It reads from 1 data source (C_RetsReferenceDocumentUnion) and exposes 40 fields with key field ReturnsReferenceDocument. It has 17 associations to related views. Part of development package ODATA_SD_RETURN_V2.

Data Sources (1)

SourceAliasJoin Type
C_RetsReferenceDocumentUnion ReferenceDocument from

Associations (17)

CardinalityTargetAliasCondition
[0..*] C_ReturnsReferenceDocumentItem _ReturnRefDocItem $projection.ReturnsReferenceDocument = _ReturnRefDocItem.ReturnsReferenceDocument
[0..*] C_ShipToPartyValueHelp _ShipToPartyVH $projection.ShipToParty = _ShipToPartyVH.Customer
[0..1] C_Q2CCustomerQuickView _SoldToPartyVH $projection.SoldToParty = _SoldToPartyVH.Customer
[0..1] I_OverallSDProcessStatus _OverallSDProcessStatusVH $projection.OverallSDProcessStatus = _OverallSDProcessStatusVH.OverallSDProcessStatus
[0..1] C_ReturnsRefDocUserValueHelp _CreatedByVH $projection.CreatedByUser = _CreatedByVH.UserID
[0..*] C_SalesGroupValueHelp _SalesGroupVH $projection.SalesGroup = _SalesGroupVH.SalesGroup
[0..*] C_SalesOfficeValueHelp _SalesOfficeVH $projection.SalesOffice = _SalesOfficeVH.SalesOffice
[0..1] C_RetsRefDocCategoryValueHelp _DocCategoryRefVH $projection.SDDocumentCategory = _DocCategoryRefVH.SDDocumentCategory
[0..1] C_EmployeeValueHelp _EmplRespVH $projection.ResponsibleEmployee = _EmplRespVH.PersonnelNumber
[0..1] I_SalesOrganization _SalesOrganization $projection.SalesOrganization = _SalesOrganization.SalesOrganization
[0..1] C_Dischannelvaluehelp _DistributionChannelVH $projection.SalesOrganization = _DistributionChannelVH.SalesOrganization and $projection.DistributionChannel = _DistributionChannelVH.DistributionChannel
[0..1] C_OrgDivisionValueHelp _DivisionVH $projection.SalesOrganization = _DivisionVH.SalesOrganization and $projection.DistributionChannel = _DivisionVH.DistributionChannel and $projection.OrganizationDivision = _DivisionVH.Division
[0..*] C_ReturnsReferenceDocVH _ReferenceDocumentVH $projection.ReturnsReferenceDocument = _ReferenceDocumentVH.ReferenceSDDocument
[0..*] C_RetsRefDocItemAttribute _RetsRefDocItemAttribute $projection.ReturnsReferenceDocument = _RetsRefDocItemAttribute.ReferenceDocument
[0..1] I_PersonWorkAgreement_1 _ResponsibleEmployeeText $projection.ResponsibleEmployee = _ResponsibleEmployeeText.PersonWorkAgreement
[0..*] I_SDDocumentCategoryText _SDDocumentCategoryText $projection.SDDocumentCategory = _SDDocumentCategoryText.SDDocumentCategory
[0..1] I_Customer _SoldToParty _SoldToParty.Customer = ReferenceDocument.SoldToParty

Annotations (11)

NameValueLevelField
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #MANDATORY view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.compositionRoot true view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
EndUserText.label Return Reference Document view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view
Search.searchable true view

Fields (40)

KeyFieldSource TableSource FieldDescription
KEY ReturnsReferenceDocument C_RetsReferenceDocumentUnion ReferenceSDDocument Reference Doc.
SDDocumentCategory C_RetsReferenceDocumentUnion SDDocumentCategory Document Cat.
DocumentType C_RetsReferenceDocumentUnion ReferenceSDDocumentType
DocumentTypeName C_RetsReferenceDocumentUnion DocumentTypeName Description
PurchaseOrderByCustomer C_RetsReferenceDocumentUnion PurchaseOrderByCustomer Purchase Order Number
SoldToParty C_RetsReferenceDocumentUnion SoldToParty Sold-to Party
SoldToPartyName C_RetsReferenceDocumentUnion SoldToPartyName Sold-to Party Name
ShipToParty C_RetsReferenceDocumentUnion ShipToParty Ship-To Party (obsolete)
ShipToPartyName C_RetsReferenceDocumentUnion ShipToPartyName Ship-To Party Name
DocumentDate C_RetsReferenceDocumentUnion DocumentDate Journal Entry Date
TotalNetAmount C_RetsReferenceDocumentUnion TotalNetAmount Total Net Amount
TransactionCurrency C_RetsReferenceDocumentUnion TransactionCurrency Transaction Currency
CreatedByUser C_RetsReferenceDocumentUnion CreatedByUser User Name
ResponsibleEmployee C_RetsReferenceDocumentUnion ResponsibleEmployee Employee Resp.
SalesOrganization C_RetsReferenceDocumentUnion SalesOrganization Sales Organization
DistributionChannel C_RetsReferenceDocumentUnion DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision C_RetsReferenceDocumentUnion OrganizationDivision Org. Division
SalesGroup C_RetsReferenceDocumentUnion SalesGroup Sales Group
SalesOffice C_RetsReferenceDocumentUnion SalesOffice Sales Office
PricingDate C_RetsReferenceDocumentUnion PricingDate Pricing Date
OverallSDProcessStatus C_RetsReferenceDocumentUnion OverallSDProcessStatus
OverallSDProcessStatusDesc C_RetsReferenceDocumentUnion OverallSDProcessStatusDesc
CreateActionIsEnabled
_ReturnRefDocItem _ReturnRefDocItem
_EmplRespVH _EmplRespVH
_ShipToPartyVH _ShipToPartyVH
_SoldToPartyVH _SoldToPartyVH
_OverallSDProcessStatusVH _OverallSDProcessStatusVH
_CreatedByVH _CreatedByVH
_SalesGroupVH _SalesGroupVH
_SalesOfficeVH _SalesOfficeVH
_DocCategoryRefVH _DocCategoryRefVH
_DivisionVH _DivisionVH
_DistributionChannelVH _DistributionChannelVH
_SalesOrganization _SalesOrganization
_ReferenceDocumentVH _ReferenceDocumentVH
_ResponsibleEmployeeText _ResponsibleEmployeeText
_SDDocumentCategoryText _SDDocumentCategoryText
_SoldToParty _SoldToParty
_RetsRefDocItemAttribute _RetsRefDocItemAttribute

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_ReturnsReferenceDocument.
-- 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 C_ReturnsReferenceDocument AS
SELECT
  ReferenceDocument.ReferenceSDDocument AS ReturnsReferenceDocument,
  ReferenceDocument.SDDocumentCategory AS SDDocumentCategory,
  ReferenceDocument.ReferenceSDDocumentType AS DocumentType,
  ReferenceDocument.DocumentTypeName AS DocumentTypeName,
  ReferenceDocument.PurchaseOrderByCustomer AS PurchaseOrderByCustomer,
  ReferenceDocument.SoldToParty AS SoldToParty,
  ReferenceDocument.SoldToPartyName AS SoldToPartyName,
  ReferenceDocument.ShipToParty AS ShipToParty,
  ReferenceDocument.ShipToPartyName AS ShipToPartyName,
  ReferenceDocument.DocumentDate AS DocumentDate,
  ReferenceDocument.TotalNetAmount AS TotalNetAmount,
  ReferenceDocument.TransactionCurrency AS TransactionCurrency,
  ReferenceDocument.CreatedByUser AS CreatedByUser,
  ReferenceDocument.ResponsibleEmployee AS ResponsibleEmployee,
  ReferenceDocument.SalesOrganization AS SalesOrganization,
  ReferenceDocument.DistributionChannel AS DistributionChannel,
  ReferenceDocument.OrganizationDivision AS OrganizationDivision,
  ReferenceDocument.SalesGroup AS SalesGroup,
  ReferenceDocument.SalesOffice AS SalesOffice,
  ReferenceDocument.PricingDate AS PricingDate,
  ReferenceDocument.OverallSDProcessStatus AS OverallSDProcessStatus,
  ReferenceDocument.OverallSDProcessStatusDesc AS OverallSDProcessStatusDesc,
  '' AS CreateActionIsEnabled
FROM C_RetsReferenceDocumentUnion AS ReferenceDocument
LEFT OUTER JOIN C_ReturnsReferenceDocumentItem AS _ReturnRefDocItem ON ReturnsReferenceDocument = _ReturnRefDocItem.ReturnsReferenceDocument  -- association [0..*]
LEFT OUTER JOIN C_ShipToPartyValueHelp AS _ShipToPartyVH ON ShipToParty = _ShipToPartyVH.Customer  -- association [0..*]
LEFT OUTER JOIN C_Q2CCustomerQuickView AS _SoldToPartyVH ON SoldToParty = _SoldToPartyVH.Customer  -- association [0..1]
LEFT OUTER JOIN I_OverallSDProcessStatus AS _OverallSDProcessStatusVH ON OverallSDProcessStatus = _OverallSDProcessStatusVH.OverallSDProcessStatus  -- association [0..1]
LEFT OUTER JOIN C_ReturnsRefDocUserValueHelp AS _CreatedByVH ON CreatedByUser = _CreatedByVH.UserID  -- association [0..1]
LEFT OUTER JOIN C_SalesGroupValueHelp AS _SalesGroupVH ON SalesGroup = _SalesGroupVH.SalesGroup  -- association [0..*]
LEFT OUTER JOIN C_SalesOfficeValueHelp AS _SalesOfficeVH ON SalesOffice = _SalesOfficeVH.SalesOffice  -- association [0..*]
LEFT OUTER JOIN C_RetsRefDocCategoryValueHelp AS _DocCategoryRefVH ON SDDocumentCategory = _DocCategoryRefVH.SDDocumentCategory  -- association [0..1]
LEFT OUTER JOIN C_EmployeeValueHelp AS _EmplRespVH ON ResponsibleEmployee = _EmplRespVH.PersonnelNumber  -- association [0..1]
LEFT OUTER JOIN I_SalesOrganization AS _SalesOrganization ON SalesOrganization = _SalesOrganization.SalesOrganization  -- association [0..1]
LEFT OUTER JOIN C_Dischannelvaluehelp AS _DistributionChannelVH ON SalesOrganization = _DistributionChannelVH.SalesOrganization AND DistributionChannel = _DistributionChannelVH.DistributionChannel  -- association [0..1]
LEFT OUTER JOIN C_OrgDivisionValueHelp AS _DivisionVH ON SalesOrganization = _DivisionVH.SalesOrganization AND DistributionChannel = _DivisionVH.DistributionChannel AND OrganizationDivision = _DivisionVH.Division  -- association [0..1]
LEFT OUTER JOIN C_ReturnsReferenceDocVH AS _ReferenceDocumentVH ON ReturnsReferenceDocument = _ReferenceDocumentVH.ReferenceSDDocument  -- association [0..*]
LEFT OUTER JOIN C_RetsRefDocItemAttribute AS _RetsRefDocItemAttribute ON ReturnsReferenceDocument = _RetsRefDocItemAttribute.ReferenceDocument  -- association [0..*]
LEFT OUTER JOIN I_PersonWorkAgreement_1 AS _ResponsibleEmployeeText ON ResponsibleEmployee = _ResponsibleEmployeeText.PersonWorkAgreement  -- association [0..1]
LEFT OUTER JOIN I_SDDocumentCategoryText AS _SDDocumentCategoryText ON SDDocumentCategory = _SDDocumentCategoryText.SDDocumentCategory  -- association [0..*]
LEFT OUTER JOIN I_Customer AS _SoldToParty ON _SoldToParty.Customer = ReferenceDocument.SoldToParty  -- association [0..1]
;