C_DuplicateSalesDocument

DDL: C_DUPLICATESALESDOCUMENT SQL: CSDDPLSLSDOC Type: view CONSUMPTION

Duplicate Sales Documents

C_DuplicateSalesDocument is a Consumption CDS View that provides data about "Duplicate Sales Documents" in SAP S/4HANA. It reads from 3 data sources (C_SglGregorianCalDateFunction, P_DuplicateSalesDocumentGrpg, I_SalesDocument) and exposes 3 fields. It has 13 associations to related views.

Data Sources (3)

SourceAliasJoin Type
C_SglGregorianCalDateFunction C_SglGregorianCalDateFunction inner
P_DuplicateSalesDocumentGrpg P_DuplicateSalesDocumentGrpg inner
I_SalesDocument SalesDocument from

Parameters (1)

NameTypeDefault
P_DateFunction datefunctionid

Associations (13)

CardinalityTargetAliasCondition
[0..*] C_DuplicateSalesDocumentItem _Item $projection.SalesDocument = _Item.SalesDocument
[1..1] P_SalesDocumentItemCount _SalesDocumentItemCount $projection.SalesDocument = _SalesDocumentItemCount.SalesDocument
[0..1] C_DplSlsDocCatVH _SalesDocumentCategory $projection.SDDocumentCategory = _SalesDocumentCategory.SDDocumentCategory
[0..1] C_DplSlsDocTypeVH _SalesDocumentType $projection.SDDocumentCategory = _SalesDocumentType.SDDocumentCategory and $projection.SalesDocumentType = _SalesDocumentType.SalesDocumentType
[0..1] C_SoldToValueHelp _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..1] C_SalesDocumentUserVH _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] C_Dischannelvaluehelp _DistributionChannel $projection.SalesOrganization = _DistributionChannel.SalesOrganization and $projection.DistributionChannel = _DistributionChannel.DistributionChannel
[0..1] C_OrgDivisionValueHelp _OrganizationDivision $projection.SalesOrganization = _OrganizationDivision.SalesOrganization and $projection.DistributionChannel = _OrganizationDivision.DistributionChannel and $projection.OrganizationDivision = _OrganizationDivision.Division
[0..1] C_SalesOfficeValueHelp _SalesOffice $projection.SalesOrganization = _SalesOffice.SalesOrganization and $projection.DistributionChannel = _SalesOffice.DistributionChannel and $projection.OrganizationDivision = _SalesOffice.OrganizationDivision and $projection.SalesOffice = _SalesOffice.SalesOffice
[0..1] C_SalesGroupValueHelp _SalesGroup $projection.SalesOffice = _SalesGroup.SalesOffice and $projection.SalesGroup = _SalesGroup.SalesGroup
[0..1] I_SalesDocumentRjcnReason _SalesDocumentRjcnReason $projection.SalesDocumentRjcnReason = _SalesDocumentRjcnReason.SalesDocumentRjcnReason
[0..1] C_ShipToPartyValueHelp _ShipToParty $projection.ShipToParty = _ShipToParty.Customer and $projection.ShipToPartyAddressID = _ShipToParty.AddressID
[0..1] E_SalesDocumentBasic _Extension $projection.SalesDocument = _Extension.SalesDocument

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CSDDPLSLSDOC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
EndUserText.label Duplicate Sales Documents view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
Metadata.allowExtensions true view

Fields (3)

KeyFieldSource TableSource FieldDescription
SDDocumentCategoryName
DuplicateSalesDocumentGroup0
RequestedDeliveryDate_Item

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_DuplicateSalesDocument.
-- 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: CSDDPLSLSDOC
-- Parameters: P_DateFunction : datefunctionid

CREATE VIEW C_DuplicateSalesDocument AS
SELECT
  entity: { name: 'C_GregorianCalDateFuncVH', element: 'DateFunction' AS SDDocumentCategoryName,
  ltrim(DuplicateSalesDocument.DuplicateSalesDocumentGroup, '0') AS DuplicateSalesDocumentGroup0
FROM I_SalesDocument AS SalesDocument
INNER JOIN P_DuplicateSalesDocumentGrpg ON /* join condition not captured in parsed metadata */
INNER JOIN C_SglGregorianCalDateFunction ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN C_DuplicateSalesDocumentItem AS _Item ON SalesDocument = _Item.SalesDocument  -- association [0..*]
LEFT OUTER JOIN P_SalesDocumentItemCount AS _SalesDocumentItemCount ON SalesDocument = _SalesDocumentItemCount.SalesDocument  -- association [1..1]
LEFT OUTER JOIN C_DplSlsDocCatVH AS _SalesDocumentCategory ON SDDocumentCategory = _SalesDocumentCategory.SDDocumentCategory  -- association [0..1]
LEFT OUTER JOIN C_DplSlsDocTypeVH AS _SalesDocumentType ON SDDocumentCategory = _SalesDocumentType.SDDocumentCategory AND SalesDocumentType = _SalesDocumentType.SalesDocumentType  -- association [0..1]
LEFT OUTER JOIN C_SoldToValueHelp AS _SoldToParty ON SoldToParty = _SoldToParty.Customer  -- association [0..1]
LEFT OUTER JOIN C_SalesDocumentUserVH AS _CreatedByUser ON CreatedByUser = _CreatedByUser.UserID  -- association [0..1]
LEFT OUTER JOIN C_Dischannelvaluehelp AS _DistributionChannel ON SalesOrganization = _DistributionChannel.SalesOrganization AND DistributionChannel = _DistributionChannel.DistributionChannel  -- association [0..1]
LEFT OUTER JOIN C_OrgDivisionValueHelp AS _OrganizationDivision ON SalesOrganization = _OrganizationDivision.SalesOrganization AND DistributionChannel = _OrganizationDivision.DistributionChannel AND OrganizationDivision = _OrganizationDivision.Division  -- association [0..1]
LEFT OUTER JOIN C_SalesOfficeValueHelp AS _SalesOffice ON SalesOrganization = _SalesOffice.SalesOrganization AND DistributionChannel = _SalesOffice.DistributionChannel AND OrganizationDivision = _SalesOffice.OrganizationDivision AND SalesOffice = _SalesOffice.SalesOffice  -- association [0..1]
LEFT OUTER JOIN C_SalesGroupValueHelp AS _SalesGroup ON SalesOffice = _SalesGroup.SalesOffice AND SalesGroup = _SalesGroup.SalesGroup  -- association [0..1]
LEFT OUTER JOIN I_SalesDocumentRjcnReason AS _SalesDocumentRjcnReason ON SalesDocumentRjcnReason = _SalesDocumentRjcnReason.SalesDocumentRjcnReason  -- association [0..1]
LEFT OUTER JOIN C_ShipToPartyValueHelp AS _ShipToParty ON ShipToParty = _ShipToParty.Customer AND ShipToPartyAddressID = _ShipToParty.AddressID  -- association [0..1]
LEFT OUTER JOIN E_SalesDocumentBasic AS _Extension ON SalesDocument = _Extension.SalesDocument  -- association [0..1]
;