@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.sqlViewName: 'CCUSTRETURNITFS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@AccessControl.privilegedAssociations: [ '_SDDocumentPartnerCard' ]
@ObjectModel: {
compositionRoot: true, //Necessary to mark the root node in a consumption view
semanticKey: ['CustomerReturn', 'CustomerReturnItem'],
usageType.dataClass: #MIXED,
usageType.serviceQuality: #C,
usageType.sizeCategory: #XXL
}
@EndUserText.label: 'Returns Order Item Fact Sheet'
@VDM.viewType: #CONSUMPTION
@Search.searchable: true
@UI.headerInfo: {
typeName: 'Customer Return Item',
title: {
type: #STANDARD,
value: 'CustomerReturnItemText'
},
description: {
type: #STANDARD,
value: 'Material'
}
}
define view C_Customerreturnitemfs
as select from I_CustomerReturnItemEnhanced as Item
//Associations
association [1..1] to C_Customerreturnfs as _CustomerReturn on $projection.CustomerReturn = _CustomerReturn.CustomerReturn
association [0..*] to C_SDDocumentPartnerCard as _SDDocumentPartnerCard on $projection.CustomerReturn = _SDDocumentPartnerCard.SDDocument
and $projection.CustomerReturnItem = _SDDocumentPartnerCard.SDDocumentItem
association [0..*] to C_SubsqntCustRetDeliveryItem as _SubsqntCustRetDeliveryItem on $projection.CustomerReturn = _SubsqntCustRetDeliveryItem.PrecedingDocument
association [0..*] to C_SubsqntCreditMemoReqItem as _SubsqntCreditMemoReqItem on $projection.CustomerReturn = _SubsqntCreditMemoReqItem.PrecedingDocument
and $projection.CustomerReturnItem = _SubsqntCreditMemoReqItem.PrecedingDocumentItem
association [0..*] to C_RelatedBillingDocumentItem as _SubsqntBillingDocumentItem on $projection.CustomerReturn = _SubsqntBillingDocumentItem.PrecedingDocument
and $projection.CustomerReturnItem = _SubsqntBillingDocumentItem.PrecedingDocumentItem
association [0..*] to C_SubsqntSOWithoutChargeItem as _SubsqntSOWithoutChargeItem on $projection.CustomerReturn = _SubsqntSOWithoutChargeItem.PrecedingDocument
and $projection.CustomerReturnItem = _SubsqntSOWithoutChargeItem.PrecedingDocumentItem
association [0..1] to I_SalesDocItemCompletePartner as _ShipToParty on $projection.CustomerReturn = _ShipToParty.SalesDocument
and $projection.CustomerReturnItem = _ShipToParty.SalesDocumentItem
and _ShipToParty.PartnerFunction = 'WE'
association [0..1] to I_FollowUpActivityText as _FollowUpActivityText on $projection.CustRetItmFollowUpActivity = _FollowUpActivityText.CustRetItmFollowUpActivity
//Extension Association
association [1] to E_SalesDocumentItemBasic as _Extension on $projection.CustomerReturn = _Extension.SalesDocument
and $projection.CustomerReturnItem = _Extension.SalesDocumentItem
{
@Search.defaultSearchElement: true
@Search.ranking: #HIGH
key Item.CustomerReturn,
@Search.defaultSearchElement: true
@Search.ranking: #HIGH
@EndUserText.label: 'Item'
@UI:{
lineItem: { position: 10 },
dataPoint: { description: 'Item', criticality: '0' },
textArrangement: #TEXT_SEPARATE
}
key Item.CustomerReturnItem,
@UI.hidden:true
Item.CustomerReturnItemText,
@ObjectModel.text.element: ['ShipToPartyName']
@Consumption.semanticObject: 'Customer'
@UI:{
fieldGroup:{ qualifier: 'ShipToPartyItem', position: 10, importance: #HIGH, label: 'Ship-To Party' }
}
_ShipToParty.Customer as ShipToParty,
@Semantics.text:true
@UI.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_CUSTRET_UI_PARTNER_UTIL'
cast('' as ad_namtext ) as ShipToPartyName,
//_ShipToParty._DfltAddrRprstn.AddresseeFullName as FullName,
@UI:{
fieldGroup:{ qualifier: 'StatusItem1', position: 10, importance: #HIGH },
lineItem:{ position: 50, importance: #HIGH, type: #STANDARD },
textArrangement: #TEXT_ONLY
}
@ObjectModel.foreignKey.association: '_SDProcessStatus'
Item.SDProcessStatus,
@UI:{
fieldGroup:{qualifier: 'StatusItem1', position: 20 ,importance: #HIGH, label:'Rejection Status'} ,
lineItem: {position: 80, importance: #HIGH, type: #STANDARD, label: 'Rejection Status'},
textArrangement: #TEXT_ONLY
}
Item._SDDocumentRejectionStatus._Text[1: Language=$session.system_language].SDDocumentRejectionStatusDesc as SDDocumentRejectionStatusDesc,
@UI: {
fieldGroup:{ qualifier: 'StatusItem1', position: 30 ,importance: #HIGH, label:'Reason for Rejection' },
lineItem:{ position: 60, importance: #HIGH, type: #STANDARD, label: 'Reason for Rejection' }
}
cast(Item._SalesDocumentRjcnReason._Text[1: Language=$session.system_language].SalesDocumentRjcnReasonName as bezei40) as SalesDocumentRjcnReasonName,
@UI:{
fieldGroup:{ qualifier: 'StatusItem2', position: 10, importance: #HIGH },
textArrangement: #TEXT_ONLY
}
@ObjectModel.foreignKey.association: '_DeliveryStatus'
Item.DeliveryStatus,
@UI:{
fieldGroup:{ qualifier: 'StatusItem2', position: 20, importance: #HIGH, label:'Billing Status' },
textArrangement: #TEXT_ONLY
}
@ObjectModel.foreignKey.association: '_OrderRelatedBillingStatus'
Item.OrderRelatedBillingStatus,
//Header
@Semantics.currencyCode: true
Item.TransactionCurrency,
@Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
@UI:{
dataPoint:{ title: 'Return Quantity' },
lineItem: [{ position: 30, importance: #HIGH, label: 'Return Quantity', type: #STANDARD }]
}
@DefaultAggregation: #NONE
Item.OrderQuantity,
@Semantics.unitOfMeasure: true
Item.OrderQuantityUnit,
@Semantics.amount.currencyCode: 'TransactionCurrency'
@UI:{
dataPoint:[{ description: 'Net Amount' }],
lineItem:[{ position: 70, importance: #HIGH, type: #STANDARD }]
}
@DefaultAggregation: #NONE
Item.NetAmount,
@UI:{
identification:{ position:10, importance: #HIGH },
lineItem:[{ position:20, importance: #HIGH, type: #STANDARD }]
}
@Consumption.semanticObject: 'Material'
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
cast(Item.Material as productnumber preserving type) as Material,
@UI:{
identification:{ position:20, importance: #HIGH }
}
Item.MaterialByCustomer,
@UI:{
identification:{ position:30, importance: #HIGH }
}
cast(Item.MaterialGroup as productgroup preserving type) as MaterialGroup,
@UI:{
identification:{ position:40, importance: #HIGH }
}
@Consumption.semanticObject: 'Batch'
Item.Batch,
@UI.fieldGroup:[{ qualifier: 'GeneralBlock2', position:10, importance: #HIGH }]
Item.CustRetMatlAuthzn,
@UI:{
fieldGroup:[{ qualifier:'GeneralBlock2', position:20, importance: #HIGH }]
}
@ObjectModel.foreignKey.association: '_ProductionPlant'
Item.Plant as ProductionPlant,
@UI: {
fieldGroup:[{ qualifier: 'GeneralBlock2', position:30, importance: #HIGH, label: 'Receiving Point' }]
}
Item.ShippingPoint,
@UI:{
fieldGroup:{ qualifier: 'GeneralBlock3', position:10, importance: #HIGH },
lineItem:[{ position: 40, importance: #HIGH, type: #STANDARD, label: 'Return Reason'}]
}
@UI.textArrangement: #TEXT_FIRST
@ObjectModel.text.element: ['ReturnReasonName']
Item.ReturnReason,
@UI.hidden:true
cast (case when Item._CustomerReturn._CustomerReturnType.RetsMgmtIsActive = 'X'
then
Item._ReturnReason._Text[1: Language=$session.system_language ].ReturnReasonName
else
Item._CustomerReturn._SDDocumentReason._Text[1: Language=$session.system_language].SDDocumentReasonText
end as farp_return_reason) as ReturnReasonName,
@UI:{
fieldGroup:[{ qualifier: 'GeneralBlock3', position: 20,importance: #HIGH, label: 'Reference Document' }]
}
@EndUserText.label: 'Reference Document'
case when Item.ReferenceSDDocument = ''
then ''
else
concat_with_space(Item._ReferenceSDDocumentCategory._Text[1: Language=$session.system_language].SDDocumentCategoryName, ltrim(Item.ReferenceSDDocument,'0'), 1)
end as ReferenceSDDocument,
@UI:{
fieldGroup:[{ qualifier: 'GeneralBlock3', position:30, importance: #HIGH, label: 'Reference Item' }]
}
@EndUserText.label: 'Reference Document Item'
case when Item.ReferenceSDDocumentItem = '000000'
then ''
else ltrim(Item.ReferenceSDDocumentItem, '0')
end as ReferenceSDDocumentItem,
Item.HigherLevelItem as HigherLevelItem,
// Return specific fields
@UI.fieldGroup:[{ qualifier: 'ReturnsSpecific', position:10, importance: #HIGH }]
@UI.textArrangement: #TEXT_FIRST
@ObjectModel.text.element: ['CustRetItmFollowUpActivityDesc']
Item.CustRetItmFollowUpActivity,
@UI.hidden:true
_FollowUpActivityText[1: Language=$session.system_language ].CustRetItmFollowUpActivityDesc,
@UI.fieldGroup:[{ qualifier: 'ReturnsSpecific', position:20, importance: #HIGH }]
@ObjectModel.text.element: ['ReturnsRefundTypeName']
@UI.textArrangement: #TEXT_ONLY
Item.ReturnsRefundType,
@UI.hidden:true
Item._ReturnsRefundType._Text[1: Language=$session.system_language ].ReturnsRefundTypeName,
@UI.fieldGroup:[{ qualifier: 'ReturnsSpecific', position:30, importance: #HIGH }]
@UI.textArrangement: #TEXT_FIRST
@ObjectModel.text.element: ['ReturnsRefundProcgModeDesc']
cast(Item.ReturnsRefundProcgMode as msr_refund_control preserving type) as ReturnsRefundProcgMode,
@UI.hidden:true
Item._ReturnsRefundProcgMode.ReturnsRefundProcgModeDesc,
@UI.fieldGroup:[{ qualifier: 'ReturnsSpecific', position:40, importance: #HIGH }]
@ObjectModel.text.element: ['ReturnsRefundExtentDesc']
@UI.textArrangement: #TEXT_FIRST
Item.ReturnsRefundExtent,
@UI.hidden:true
Item._ReturnsRefundExtent._Text[1: Language=$session.system_language ].ReturnsRefundExtentDesc,
@Semantics.booleanIndicator
@UI.hidden: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_VE'
cast('' as boole_d ) as RetsMgmtIsNotActive,
//Associations
_CustomerReturn,
_Material,
_SDDocumentPartnerCard,
_SubsqntCustRetDeliveryItem,
_SubsqntCreditMemoReqItem,
_SubsqntBillingDocumentItem,
_SubsqntSOWithoutChargeItem,
_MaterialGroup,
_Plant as _ProductionPlant,
_SDProcessStatus,
_DeliveryStatus,
_ShippingPoint,
_OrderRelatedBillingStatus,
_ShipToParty
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMERRETURNENHANCED",
"I_CUSTOMERRETURNITEMENHANCED",
"I_FOLLOWUPACTIVITYTEXT",
"I_RETURNREASON",
"I_RETURNREASONTEXT",
"I_RETURNSREFUNDEXTENT",
"I_RETURNSREFUNDEXTENTTEXT",
"I_RETURNSREFUNDPROCGMODEACTIVE",
"I_RETURNSREFUNDTYPE",
"I_RETURNSREFUNDTYPETEXT",
"I_SALESDOCITEMCOMPLETEPARTNER",
"I_SALESDOCUMENTRJCNREASON",
"I_SALESDOCUMENTRJCNREASONTEXT",
"I_SALESDOCUMENTTYPE",
"I_SDDOCUMENTCATEGORY",
"I_SDDOCUMENTCATEGORYTEXT",
"I_SDDOCUMENTREASON",
"I_SDDOCUMENTREASONTEXT",
"I_SDDOCUMENTREJECTIONSTATUS",
"I_SDDOCUMENTREJECTIONSTATUST"
],
"ASSOCIATED":
[
"C_CUSTOMERRETURNFS",
"C_RELATEDBILLINGDOCUMENTITEM",
"C_SDDOCUMENTPARTNERCARD",
"C_SUBSQNTCREDITMEMOREQITEM",
"C_SUBSQNTCUSTRETDELIVERYITEM",
"C_SUBSQNTSOWITHOUTCHARGEITEM",
"E_SALESDOCUMENTITEMBASIC",
"I_DELIVERYSTATUS",
"I_FOLLOWUPACTIVITYTEXT",
"I_MATERIAL",
"I_MATERIALGROUP",
"I_ORDERRELATEDBILLINGSTATUS",
"I_PLANT",
"I_SALESDOCITEMCOMPLETEPARTNER",
"I_SDPROCESSSTATUS",
"I_SHIPPINGPOINT"
],
"BASE":
[
"I_CUSTOMERRETURNITEMENHANCED"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/