@Metadata: {
ignorePropagatedAnnotations: true
}
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.viewType: #CONSUMPTION
@ObjectModel.dataCategory: #VALUE_HELP
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.representativeKey : 'ReferenceSDDocument'
@EndUserText.label : 'Customer Return Reference SD Document'
@Search.searchable: true
@Consumption.valueHelpDefault.fetchValues: #ON_EXPLICIT_REQUEST
define view entity C_CustRetRefSDDocumentVH
as select distinct from I_SalesDocumentBasic as SalesDocument
inner join I_CustRetCpyCtrlSrceDocType as CustRetCpyCtrlSrceDocTyp on CustRetCpyCtrlSrceDocTyp.SourceSalesDocumentType = SalesDocument.SalesDocumentType
left outer to many join P_ReturnsReferenceDocument as DeliveryDocument on DeliveryDocument.SDDocument = SalesDocument.SalesDocument
association [0..*] to I_SDDocumentCategoryText as _SDDocCategoryText on SalesDocument.SDDocumentCategory = _SDDocCategoryText.SDDocumentCategory
association [0..1] to I_SalesDocumentPartner as _SalesDocumentPartner on _SalesDocumentPartner.SalesDocument = SalesDocument.SalesDocument and
_SalesDocumentPartner.PartnerFunction = 'AG'
{
@Search.ranking: #HIGH
@Search.fuzzinessThreshold : 0.9
@Search.defaultSearchElement: true
key cast (SalesDocument.SalesDocument as vgbel preserving type) as ReferenceSDDocument,
@Search.fuzzinessThreshold : 0.9
@Search.defaultSearchElement: true
key DeliveryDocument.DeliveryDocument,
@Consumption: {valueHelpDefinition: [{ entity : { name: 'C_RetsRefDocCategoryValueHelp',
element: 'SDDocumentCategory' }
}],
valueHelpDefault.initialValueIsSignificant: true }
@UI.textArrangement: #TEXT_FIRST
@ObjectModel.text.element: ['SDDocumentCategoryName']
SalesDocument.SDDocumentCategory,
@UI.hidden: true
@Semantics.text: true
_SDDocCategoryText[1: Language=$session.system_language].SDDocumentCategoryName,
@Consumption.filter : { selectionType: #INTERVAL, multipleSelections: false }
SalesDocument.SalesDocumentDate as DocumentDate,
@Consumption: {
valueHelpDefinition:[{
entity : { name: 'C_SoldToSalesAreaVH', element: 'Customer' } },
{ qualifier : 'SalesAreaSpecificSoldToVH' ,
label : 'Sold-to Party By Sales Area',
entity : { name: 'C_SoldToSlsOrgDistrChnlDivVH', element: 'Customer' } },
{ qualifier : 'SoldToMultiAddrVH' ,
label : 'Sold-to Party by All Addresses',
entity : { name: 'C_SoldToMultipleAddressVH', element: 'SoldToParty' } }]}
@UI.textArrangement: #TEXT_FIRST
@ObjectModel.text.element: ['SoldToPartyName']
SalesDocument.SoldToParty,
@Semantics.text: true
@UI.hidden: true
@EndUserText.label : 'Sold-to Party Name'
_SalesDocumentPartner.FullName as SoldToPartyName,
@Consumption.hidden: true
DeliveryDocument.ShippingPoint as ShippingPoint,
// For Access control
@Consumption.hidden: true
cast (SalesDocument.SalesDocumentType as vbart preserving type) as SDDocumentType,
@Consumption.hidden: true
SalesDocument.SalesOrganization as SalesOrganization,
@Consumption.hidden: true
SalesDocument.DistributionChannel as DistributionChannel,
@Consumption.hidden: true
SalesDocument.OrganizationDivision as Division
}
where
//Get rid of incomplete sales order in reference document
SalesDocument.HdrGeneralIncompletionStatus = 'C'
and SalesDocument.OvrlItmGeneralIncompletionSts = 'C'
union all
select distinct from I_BillingDocument as BillingDocument
inner join I_CustRetCpyCtrlSrceDocType as CustRetCpyCtrlSrceDocTyp on CustRetCpyCtrlSrceDocTyp.SourceBillingDocumentType = BillingDocument.BillingDocumentType
left outer to many join P_ReturnsReferenceDocument as DeliveryDocument on DeliveryDocument.SDDocument = BillingDocument.BillingDocument
association [0..*] to I_SDDocumentCategoryText as _SDDocCategoryText on BillingDocument.SDDocumentCategory = _SDDocCategoryText.SDDocumentCategory
association [0..1] to I_SalesDocumentPartner as _SalesDocumentPartner on _SalesDocumentPartner.SalesDocument = BillingDocument.BillingDocument and
_SalesDocumentPartner.PartnerFunction = 'AG'
{
key cast (BillingDocument.BillingDocument as vgbel preserving type) as ReferenceSDDocument,
key DeliveryDocument.DeliveryDocument,
BillingDocument.SDDocumentCategory,
_SDDocCategoryText[1: Language=$session.system_language].SDDocumentCategoryName,
BillingDocument.BillingDocumentDate as DocumentDate,
BillingDocument.SoldToParty,
_SalesDocumentPartner.FullName as SoldToPartyName,
DeliveryDocument.ShippingPoint as ShippingPoint,
// For Access control
cast (BillingDocument.BillingDocumentType as vbart preserving type) as SDDocumentType,
BillingDocument.SalesOrganization as SalesOrganization,
BillingDocument.DistributionChannel as DistributionChannel,
BillingDocument.Division as Division
}
where
//Add is draft filter to get rid of temporary billing in reference document
BillingDocument.BillingDocumentIsTemporary = ''
and BillingDocument.BillingDocumentIsCancelled <> 'X'
Depth:
1
2
3
4
5
All
Reload
C_CustRetRefSDDocumentVH view_entity