P_ReturnsDocumentItemRefund

DDL: P_RETURNSDOCUMENTITEMREFUND SQL: PCRTITMRFND Type: view CONSUMPTION Package: ODATA_SD_RETURN_V2

Returns Document Item Refund

P_ReturnsDocumentItemRefund is a Consumption CDS View that provides data about "Returns Document Item Refund" in SAP S/4HANA. It reads from 3 data sources (I_AdvncdRetsMgmtMatlInspection, P_CustomerReturnItemEnhanced, P_CustomerReturnItemEnhanced) and exposes 60 fields with key fields CustomerReturn, CustomerReturnItem, InspectionDocument, CustomerReturnItem, InspectionDocument. Part of development package ODATA_SD_RETURN_V2.

Data Sources (3)

SourceAliasJoin Type
I_AdvncdRetsMgmtMatlInspection AdvncdRetsMgmtMatlInspection inner
P_CustomerReturnItemEnhanced Refund from
P_CustomerReturnItemEnhanced Refund union_all

Annotations (6)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName PCRTITMRFND view
AbapCatalog.compiler.compareFilter true view
VDM.private true view
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (60)

KeyFieldSource TableSource FieldDescription
KEY CustomerReturn P_CustomerReturnItemEnhanced CustomerReturn
KEY CustomerReturnItem P_CustomerReturnItemEnhanced CustomerReturnItem
KEY InspectionDocument I_AdvncdRetsMgmtMatlInspection InspectionDocument Inspection Number
CustomerReturnItemCategory P_CustomerReturnItemEnhanced CustomerReturnItemCategory
OrderQuantity
OrderQuantityUnit P_CustomerReturnItemEnhanced OrderQuantityUnit Sales Unit
ReturnsRefundExtent P_CustomerReturnItemEnhanced ReturnsRefundExtent
ReturnsRefundType P_CustomerReturnItemEnhanced ReturnsRefundType
HigherLevelItem P_CustomerReturnItemEnhanced HigherLevelItem Higher-Lev.Item
ProductConfiguration P_CustomerReturnItemEnhanced ProductConfiguration
RetsMgmtProcessStep AdvncdRetsMgmtCompnStatus RetsMgmtProcessStep
RetsMgmtProcess P_CustomerReturnItemEnhanced RetsMgmtProcess
RetsMgmtProcessItem P_CustomerReturnItemEnhanced RetsMgmtProcessItem
ReturnsRefundProcgMode P_CustomerReturnItemEnhanced ReturnsRefundProcgMode
Material
ReturnsRefundRjcnReason P_CustomerReturnItemEnhanced ReturnsRefundRjcnReason
NetAmount P_CustomerReturnItemEnhanced NetAmount Stated Amount
TransactionCurrency P_CustomerReturnItemEnhanced TransactionCurrency Transaction Currency
RetMatlInspResultCode
SalesOrganization
DistributionChannel
OrganizationDivision
CustomerReturnType
Plant P_CustomerReturnItemEnhanced Plant Valuation Area
Batch P_CustomerReturnItemEnhanced Batch Lot No.
BillOfMaterial P_CustomerReturnItemEnhanced BillOfMaterial BOM
ReturnsDelivery I_AdvncdRetsMgmtMatlInspection ReturnsDelivery Delivery
ReturnsDeliveryItem I_AdvncdRetsMgmtMatlInspection ReturnsDeliveryItem Item
InspectedProductQtyInBaseUnit I_AdvncdRetsMgmtMatlInspection InspectedProductQtyInBaseUnit Quantity
CustomerReturn
KEY CustomerReturnItem P_CustomerReturnItemEnhanced CustomerReturnItem
KEY InspectionDocument Inspection Number
CustomerReturnItemCategory P_CustomerReturnItemEnhanced CustomerReturnItemCategory
OrderQuantity
OrderQuantityUnit P_CustomerReturnItemEnhanced OrderQuantityUnit Sales Unit
ReturnsRefundExtent P_CustomerReturnItemEnhanced ReturnsRefundExtent
ReturnsRefundType P_CustomerReturnItemEnhanced ReturnsRefundType
HigherLevelItem P_CustomerReturnItemEnhanced HigherLevelItem Higher-Lev.Item
ProductConfiguration P_CustomerReturnItemEnhanced ProductConfiguration
RetsMgmtProcessStep AdvncdRetsMgmtCompnStatus RetsMgmtProcessStep
RetsMgmtProcess P_CustomerReturnItemEnhanced RetsMgmtProcess
RetsMgmtProcessItem P_CustomerReturnItemEnhanced RetsMgmtProcessItem
ReturnsRefundProcgMode P_CustomerReturnItemEnhanced ReturnsRefundProcgMode
Material
ReturnsRefundRjcnReason P_CustomerReturnItemEnhanced ReturnsRefundRjcnReason
NetAmount P_CustomerReturnItemEnhanced NetAmount Stated Amount
TransactionCurrency P_CustomerReturnItemEnhanced TransactionCurrency Transaction Currency
RetMatlInspResultCode
SalesOrganization
DistributionChannel
OrganizationDivision
CustomerReturnType
Plant P_CustomerReturnItemEnhanced Plant Valuation Area
Batch P_CustomerReturnItemEnhanced Batch Lot No.
BillOfMaterial P_CustomerReturnItemEnhanced BillOfMaterial BOM
CustRetItmFollowUpActivity P_CustomerReturnItemEnhanced CustRetItmFollowUpActivity Follow-Up Act.
ReturnsDelivery Delivery
ReturnsDeliveryItem Item
InspectedProductQtyInBaseUnit Quantity
BaseUnit

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_ReturnsDocumentItemRefund.
-- 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: PCRTITMRFND

CREATE VIEW P_ReturnsDocumentItemRefund AS
SELECT
  Refund.CustomerReturn AS CustomerReturn,
  Refund.CustomerReturnItem AS CustomerReturnItem,
  AdvncdRetsMgmtMatlInspection.InspectionDocument AS InspectionDocument,
  Refund.CustomerReturnItemCategory AS CustomerReturnItemCategory,
  cast(Refund.OrderQuantity as returned_quantity) AS OrderQuantity,
  Refund.OrderQuantityUnit AS OrderQuantityUnit,
  Refund.ReturnsRefundExtent AS ReturnsRefundExtent,
  Refund.ReturnsRefundType AS ReturnsRefundType,
  Refund.HigherLevelItem AS HigherLevelItem,
  Refund.ProductConfiguration AS ProductConfiguration,
  AdvncdRetsMgmtCompnStatus.RetsMgmtProcessStep AS RetsMgmtProcessStep,
  Refund.RetsMgmtProcess AS RetsMgmtProcess,
  Refund.RetsMgmtProcessItem AS RetsMgmtProcessItem,
  Refund.ReturnsRefundProcgMode AS ReturnsRefundProcgMode,
  cast(Refund.Product as productnumber preserving type) AS Material,
  Refund.ReturnsRefundRjcnReason AS ReturnsRefundRjcnReason,
  Refund.NetAmount AS NetAmount,
  Refund.TransactionCurrency AS TransactionCurrency,
  cast(AdvncdRetsMgmtMatlInspection.RetMatlInspResultCode as msr_inspection_code) AS RetMatlInspResultCode,
  Refund._CustomerReturn.SalesOrganization AS SalesOrganization,
  Refund._CustomerReturn.DistributionChannel AS DistributionChannel,
  Refund._CustomerReturn.OrganizationDivision AS OrganizationDivision,
  Refund._CustomerReturn.CustomerReturnType AS CustomerReturnType,
  Refund.Plant AS Plant,
  Refund.Batch AS Batch,
  Refund.BillOfMaterial AS BillOfMaterial,
  AdvncdRetsMgmtMatlInspection.ReturnsDelivery AS ReturnsDelivery,
  AdvncdRetsMgmtMatlInspection.ReturnsDeliveryItem AS ReturnsDeliveryItem,
  AdvncdRetsMgmtMatlInspection.InspectedProductQtyInBaseUnit AS InspectedProductQtyInBaseUnit,
  Refund.CustRetItmFollowUpActivity AS CustRetItmFollowUpActivity,
  cast('' as meins) AS BaseUnit
FROM P_CustomerReturnItemEnhanced AS Refund
INNER JOIN I_AdvncdRetsMgmtMatlInspection AS AdvncdRetsMgmtMatlInspection ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_CustomerReturnItemEnhanced
;