C_RetsReferenceDocumentUnion

DDL: C_RETSREFERENCEDOCUMENTUNION Type: view_entity CONSUMPTION Package: ODATA_SD_RETURN_V2

Returns Reference Document

C_RetsReferenceDocumentUnion is a Consumption CDS View that provides data about "Returns Reference Document" in SAP S/4HANA. It reads from 12 data sources and exposes 82 fields with key field ReferenceSDDocument. Part of development package ODATA_SD_RETURN_V2.

Data Sources (12)

SourceAliasJoin Type
P_AllwdCustRetTypePerSlsOrg AllwdCustRetTypePerSlsOrg inner
P_AllwdCustRetTypePerSlsOrg AllwdCustRetTypePerSlsOrg inner
P_AllwdTypPerSlsOrgCnt AllwdTypPerSlsOrgCnt inner
P_AllwdTypPerSlsOrgCnt AllwdTypPerSlsOrgCnt inner
I_BillingDocument BillingDocument union_all
I_BillingDocument BillingDocument union_all
P_CustRetAvailRefSlsDocType CustRetCpyCtrlSrceDocType inner
P_CustRetAvailRefSlsDocType CustRetCpyCtrlSrceDocType inner
P_CustRetAvailRefBillgDocType CustRetCpyCtrlSrceDocType inner
P_CustRetAvailRefBillgDocType CustRetCpyCtrlSrceDocType inner
I_SalesDocument SalesDocument from
I_SalesDocument SalesDocument union_all

Annotations (7)

NameValueLevelField
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
EndUserText.label Returns Reference Document view
Metadata.ignorePropagatedAnnotations true view

Fields (82)

KeyFieldSource TableSource FieldDescription
KEY ReferenceSDDocument
SDDocumentCategory I_SalesDocument SDDocumentCategory Document Cat.
ReferenceSDDocumentType
DocumentTypeName
PurchaseOrderByCustomer I_SalesDocument PurchaseOrderByCustomer Purchase Order Number
SoldToParty I_SalesDocument SoldToParty Sold-to Party
SoldToPartyName
ShipToParty
ShipToPartyName
DocumentDate I_SalesDocument SalesDocumentDate Billing Date
TotalNetAmount I_SalesDocument TotalNetAmount Total Net Amount
TransactionCurrency I_SalesDocument TransactionCurrency Transaction Currency
CreatedByUser I_SalesDocument CreatedByUser User Name
ResponsibleEmployee
SalesOrganization I_SalesDocument SalesOrganization Sales Organization
DistributionChannel I_SalesDocument DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision I_SalesDocument OrganizationDivision Internal Division ID
SalesGroup I_SalesDocument SalesGroup Sales Group
SalesOffice I_SalesDocument SalesOffice Sales Office
PricingDate I_SalesDocument PricingDate Pricing Date
OverallSDProcessStatus I_SalesDocument OverallSDProcessStatus
SDDocumentCategory I_SalesDocument SDDocumentCategory Document Cat.
ReferenceSDDocumentType
DocumentTypeName
PurchaseOrderByCustomer I_SalesDocument PurchaseOrderByCustomer Purchase Order Number
SoldToParty I_SalesDocument SoldToParty Sold-to Party
SoldToPartyName
ShipToParty
ShipToPartyName
DocumentDate I_SalesDocument SalesDocumentDate Billing Date
TotalNetAmount I_SalesDocument TotalNetAmount Total Net Amount
TransactionCurrency I_SalesDocument TransactionCurrency Transaction Currency
CreatedByUser I_SalesDocument CreatedByUser User Name
ResponsibleEmployee
SalesOrganization I_SalesDocument SalesOrganization Sales Organization
DistributionChannel I_SalesDocument DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision I_SalesDocument OrganizationDivision Internal Division ID
SalesGroup I_SalesDocument SalesGroup Sales Group
SalesOffice I_SalesDocument SalesOffice Sales Office
PricingDate I_SalesDocument PricingDate Pricing Date
OverallSDProcessStatus I_SalesDocument OverallSDProcessStatus
SDDocumentCategory I_BillingDocument SDDocumentCategory Document Cat.
ReferenceSDDocumentType
DocumentTypeName
PurchaseOrderByCustomer I_BillingDocument PurchaseOrderByCustomer Purchase Order Number
SoldToParty I_BillingDocument SoldToParty Sold-to Party
SoldToPartyName
ShipToParty
ShipToPartyName
DocumentDate I_BillingDocument BillingDocumentDate Billing Date
TotalNetAmount I_BillingDocument TotalNetAmount Total Net Amount
TransactionCurrency I_BillingDocument TransactionCurrency Transaction Currency
CreatedByUser I_BillingDocument CreatedByUser User Name
ResponsibleEmployee
SalesOrganization I_BillingDocument SalesOrganization Sales Organization
DistributionChannel I_BillingDocument DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision I_BillingDocument Division Internal Division ID
SalesGroup Sales Group
SalesOffice Sales Office
PricingDate Pricing Date
OverallSDProcessStatus I_BillingDocument OverallSDProcessStatus
SDDocumentCategory I_BillingDocument SDDocumentCategory Document Cat.
ReferenceSDDocumentType
DocumentTypeName
PurchaseOrderByCustomer I_BillingDocument PurchaseOrderByCustomer Purchase Order Number
SoldToParty I_BillingDocument SoldToParty Sold-to Party
SoldToPartyName
ShipToParty
ShipToPartyName
DocumentDate I_BillingDocument BillingDocumentDate Billing Date
TotalNetAmount I_BillingDocument TotalNetAmount Total Net Amount
TransactionCurrency I_BillingDocument TransactionCurrency Transaction Currency
CreatedByUser I_BillingDocument CreatedByUser User Name
ResponsibleEmployee
SalesOrganization I_BillingDocument SalesOrganization Sales Organization
DistributionChannel I_BillingDocument DistributionChannel RefDistCh-Cust/Mat.
OrganizationDivision I_BillingDocument Division Internal Division ID
SalesGroup Sales Group
SalesOffice Sales Office
PricingDate Pricing Date
OverallSDProcessStatus I_BillingDocument OverallSDProcessStatus
OverallSDProcessStatusDesc

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_RetsReferenceDocumentUnion.
-- 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_RetsReferenceDocumentUnion AS
SELECT
  cast(SalesDocument.SalesDocument as vgbel preserving type) AS ReferenceSDDocument,
  SalesDocument.SDDocumentCategory AS SDDocumentCategory,
  cast(SalesDocument.SalesDocumentType as vbart preserving type) AS ReferenceSDDocumentType,
  cast(SalesDocument._SalesDocumentType._Text[1: Language=$session.system_language].SalesDocumentTypeName as bezei40) AS DocumentTypeName,
  SalesDocument.PurchaseOrderByCustomer AS PurchaseOrderByCustomer,
  SalesDocument.SoldToParty AS SoldToParty,
  cast('' as ad_namtext ) AS SoldToPartyName,
  SalesDocument._StandardPartner.ShipToParty AS ShipToParty,
  SalesDocument._StandardPartner._ShipToParty.CustomerFullName AS ShipToPartyName,
  SalesDocument.SalesDocumentDate AS DocumentDate,
  SalesDocument.TotalNetAmount AS TotalNetAmount,
  SalesDocument.TransactionCurrency AS TransactionCurrency,
  SalesDocument.CreatedByUser AS CreatedByUser,
  cast(SalesDocument._Partner[PartnerFunction = 'ZM'].Personnel as resp_empl) AS ResponsibleEmployee,
  SalesDocument.SalesOrganization AS SalesOrganization,
  SalesDocument.DistributionChannel AS DistributionChannel,
  SalesDocument.OrganizationDivision AS OrganizationDivision,
  SalesDocument.SalesGroup AS SalesGroup,
  SalesDocument.SalesOffice AS SalesOffice,
  SalesDocument.PricingDate AS PricingDate,
  SalesDocument.OverallSDProcessStatus AS OverallSDProcessStatus,
  BillingDocument._OverallSDProcessStatus._Text[1: Language=$session.system_language].OverallSDProcessStatusDesc AS OverallSDProcessStatusDesc
FROM I_SalesDocument AS SalesDocument
INNER JOIN P_CustRetAvailRefSlsDocType AS CustRetCpyCtrlSrceDocType ON /* join condition not captured in parsed metadata */
INNER JOIN P_AllwdTypPerSlsOrgCnt AS AllwdTypPerSlsOrgCnt ON /* join condition not captured in parsed metadata */
INNER JOIN P_AllwdCustRetTypePerSlsOrg AS AllwdCustRetTypePerSlsOrg ON /* join condition not captured in parsed metadata */
INNER JOIN P_CustRetAvailRefBillgDocType AS CustRetCpyCtrlSrceDocType ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): I_SalesDocument, I_BillingDocument
;