R_COSTREVENUEREASSIGNMENT

CDS View

Cost and Revenue Reassignment

R_COSTREVENUEREASSIGNMENT is a CDS View in S/4HANA. Cost and Revenue Reassignment. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
A_CostRevenueReassignment view_entity from CONSUMPTION Cost Reassignment Header
I_CostRevenueReassignmentTP view from TRANSACTIONAL Cost, Revenue Reassignment - Transactional View
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Cost and Revenue Reassignment'
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@VDM.viewType:#COMPOSITE
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
    serviceQuality: #D,
    sizeCategory: #XXL,
    dataClass: #MIXED
}
define view entity R_CostRevenueReassignment 
    as select from I_CostRevenueReassignment 
    
    association [0..1] to I_CompanyCode as _CompanyCodeText         on  $projection.CompanyCode = _CompanyCodeText.CompanyCode 
    
    association [0..1] to I_CompanyCode as _SenderCompanyCodeText   on  $projection.SenderCompanyCode = _SenderCompanyCodeText.CompanyCode 
    
    association [1..1] to I_CostRevnReassgmtDocStatusTxt    as _CostRevnReassgmtDocStatusTxt  on $projection.ControllingDocumentStatus = _CostRevnReassgmtDocStatusTxt.Status
                                                                                                and  _CostRevnReassgmtDocStatusTxt.Language = $session.system_language  
                                                                                         
    association [1..1] to I_CostRevnReassgmtPostgTypeTxt    as _CostRevnReassgmtPostgTypeTxt  on $projection.AllocationPostingType = _CostRevnReassgmtPostgTypeTxt.AllocationPostingType
                                                                                                    and  _CostRevnReassgmtPostgTypeTxt.Language = $session.system_language                                                                                                                                                   
      
    association [0..*] to I_BusTransactionTypeText          as _BusinessTransactionTypeText   on  $projection.ControllingBusTransacType = _BusinessTransactionTypeText.BusinessTransactionType
      
    association [1..1] to I_CostRevnReassignmentTypeText    as _CostRevnReassignmentTypeText  on $projection.ControllingBusTransacType = _CostRevnReassignmentTypeText.ControllingBusTransacType
                                                                                                    and  _CostRevnReassignmentTypeText.Language = $session.system_language
{
  key FiscalYear,      
      
  key ReferenceDocument,
  
  key ControllingArea,
      
      cast(CompanyCode as receivercompanycode) as CompanyCode,
      
      cast(SenderCompanyCode as sendercompanycode) as SenderCompanyCode,
      
      cast(AccountingDocument as fis_belnr) as AccountingDocument,
      
      AccountingDocumentHeaderText,
      
      DocumentDate,

      PostingDate,

      FiscalPeriod, 
      
      AccountingDocumentCreationDate,
      
      AccountingDocCreatedByUser,
      
      IsReversal,
      IsReversed,      

      cast( 
        case
          when NumberOfDocumentItems = 1 and IsSettled = '' then '1' //Normal

          when NumberOfDocumentItems = 2 then '4' //Partially

          else '3' //Repost

      end as fco_document_status) as ControllingDocumentStatus,
      cast( 
        case
          when NumberOfDocumentItems = 1 and IsSettled = '' then 3 //Normal

          when NumberOfDocumentItems = 2 then 2 //Partially

          else 2 //Repost

      end as abap.int1)  as CtrlgOverheadStatusCriticality,      

      AllocationPostingType,     
      
      ReferenceDocumentType,
      ReferenceDocumentContext,
      
      cast('' as reversalreferencedocument)             as ReversalReferenceDocument,      

      ReversedReferenceDocument,
      
      CostRevenueReassignmentAction,
      PostingFiscalYear,
      
      ExchangeRateDate,     
      
      GlobalCurrency,
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      TotalAmountInGlobalCurrency,
      
      ControllingBusTransacType,
      
      cast(ControllingBusTransacType as costrevenuereassignmenttype) as CostRevenueReassignmentType,     
      
      _ReferenceDocumentType,
      _CompanyCodeText,
      _SenderCompanyCodeText,
      _CostRevnReassgmtDocStatusTxt,
      _CostRevnReassgmtPostgTypeTxt,
      _BusinessTransactionTypeText,
      _CostRevnReassignmentTypeText
      
}
where
  IsReversed = ''

union all select from I_CostRevenueReassignment 
    
    association [0..1] to I_CompanyCode as _CompanyCodeText         on  $projection.CompanyCode = _CompanyCodeText.CompanyCode 
    
    association [0..1] to I_CompanyCode as _SenderCompanyCodeText   on  $projection.SenderCompanyCode = _SenderCompanyCodeText.CompanyCode 
    
    association [1..1] to I_CostRevnReassgmtDocStatusTxt    as _CostRevnReassgmtDocStatusTxt  on $projection.ControllingDocumentStatus = _CostRevnReassgmtDocStatusTxt.Status
                                                                                                and  _CostRevnReassgmtDocStatusTxt.Language = $session.system_language  
                                                                                         
    association [1..1] to I_CostRevnReassgmtPostgTypeTxt    as _CostRevnReassgmtPostgTypeTxt  on $projection.AllocationPostingType = _CostRevnReassgmtPostgTypeTxt.AllocationPostingType
                                                                                                    and  _CostRevnReassgmtPostgTypeTxt.Language = $session.system_language                                                                                                                                                   
      
    association [0..*] to I_BusTransactionTypeText          as _BusinessTransactionTypeText   on  $projection.ControllingBusTransacType = _BusinessTransactionTypeText.BusinessTransactionType
      
    association [1..1] to I_CostRevnReassignmentTypeText    as _CostRevnReassignmentTypeText  on $projection.ControllingBusTransacType = _CostRevnReassignmentTypeText.ControllingBusTransacType
                                                                                                    and  _CostRevnReassignmentTypeText.Language = $session.system_language
{
  key FiscalYear,      
      
  key ReferenceDocument,
  
  key ControllingArea,
      
      cast(CompanyCode as receivercompanycode) as CompanyCode,
      
      cast(SenderCompanyCode as sendercompanycode) as SenderCompanyCode,
      
      cast(AccountingDocument as fis_belnr) as AccountingDocument,
      
      AccountingDocumentHeaderText,
      
      DocumentDate,

      PostingDate,

      FiscalPeriod, 
      
      AccountingDocumentCreationDate,
      
      AccountingDocCreatedByUser,
      
      IsReversal,
      IsReversed,      

      cast('2' as fco_document_status)  as ControllingDocumentStatus,
      cast(1 as abap.int1)  as CtrlgOverheadStatusCriticality,      

      AllocationPostingType,     
      
      ReferenceDocumentType,
      ReferenceDocumentContext,
      
      cast(ReversalReferenceDocument as reversalreferencedocument)             as ReversalReferenceDocument,      

      ReversedReferenceDocument,
      
      CostRevenueReassignmentAction,
      PostingFiscalYear,
      
      ExchangeRateDate,     
      
      GlobalCurrency,
      
      TotalAmountInGlobalCurrency,
      
      ControllingBusTransacType,
      
      cast(ControllingBusTransacType as costrevenuereassignmenttype) as CostRevenueReassignmentType,     
      
      _ReferenceDocumentType,
      _CompanyCodeText,
      _SenderCompanyCodeText,
      _CostRevnReassgmtDocStatusTxt,
      _CostRevnReassgmtPostgTypeTxt,
      _BusinessTransactionTypeText,
      _CostRevnReassignmentTypeText
      
}
where
  IsReversed = 'X'