C_CustomerReturn

DDL: C_CUSTOMERRETURN Type: view CONSUMPTION

Customer Returns

C_CustomerReturn is a Consumption CDS View that provides data about "Customer Returns" in SAP S/4HANA. It reads from 1 data source (I_CustomerReturn) and exposes 103 fields with key field CustomerReturn. It has 32 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_CustomerReturn CustomerReturn from

Associations (32)

CardinalityTargetAliasCondition
[0..1] C_CustomerReturnRefundSts _CustRetRfndStatus $projection.CustomerReturn = _CustRetRfndStatus.CustomerReturn
[0..1] I_CustReturnSubsqntProcgSts _ReldForSubsqntProcgStatus $projection.CustomerReturn = _ReldForSubsqntProcgStatus.CustomerReturn
[0..1] C_Overallsddocumentrjcnstatus _OverallSDDocumentRjcnStsVH $projection.OverallSDDocumentRejectionSts = _OverallSDDocumentRjcnStsVH.OverallSDDocumentRejectionSts
[0..1] C_ShipToPartyValueHelp _ShipToPartyVH $projection.ShipToParty = _ShipToPartyVH.Customer and $projection.addressid = _ShipToPartyVH.AddressID
[0..1] C_EmployeeValueHelp _EmplRespVH $projection.ResponsibleEmployee = _EmplRespVH.PersonnelNumber
[0..*] C_ReturnsReferenceDocVH _ReferenceDocumentVH $projection.ReferenceSDDocument = _ReferenceDocumentVH.ReferenceSDDocument
[0..1] C_RetsRefDocCategoryValueHelp _RetsRefDocCategoryVH $projection.ReferenceSDDocumentCategory = _RetsRefDocCategoryVH.SDDocumentCategory
[0..1] C_SalesDocumentUserVH _CreatedByVH $projection.CreatedByUser = _CreatedByVH.UserID
[0..1] C_SalesDocumentUserVH _ChangedByVH $projection.LastChangedByUser = _ChangedByVH.UserID
[0..1] C_CustRetReleaseStatusVH _ReleaseStatusVH $projection.OvrlReldForSubsqntProcgSts = _ReleaseStatusVH.CustRetReleaseStatus
[0..1] C_CustRetRefundProgressVH _RefundProgressVH $projection.CustReturnRefundStatus = _RefundProgressVH.CustRetRefundProgress
[0..1] I_RetsMgmtProcgStatus _ProcessingStatusVH $projection.RetsMgmtProcessingStatus = _ProcessingStatusVH.RetsMgmtProcessingStatus
[0..1] I_RetsMgmtProcgStatus _LogisticalStatusVH $projection.RetsMgmtLogProcgStatus = _LogisticalStatusVH.RetsMgmtProcessingStatus
[0..1] I_RetsMgmtCompnProcgStatus _RefundStatusVH $projection.RetsMgmtCompnProcgStatus = _RefundStatusVH.RetsMgmtCompnProcgStatus
[0..1] C_SalesOfficeValueHelp _SalesOfficeVH $projection.SalesOffice = _SalesOfficeVH.SalesOffice and $projection.SalesOrganization = _SalesOfficeVH.SalesOrganization and $projection.DistributionChannel = _SalesOfficeVH.DistributionChannel and $projection.OrganizationDivision = _SalesOfficeVH.OrganizationDivision
[0..1] C_SalesGroupValueHelp _SalesGroupVH $projection.SalesGroup = _SalesGroupVH.SalesGroup and $projection.SalesOffice = _SalesGroupVH.SalesOffice
[0..1] C_CustomerReturnTypeVH _CustomerReturnTypeVH $projection.CustomerReturnType = _CustomerReturnTypeVH.CustomerReturnType
[0..1] C_Q2CCustomerQuickView _SoldToPartyVH $projection.SoldToParty = _SoldToPartyVH.Customer
[0..1] C_Dischannelvaluehelp _DistributionChannelVH $projection.SalesOrganization = _DistributionChannelVH.SalesOrganization and $projection.DistributionChannel = _DistributionChannelVH.DistributionChannel
[0..1] C_OrgDivisionValueHelp _DivisionVH $projection.SalesOrganization = _DivisionVH.SalesOrganization and $projection.DistributionChannel = _DivisionVH.DistributionChannel and $projection.OrganizationDivision = _DivisionVH.Division
[0..1] I_CustRetReleaseStatusText _ReleaseStatus $projection.OvrlReldForSubsqntProcgSts = _ReleaseStatus.CustRetReleaseStatus and _ReleaseStatus.Language = $session.system_language
[0..1] I_CustRetRefundPrgrsStatusText _RefundProgress $projection.CustReturnRefundStatus = _RefundProgress.CustRetRefundProgress and _RefundProgress.Language = $session.system_language
[0..1] I_RetsMgmtProcgStatusText _RetsMgmtProcgStatusText $projection.RetsMgmtProcessingStatus = _RetsMgmtProcgStatusText.RetsMgmtProcessingStatus and _RetsMgmtProcgStatusText.Language = $session.system_language
[0..1] I_RetsMgmtProcgStatusText _RetsMgmtLogProcgStatusText $projection.RetsMgmtLogProcgStatus = _RetsMgmtLogProcgStatusText.RetsMgmtProcessingStatus and _RetsMgmtLogProcgStatusText.Language = $session.system_language
[0..1] I_RetsMgmtCompnProcgStatusText _RetsMgmtCompnProcgStatusText $projection.RetsMgmtCompnProcgStatus = _RetsMgmtCompnProcgStatusText.RetsMgmtCompnProcgStatus and _RetsMgmtCompnProcgStatusText.Language = $session.system_language
[0..1] I_OverallSDProcessStatusText _OverallSDProcessStatusText $projection.OverallSDProcessStatus = _OverallSDProcessStatusText.OverallSDProcessStatus and _OverallSDProcessStatusText.Language = $session.system_language
[0..1] I_SalesDocumentTypeText _SalesDocumentTypeText $projection.CustomerReturnType = _SalesDocumentTypeText.SalesDocumentType and _SalesDocumentTypeText.Language = $session.system_language
[0..1] I_SDDocumentCategoryText _SDDocumentCategoryText $projection.ReferenceSDDocumentCategory = _SDDocumentCategoryText.SDDocumentCategory and _SDDocumentCategoryText.Language = $session.system_language
[0..1] I_PersonWorkAgreement_1 _Employment $projection.ResponsibleEmployee = _Employment.PersonWorkAgreement
[0..1] C_CustRetProcgStatus _RetsMgmtProcessWthProcgSts $projection.CustomerReturn = _RetsMgmtProcessWthProcgSts.CustomerReturn
[0..*] C_SalesDocumentItemWl _SalesDocumentItemWl $projection.CustomerReturn = _SalesDocumentItemWl.SalesDocument
[0..1] E_SalesDocumentBasic _Extension $projection.CustomerReturn = _Extension.SalesDocument

Annotations (16)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Customer Returns view
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
AbapCatalog.sqlViewName CCUSTRET view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
ObjectModel.text.control #ASSOCIATED_TEXT_UI_HIDDEN view
ObjectModel.compositionRoot true view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
Metadata.allowExtensions true view
Search.searchable true view
Consumption.semanticObject CustomerReturn view

Fields (103)

KeyFieldSource TableSource FieldDescription
KEY CustomerReturn
CustomerReturnType
RetsMgmtIsActive _CustomerReturnType RetsMgmtIsActive
SalesDocumentTypeName _SalesDocumentTypeText SalesDocumentTypeName
SoldToParty I_CustomerReturn SoldToParty
SoldToPartyName
OrganizationBPName1
OrganizationBPName2
CustomerClassification _SoldToParty CustomerClassification Customer Classification
SoldToPartyAddressID
ReferenceSDDocument I_CustomerReturn ReferenceSDDocument
ReferenceSDDocumentCategory I_CustomerReturn ReferenceSDDocumentCategory Preceding Doc. Categ.
ReferenceDocumentCategoryName
ReturnReason
CustReturnRefundStatus
CustReturnRefundStatusDesc
ReturnsOrderReason
SDDocumentReasonText
RetsMgmtLogProcgStatus
RetsMgmtLogProcgStatusDesc
OverallDeliveryStatus I_CustomerReturn OverallTotalDeliveryStatus
RetsMgmtCompnProcgStatus
RetsMgmtCompnProcgStatusDesc
OverallOrdReltdBillgStatus I_CustomerReturn OverallOrdReltdBillgStatus
RetsMgmtProcessingStatus
RetsMgmtProcessingStatusDesc
OverallSDProcessStatus I_CustomerReturn OverallSDProcessStatus
OvrlReldForSubsqntProcgSts
OvrlReldForSubsqntProcgStsDesc
OverallSDDocumentRejectionSts I_CustomerReturn OverallSDDocumentRejectionSts
WorkflowIsExternal
SalesDocApprovalStatus I_CustomerReturn SalesDocApprovalStatus
SalesDocApprovalStatusDesc
int1asCustRetApprvlStsCriticality
CustomerReturnDate I_CustomerReturn CustomerReturnDate
CreationDate I_CustomerReturn CreationDate
LastChangeDateendasLastChangeDate
LastChangeDateTime I_CustomerReturn LastChangeDateTime
CreatedByUser CreatedByUser
CreatedByUserName _CreatedByVH UserDescription
LastChangedByUser LastChangedByUser
LastChangedByUserName _ChangedByVH UserDescription
PurchaseOrderByCustomer I_CustomerReturn PurchaseOrderByCustomer
DivisionName1astxt_vtrberasSalesAreaDesc
OrganizationDivisionasSalesArea
OrganizationDivision I_CustomerReturn OrganizationDivision
SalesOrganization I_CustomerReturn SalesOrganization
DistributionChannel I_CustomerReturn DistributionChannel
SalesOffice I_CustomerReturn SalesOffice
SalesGroup I_CustomerReturn SalesGroup
ResponsibleEmployee
ResponsibleEmployeeName
TotalNetAmount I_CustomerReturn TotalNetAmount
TransactionCurrency I_CustomerReturn TransactionCurrency
ShipToParty
ShipToPartyName
AddressID
RetsMgmtProcess RetsMgmtProcess
_SalesDocumentItemWl _SalesDocumentItemWl
_OverallTotalDeliveryStatus _OverallTotalDeliveryStatus
_OverallSDProcessStatus _OverallSDProcessStatus
_OverallOrdReltdBillgStatus _OverallOrdReltdBillgStatus
_RetsMgmtProcgStatusText _RetsMgmtProcgStatusText
_RetsMgmtLogProcgStatusText _RetsMgmtLogProcgStatusText
_OverallSDProcessStatusText _OverallSDProcessStatusText
_ReleaseStatus _ReleaseStatus
_ReldForSubsqntProcgStatus _ReldForSubsqntProcgStatus
_CustomerReturnType _CustomerReturnType
_ReferenceSDDocumentCategory _ReferenceSDDocumentCategory
_RetsMgmtCompnProcgStatusText _RetsMgmtCompnProcgStatusText
_RefundProgress _RefundProgress
_SalesDocumentTypeText _SalesDocumentTypeText
_SDDocumentCategoryText _SDDocumentCategoryText
_OrganizationDivision _OrganizationDivision
_DistributionChannel _DistributionChannel
_SalesOrganization _SalesOrganization
_Employment _Employment
_CustRetRfndStatus _CustRetRfndStatus
_SoldToParty _SoldToParty
_CustomerClassification _SoldToParty _CustomerClassification
_Partner _Partner
_SalesDocApprovalStatus _SalesDocApprovalStatus
_EmplRespVH _EmplRespVH
_ShipToPartyVH _ShipToPartyVH
_OverallSDDocumentRjcnStsVH _OverallSDDocumentRjcnStsVH
_OverallSDDocumentRejectionSts _OverallSDDocumentRejectionSts
_LogisticalStatusVH _LogisticalStatusVH
_ProcessingStatusVH _ProcessingStatusVH
_RefundProgressVH _RefundProgressVH
_ReleaseStatusVH _ReleaseStatusVH
_RefundStatusVH _RefundStatusVH
_ReferenceDocumentVH _ReferenceDocumentVH
_CreatedByVH _CreatedByVH
_ChangedByVH _ChangedByVH
_SalesOfficeVH _SalesOfficeVH
_SalesGroupVH _SalesGroupVH
_CustomerReturnTypeVH _CustomerReturnTypeVH
_SoldToPartyVH _SoldToPartyVH
_DivisionVH _DivisionVH
_DistributionChannelVH _DistributionChannelVH
_RetsRefDocCategoryVH _RetsRefDocCategoryVH
_TransactionCurrency _TransactionCurrency
_RetsMgmtProcessWthProcgSts _RetsMgmtProcessWthProcgSts
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Customer Returns'
@VDM.viewType: #CONSUMPTION
@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #NOT_REQUIRED
}
@AbapCatalog: {
  sqlViewName: 'CCUSTRET',
  preserveKey: true,
  compiler.compareFilter: true
}
@ObjectModel.text.control: #ASSOCIATED_TEXT_UI_HIDDEN
@ObjectModel: {
  compositionRoot: true,
  semanticKey: ['CustomerReturn'],
  updateEnabled,
  usageType: {
    dataClass:      #MIXED,
    serviceQuality: #C,
    sizeCategory:   #L
  }
}
@Metadata.allowExtensions: true
@Search.searchable: true

@UI.presentationVariant:{
  sortOrder: [
      { by: 'LastChangeDate', direction: #DESC },
      { by: 'CustomerReturn', direction: #DESC } ]
}
@Consumption.semanticObject: 'CustomerReturn'

define view C_CustomerReturn
  as select from I_CustomerReturn as CustomerReturn

  association [0..1] to C_CustomerReturnRefundSts      as _CustRetRfndStatus            on  $projection.CustomerReturn = _CustRetRfndStatus.CustomerReturn
  association [0..1] to I_CustReturnSubsqntProcgSts    as _ReldForSubsqntProcgStatus    on  $projection.CustomerReturn = _ReldForSubsqntProcgStatus.CustomerReturn

  //Value Help

  association [0..1] to C_Overallsddocumentrjcnstatus  as _OverallSDDocumentRjcnStsVH   on  $projection.OverallSDDocumentRejectionSts = _OverallSDDocumentRjcnStsVH.OverallSDDocumentRejectionSts
  association [0..1] to C_ShipToPartyValueHelp         as _ShipToPartyVH                on  $projection.ShipToParty = _ShipToPartyVH.Customer
                                                                                        and $projection.addressid   = _ShipToPartyVH.AddressID
  association [0..1] to C_EmployeeValueHelp            as _EmplRespVH                   on  $projection.ResponsibleEmployee = _EmplRespVH.PersonnelNumber
  association [0..*] to C_ReturnsReferenceDocVH        as _ReferenceDocumentVH          on  $projection.ReferenceSDDocument = _ReferenceDocumentVH.ReferenceSDDocument
  association [0..1] to C_RetsRefDocCategoryValueHelp  as _RetsRefDocCategoryVH         on  $projection.ReferenceSDDocumentCategory = _RetsRefDocCategoryVH.SDDocumentCategory

  association [0..1] to C_SalesDocumentUserVH          as _CreatedByVH                  on  $projection.CreatedByUser = _CreatedByVH.UserID
  association [0..1] to C_SalesDocumentUserVH          as _ChangedByVH                  on  $projection.LastChangedByUser = _ChangedByVH.UserID

  association [0..1] to C_CustRetReleaseStatusVH       as _ReleaseStatusVH              on  $projection.OvrlReldForSubsqntProcgSts = _ReleaseStatusVH.CustRetReleaseStatus
  association [0..1] to C_CustRetRefundProgressVH      as _RefundProgressVH             on  $projection.CustReturnRefundStatus = _RefundProgressVH.CustRetRefundProgress
  association [0..1] to I_RetsMgmtProcgStatus          as _ProcessingStatusVH           on  $projection.RetsMgmtProcessingStatus = _ProcessingStatusVH.RetsMgmtProcessingStatus
  association [0..1] to I_RetsMgmtProcgStatus          as _LogisticalStatusVH           on  $projection.RetsMgmtLogProcgStatus = _LogisticalStatusVH.RetsMgmtProcessingStatus
  association [0..1] to I_RetsMgmtCompnProcgStatus     as _RefundStatusVH               on  $projection.RetsMgmtCompnProcgStatus = _RefundStatusVH.RetsMgmtCompnProcgStatus
  association [0..1] to C_SalesOfficeValueHelp         as _SalesOfficeVH                on  $projection.SalesOffice          = _SalesOfficeVH.SalesOffice
                                                                                        and $projection.SalesOrganization    = _SalesOfficeVH.SalesOrganization
                                                                                        and $projection.DistributionChannel  = _SalesOfficeVH.DistributionChannel
                                                                                        and $projection.OrganizationDivision = _SalesOfficeVH.OrganizationDivision
  association [0..1] to C_SalesGroupValueHelp          as _SalesGroupVH                 on  $projection.SalesGroup  = _SalesGroupVH.SalesGroup
                                                                                        and $projection.SalesOffice = _SalesGroupVH.SalesOffice
  association [0..1] to C_CustomerReturnTypeVH         as _CustomerReturnTypeVH         on  $projection.CustomerReturnType = _CustomerReturnTypeVH.CustomerReturnType
  association [0..1] to C_Q2CCustomerQuickView         as _SoldToPartyVH                on  $projection.SoldToParty = _SoldToPartyVH.Customer
  association [0..1] to C_Dischannelvaluehelp          as _DistributionChannelVH        on  $projection.SalesOrganization   = _DistributionChannelVH.SalesOrganization
                                                                                        and $projection.DistributionChannel = _DistributionChannelVH.DistributionChannel
  association [0..1] to C_OrgDivisionValueHelp         as _DivisionVH                   on  $projection.SalesOrganization    = _DivisionVH.SalesOrganization
                                                                                        and $projection.DistributionChannel  = _DivisionVH.DistributionChannel
                                                                                        and $projection.OrganizationDivision = _DivisionVH.Division
                                                                                                                                                                                                                                                                              
  //Text Association

  //association [0..*] to I_OverallSDDocumentRjcnStsVH   as _OverallSDDocumentRejectionSts on $projection.OverallSDDocumentRejectionSts = _OverallSDDocumentRejectionSts.OverallSDDocumentRejectionSts

  association [0..1] to I_CustRetReleaseStatusText     as _ReleaseStatus                on  $projection.OvrlReldForSubsqntProcgSts = _ReleaseStatus.CustRetReleaseStatus
                                                                                        and _ReleaseStatus.Language                = $session.system_language
  association [0..1] to I_CustRetRefundPrgrsStatusText as _RefundProgress               on  $projection.CustReturnRefundStatus = _RefundProgress.CustRetRefundProgress
                                                                                        and _RefundProgress.Language           = $session.system_language
  association [0..1] to I_RetsMgmtProcgStatusText      as _RetsMgmtProcgStatusText      on  $projection.RetsMgmtProcessingStatus = _RetsMgmtProcgStatusText.RetsMgmtProcessingStatus
                                                                                        and _RetsMgmtProcgStatusText.Language    = $session.system_language
  association [0..1] to I_RetsMgmtProcgStatusText      as _RetsMgmtLogProcgStatusText   on  $projection.RetsMgmtLogProcgStatus   = _RetsMgmtLogProcgStatusText.RetsMgmtProcessingStatus
                                                                                        and _RetsMgmtLogProcgStatusText.Language = $session.system_language
  association [0..1] to I_RetsMgmtCompnProcgStatusText as _RetsMgmtCompnProcgStatusText on  $projection.RetsMgmtCompnProcgStatus   = _RetsMgmtCompnProcgStatusText.RetsMgmtCompnProcgStatus
                                                                                        and _RetsMgmtCompnProcgStatusText.Language = $session.system_language
  association [0..1] to I_OverallSDProcessStatusText   as _OverallSDProcessStatusText   on  $projection.OverallSDProcessStatus   = _OverallSDProcessStatusText.OverallSDProcessStatus
                                                                                        and _OverallSDProcessStatusText.Language = $session.system_language
  association [0..1] to I_SalesDocumentTypeText        as _SalesDocumentTypeText        on  $projection.CustomerReturnType  = _SalesDocumentTypeText.SalesDocumentType
                                                                                        and _SalesDocumentTypeText.Language = $session.system_language
  association [0..1] to I_SDDocumentCategoryText       as _SDDocumentCategoryText       on  $projection.ReferenceSDDocumentCategory = _SDDocumentCategoryText.SDDocumentCategory
                                                                                        and _SDDocumentCategoryText.Language        = $session.system_language

  association [0..1] to I_PersonWorkAgreement_1        as _Employment                   on  $projection.ResponsibleEmployee = _Employment.PersonWorkAgreement
  association [0..1] to C_CustRetProcgStatus           as _RetsMgmtProcessWthProcgSts   on  $projection.CustomerReturn = _RetsMgmtProcessWthProcgSts.CustomerReturn
 
  //Enable Material Search

  association [0..*] to C_SalesDocumentItemWl          as _SalesDocumentItemWl          on  $projection.CustomerReturn = _SalesDocumentItemWl.SalesDocument

  //Extensibility

  association [0..1] to E_SalesDocumentBasic           as _Extension                    on  $projection.CustomerReturn = _Extension.SalesDocument

  
{
      @Search.defaultSearchElement: true
      @Search.ranking: #HIGH
      @Search.fuzzinessThreshold: 0.9
      @Consumption.semanticObject: 'CustomerReturn'
      @ObjectModel.text.element: ['SalesDocumentTypeName']
      @Consumption.valueHelpDefinition: [{entity: {name: 'I_CustomerReturnStdVH', element: 'CustomerReturn' } }]
  key cast (CustomerReturn.CustomerReturn as msr_returns_order preserving type) as CustomerReturn,

      @ObjectModel.text.association: '_SalesDocumentTypeText'
      @Consumption.valueHelpDefinition: [{association: '_CustomerReturnTypeVH'}]
      cast (CustomerReturn.CustomerReturnType as msr_returns_order_type preserving type) as CustomerReturnType,

      @UI.hidden: true
      _CustomerReturnType.RetsMgmtIsActive                                          as RetsMgmtIsActive,

      @UI.hidden: true
      _SalesDocumentTypeText.SalesDocumentTypeName,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Consumption: {
        semanticObject: 'Customer',
         valueHelpDefinition: [{ entity: { name: 'D_Q2CCustomerCVH',
                                           element: 'Customer' } }]
      }
      @ObjectModel.text.element:  [ 'SoldToPartyName' ]
      CustomerReturn.SoldToParty,
      @UI.hidden: true
      @ObjectModel.readOnly
      @Semantics.text:true
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_CUSTRET_UI_PARTNER_UTIL'
      cast('' as ad_namtext )                                                       as SoldToPartyName,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @UI.hidden: true
      CustomerReturn._SoldToParty.OrganizationBPName1,
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @UI.hidden: true
      CustomerReturn._SoldToParty.OrganizationBPName2,

      @EndUserText.label: 'Customer Classification'
      @Consumption.valueHelpDefinition: [{association: '_CustomerClassification'}]
      _SoldToParty.CustomerClassification,

      @UI.hidden: true
      CustomerReturn._Partner[PartnerFunction='AG'].AddressID                       as SoldToPartyAddressID,

      @Consumption.valueHelpDefinition: [{association: '_ReferenceDocumentVH'}]
      CustomerReturn.ReferenceSDDocument,

      //      @Consumption.valueHelpDefinition: [{

      //        entity: { name:    'C_RetsRefDocCategoryValueHelp',

      //                  element: 'SDDocumentCategory' }

      //      }]

      @ObjectModel.text.association: '_SDDocumentCategoryText'
      @Consumption.valueHelpDefinition: [{association: '_RetsRefDocCategoryVH'}]
//      @ObjectModel.text.element: ['ReferenceDocumentCategoryName']

      @EndUserText.label: 'Preceding Doc. Categ.'
      @Search.defaultSearchElement: true
      CustomerReturn.ReferenceSDDocumentCategory,

      cast (_SDDocumentCategoryText.SDDocumentCategoryName as sd_ref_doc_cat_desc)  as ReferenceDocumentCategoryName,

      cast('' as msr_ret_reason_text )                                              as ReturnReason,

      // Status Fields

      @ObjectModel.readOnly
      @Consumption.valueHelpDefinition: [{association: '_RefundProgressVH'}]
      //      @ObjectModel.text.association: '_RefundProgress'

      //      cast(_CustRetRfndStatus.CustReturnRefundStatus as refund_progress)            as CustReturnRefundStatus,

      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @ObjectModel.text.element: ['CustReturnRefundStatusDesc']
      @ObjectModel.filter.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      @ObjectModel.sort.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      cast('' as refund_progress)                                                   as CustReturnRefundStatus,
      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @UI.hidden: true
      cast('' as val_text)                                                          as CustReturnRefundStatusDesc,

      @Consumption.valueHelpDefinition: [{
        entity: { name:    'C_ReturnsOrderReasonVH',
                  element: 'ReturnsOrderReason' }
      }]
      @ObjectModel.text.element: ['SDDocumentReasonText']
      cast (CustomerReturn.SDDocumentReason as returns_order_reason)                as ReturnsOrderReason,
      @UI.hidden: true
      _SDDocumentReason._Text[1: Language=$session.system_language].SDDocumentReasonText,

      @ObjectModel.readOnly
      @Search.defaultSearchElement: false
      @Search.fuzzinessThreshold: 0.8
      @Consumption.valueHelpDefinition: [{association: '_LogisticalStatusVH'}]
      //      @ObjectModel.text.association: '_RetsMgmtLogProcgStatusText'

      //      cast(coalesce(CustomerReturn._RetsMgmtProcess._RetsMgmtProcessingStatus.RetsMgmtLogProcgStatus, '') as return_log_procg_status) as RetsMgmtLogProcgStatus,

      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @ObjectModel.text.element: ['RetsMgmtLogProcgStatusDesc']
      @ObjectModel.filter.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      @ObjectModel.sort.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      cast('' as return_log_procg_status)                                           as RetsMgmtLogProcgStatus,
      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @UI.hidden: true
      cast('' as val_text)                                                          as RetsMgmtLogProcgStatusDesc,

      @Consumption.valueHelpDefinition: [{association: '_OverallTotalDeliveryStatus'}]
      CustomerReturn.OverallTotalDeliveryStatus                                     as OverallDeliveryStatus,

      @Consumption.valueHelpDefinition: [{association: '_RefundStatusVH'}]
      //      @ObjectModel.text.association: '_RetsMgmtCompnProcgStatusText'

      //      cast(coalesce(CustomerReturn._RetsMgmtProcess._RetsMgmtProcessingStatus.RetsMgmtCompnProcgStatus, '') as msr_fin_status)        as RetsMgmtCompnProcgStatus,

      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @ObjectModel.text.element: ['RetsMgmtCompnProcgStatusDesc']
      @ObjectModel.filter.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      @ObjectModel.sort.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      cast('' as msr_fin_status)                                                    as RetsMgmtCompnProcgStatus,
      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @UI.hidden: true
      cast('' as val_text)                                                          as RetsMgmtCompnProcgStatusDesc,

      @Consumption.valueHelpDefinition: [{association: '_OverallOrdReltdBillgStatus'}]
      CustomerReturn.OverallOrdReltdBillgStatus,

      @Consumption.valueHelpDefinition: [{association: '_ProcessingStatusVH'}]
      //      @ObjectModel.text.association: '_RetsMgmtProcgStatusText'

      //      CustomerReturn._RetsMgmtProcess._RetsMgmtProcessingStatus.RetsMgmtProcessingStatus,

      @ObjectModel.readOnly
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @ObjectModel.text.element: ['RetsMgmtProcessingStatusDesc']
      @ObjectModel.filter.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      @ObjectModel.sort.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      cast('' as msr_proc_status)                                                   as RetsMgmtProcessingStatus,
      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @UI.hidden: true
      cast('' as val_text)                                                          as RetsMgmtProcessingStatusDesc,

      @Consumption.valueHelpDefinition: [{association: '_OverallSDProcessStatus'}]
      @ObjectModel.text.association: '_OverallSDProcessStatusText'
      CustomerReturn.OverallSDProcessStatus,

      @Consumption.valueHelpDefinition: [{association: '_ReleaseStatusVH'}]
      //      @ObjectModel.text.association: '_ReleaseStatus'

      //      cast(_ReldForSubsqntProcgStatus.OvrlReldForSubsqntProcgSts as cust_ret_rel_status)                                              as OvrlReldForSubsqntProcgSts,

      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @ObjectModel.text.element: ['OvrlReldForSubsqntProcgStsDesc']
      @ObjectModel.filter.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      @ObjectModel.sort.transformedBy: 'ABAP:CL_CUSTOMER_RETURN_SADL_FILTER'
      cast('' as cust_ret_rel_status)                                               as OvrlReldForSubsqntProcgSts,
      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_CUSTOMER_RETURN_OPG_VE'
      @UI.hidden: true
      @ObjectModel.filter.enabled: false
      cast('' as val_text)                                                          as OvrlReldForSubsqntProcgStsDesc,

      @Consumption.valueHelpDefinition: [{association: '_OverallSDDocumentRjcnStsVH'}]
      CustomerReturn.OverallSDDocumentRejectionSts,
      @UI.hidden: true
      CustomerReturn._CustRetApprovalReason._SDApprovalReason.WorkflowIsExternal,

      @Consumption.valueHelpDefinition: [{
        entity: { name:    'I_SalesDocApprovalStatus',
                  element: 'SalesDocApprovalStatus' }
      }]
      @ObjectModel.text.element: ['SalesDocApprovalStatusDesc']
      CustomerReturn.SalesDocApprovalStatus,
      @UI.hidden: true
      CustomerReturn._SalesDocApprovalStatus._Text[1: Language=$session.system_language].SalesDocApprovalStatusDesc,
      @UI.hidden: true
      cast(
      case
        when CustomerReturn.SalesDocApprovalStatus  = 'A' then  2 -- | 2: yellow colour
        when CustomerReturn.SalesDocApprovalStatus  = 'B' then  3 -- | 3: green colour
        when CustomerReturn.SalesDocApprovalStatus  = 'C' then  1 -- | 1: red colour
        when CustomerReturn.SalesDocApprovalStatus  = 'D' then  2 -- | 2: yellow colour
                                                          else  0 -- | 0: neutral
      end  as abap.int1 )                                                           as CustRetApprvlStsCriticality,

      // Date Fields

      @Semantics.businessDate.at: true
      CustomerReturn.CustomerReturnDate,
      CustomerReturn.CreationDate,

      @Semantics.systemDate.lastChangedAt: true
      case
        when CustomerReturn.LastChangeDate = '00000000'
          then CustomerReturn.CreationDate
          else CustomerReturn.LastChangeDate
      end                                                                           as LastChangeDate,

      @Consumption.filter.hidden: true
      CustomerReturn.LastChangeDateTime,

      //@ObjectModel.foreignKey.association: '_CreatedByVH'

      @ObjectModel.text.element: ['CreatedByUserName']
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.9
      CreatedByUser,
      @UI.hidden: true
      _CreatedByVH.UserDescription                                                  as CreatedByUserName,

      //@ObjectModel.foreignKey.association: '_ChangedByVH'

      @ObjectModel.text.element: ['LastChangedByUserName']
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.9
      LastChangedByUser,
      @UI.hidden: true
      _ChangedByVH.UserDescription                                                  as LastChangedByUserName,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      CustomerReturn.PurchaseOrderByCustomer,

      @Search.defaultSearchElement: false
      @Search.fuzzinessThreshold: 0.8
      @UI.hidden: true
      cast( concat_with_space(
        concat(
          concat(
            CustomerReturn._SalesOrganization._Text[1: Language=$session.system_language].SalesOrganizationName,
            concat_with_space(',',CustomerReturn._DistributionChannel._Text[1: Language=$session.system_language].DistributionChannelName,1)
          ),
          ','
        ),
        CustomerReturn._OrganizationDivision._Text[1: Language=$session.system_language].DivisionName
      ,1) as txt_vtrber)                                                            as SalesAreaDesc,

      @UI.hidden: true
      concat(
          concat(
            CustomerReturn.SalesOrganization,
            CustomerReturn.DistributionChannel
          ),
          CustomerReturn.OrganizationDivision
      )                                                                             as SalesArea,

      // Needed for authorization checks

      //@Consumption.valueHelp: '_DivisionVH'

      CustomerReturn.OrganizationDivision,
      CustomerReturn.SalesOrganization,
      @Consumption.valueHelpDefinition: [{association: '_DistributionChannelVH'}]
      CustomerReturn.DistributionChannel,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @ObjectModel.foreignKey.association: '_SalesOfficeVH'
      CustomerReturn.SalesOffice,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @ObjectModel.foreignKey.association: '_SalesGroupVH'
      CustomerReturn.SalesGroup,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Consumption.valueHelpDefinition: [{association: '_EmplRespVH'}]
      @ObjectModel.text.element:  [ 'ResponsibleEmployeeName' ]
      cast (CustomerReturn._Partner[PartnerFunction = 'ZM'].Personnel as resp_empl) as ResponsibleEmployee,
      @UI.hidden: true
      @ObjectModel.readOnly
      @Semantics.text:true
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_CUSTRET_UI_PARTNER_UTIL'
      cast('' as ad_namtext )                                                       as ResponsibleEmployeeName,

      @Semantics.amount.currencyCode: 'TransactionCurrency'
      CustomerReturn.TotalNetAmount,

      @Semantics.currencyCode: true
      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      @Consumption.valueHelpDefinition: [{association: '_TransactionCurrency'}]
      CustomerReturn.TransactionCurrency,

      @Consumption.valueHelpDefinition: [{association: '_ShipToPartyVH'}]
      @ObjectModel.mandatory: true
      @ObjectModel.text.element:  [ 'ShipToPartyName' ]
      cast (CustomerReturn._Partner[PartnerFunction='WE'].Customer as kunwe)        as ShipToParty,
      @UI.hidden: true
      @Semantics.text:true
      @ObjectModel.readOnly
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_CUSTRET_UI_PARTNER_UTIL'
      cast('' as ad_namtext )                                                       as ShipToPartyName,

      @UI.hidden: true
      CustomerReturn._Partner[PartnerFunction='WE'].AddressID,

      @UI.hidden: true
      RetsMgmtProcess,

      //Product Search Enabled Association

      @Search.defaultSearchElement: true
      _SalesDocumentItemWl,
      
      //Text Associations

      @Search.defaultSearchElement: false
      _OverallTotalDeliveryStatus,
      @Search.defaultSearchElement: false
      _OverallSDProcessStatus,
      @Search.defaultSearchElement: false
      _OverallOrdReltdBillgStatus,
      @Search.defaultSearchElement: false
      _RetsMgmtProcgStatusText,
      @Search.defaultSearchElement: false
      _RetsMgmtLogProcgStatusText,
      @Search.defaultSearchElement: false
      _OverallSDProcessStatusText,
      @Search.defaultSearchElement: false
      _ReleaseStatus,
      @Search.defaultSearchElement: false
      _ReldForSubsqntProcgStatus,
      @Search.defaultSearchElement: false
      _CustomerReturnType,
      @Search.defaultSearchElement: false
      _ReferenceSDDocumentCategory,
      @Search.defaultSearchElement: false
      _RetsMgmtCompnProcgStatusText,
      @Search.defaultSearchElement: false
      _RefundProgress,
      @Search.defaultSearchElement: false
      _SalesDocumentTypeText,
      @Search.defaultSearchElement: false
      _SDDocumentCategoryText,
      @Search.defaultSearchElement: false
      _OrganizationDivision,
      @Search.defaultSearchElement: false
      _DistributionChannel,
      @Search.defaultSearchElement: false
      _SalesOrganization,
      
      @Consumption.filter.hidden: true
      @Search.defaultSearchElement: false
      _Employment,
      @Search.defaultSearchElement: false
      _CustRetRfndStatus,
      @Search.defaultSearchElement: false
      _SoldToParty,
      @Search.defaultSearchElement: false
      _SoldToParty._CustomerClassification,
      @Search.defaultSearchElement: false
      _Partner,
      @Search.defaultSearchElement: false
      @Consumption.filter.hidden: true
      _SalesDocApprovalStatus,

      //Value Help Associations

      @Search.defaultSearchElement: false
      _EmplRespVH,
      @Search.defaultSearchElement: false
      _ShipToPartyVH,
      @Search.defaultSearchElement: false
      _OverallSDDocumentRjcnStsVH,
      @Search.defaultSearchElement: false
      _OverallSDDocumentRejectionSts,
      @Search.defaultSearchElement: false
      _LogisticalStatusVH,
      @Search.defaultSearchElement: false
      _ProcessingStatusVH,
      @Search.defaultSearchElement: false
      _RefundProgressVH,
      @Search.defaultSearchElement: false
      _ReleaseStatusVH,
      @Search.defaultSearchElement: false
      _RefundStatusVH,
      @Search.defaultSearchElement: false
      _ReferenceDocumentVH,
      @Search.defaultSearchElement: false
      _CreatedByVH,
      @Search.defaultSearchElement: false
      _ChangedByVH,
      @Search.defaultSearchElement: false
      _SalesOfficeVH,
      @Search.defaultSearchElement: false
      _SalesGroupVH,
      @Search.defaultSearchElement: false
      _CustomerReturnTypeVH,
      @Search.defaultSearchElement: false
      _SoldToPartyVH,
      @Search.defaultSearchElement: false
      _DivisionVH,
      @Search.defaultSearchElement: false
      _DistributionChannelVH,
      @Search.defaultSearchElement: false
      _RetsRefDocCategoryVH,
      @Search.defaultSearchElement: false
      @Consumption.filter.hidden: true
      _TransactionCurrency,
      @Search.defaultSearchElement: false
      @UI.hidden: true
      @Consumption.filter.hidden: true
      _RetsMgmtProcessWthProcgSts
}