@Metadata: {
ignorePropagatedAnnotations: true
}
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.viewType: #CONSUMPTION
@ObjectModel.dataCategory: #VALUE_HELP
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@EndUserText.label : 'Return Reference Document'
@Search.searchable: true
define view entity C_ReturnsReferenceDocVH
as select distinct from I_SalesDocument 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
{
@Search.ranking: #HIGH
@Search.fuzzinessThreshold : 0.8
@Search.defaultSearchElement: true
key cast (SalesDocument.SalesDocument as vgbel) as ReferenceSDDocument,
key DeliveryDocument.DeliveryDocument,
@UI.hidden: true
SalesDocument.SDDocumentCategory,
SalesDocument._SDDocumentCategory._Text[1: Language=$session.system_language].SDDocumentCategoryName,
@Consumption.filter : { selectionType: #INTERVAL, multipleSelections: false }
SalesDocument.SalesDocumentDate as DocumentDate,
SalesDocument.SoldToParty,
SalesDocument._StandardPartner.ShipToParty as ShipToParty,
@EndUserText.label : 'Employee Responsible'
cast (SalesDocument._Partner[ PartnerFunction = 'ZM'].Personnel as resp_empl_userid) as ResponsibleEmployeeUserID,
// For Access control
@Consumption.hidden: true
@UI.hidden: true
SalesDocument.SalesDocumentType as SDDocumentType,
@Consumption.hidden: true
@UI.hidden: true
DeliveryDocument.ShippingPoint as ShippingPoint,
SalesDocument.SalesOrganization as SalesOrganization,
SalesDocument.DistributionChannel as DistributionChannel,
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 CustRetCpyCtrlSrceDocType on CustRetCpyCtrlSrceDocType.SourceBillingDocumentType = BillingDocument.BillingDocumentType
left outer to many join P_ReturnsReferenceDocument as DeliveryDocument on DeliveryDocument.SDDocument = BillingDocument.BillingDocument
{
key cast (BillingDocument.BillingDocument as vgbel) as ReferenceSDDocument,
key DeliveryDocument.DeliveryDocument,
BillingDocument.SDDocumentCategory,
BillingDocument._SDDocumentCategory._Text[1: Language=$session.system_language].SDDocumentCategoryName,
BillingDocument.BillingDocumentDate as DocumentDate,
BillingDocument.SoldToParty,
cast (BillingDocument._Partner[ PartnerFunction = 'WE'].Customer as kunwe) as ShipToParty,
cast (BillingDocument._Partner[ PartnerFunction = 'ZM'].Personnel as resp_empl_userid) as ResponsibleEmployeeUserID,
// For Access control
BillingDocument.BillingDocumentType as SDDocumentType,
DeliveryDocument.ShippingPoint as ShippingPoint,
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'
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_BILLINGDOCUMENT",
"I_BILLINGDOCUMENTPARTNER",
"I_CUSTRETCPYCTRLSRCEDOCTYPE",
"I_SALESDOCUMENT",
"I_SALESDOCUMENTPARTNER",
"I_SALESDOCUMENTSTANDARDPARTNER",
"I_SDDOCUMENTCATEGORY",
"I_SDDOCUMENTCATEGORYTEXT",
"P_RETURNSREFERENCEDOCUMENT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
C_ReturnsReferenceDocVH view_entity