I_COSTREVENUEREASSIGNMENTITEM

CDS View

Cost, Revenue Reassgmt Item - Basic

I_COSTREVENUEREASSIGNMENTITEM is a CDS View in S/4HANA. Cost, Revenue Reassgmt Item - Basic. It contains 1 fields. 3 CDS views read from this table.

CDS Views using this table (3)

ViewTypeJoinVDMDescription
A_CostRevenueReassignmentItem view_entity from CONSUMPTION Cost Reassignment Items
I_CostRevnReassignmentItemTP view from TRANSACTIONAL Cost, Revenue Reassgmt Item - Transactional
P_CostRevnReassgmtActiveItem view from COMPOSITE

Fields (1)

KeyField CDS FieldsUsed in Views
AccountingDocumentType AccountingDocumentType 1
@AbapCatalog.sqlViewName: 'ICOSREVREASSITM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Cost, Revenue Reassgmt Item - Basic'


@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.personalData.blocking: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType: #COMPOSITE

@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #D

define view I_CostRevenueReassignmentItem 

  as select from I_GLAccountLineItemRawData as _Item
    
  inner join I_AccountAssignmentType as _AccountAssignmentType
    on _AccountAssignmentType.AccountAssignmentType = _Item.AccountAssignmentType 
    
  association [0..1] to I_GLAccountLineItemRawData     as _Sender                        on _Item.SourceLedger = _Sender.SourceLedger
                                                                                         and _Item.PartnerCompanyCode = _Sender.CompanyCode
                                                                                         and _Item.FiscalYear = _Sender.FiscalYear
                                                                                         and _Item.TransactionSubitem = _Sender.TransactionSubitem
                                                                                         and _Sender.OriginCtrlgDebitCreditCode = 'H'
                                                                                         and _Sender.ControllingBusTransacType = _Item.ControllingBusTransacType     
                                                                                         and _Sender.ReferenceDocumentType = 'COBK'
                                                                                         and _Item.ReferenceDocument = _Sender.ReferenceDocument
                                                                                         and _Sender.BusinessTransactionCategory = _Item.BusinessTransactionCategory
  
  association [0..1] to I_Fund                         as _Fund                          on  $projection.FinancialManagementArea = _Fund.FinancialManagementArea
                                                                                         and $projection.Fund                    = _Fund.Fund
  
  association [0..1] to I_Fund                         as _PartnerFund                   on  $projection.FinancialManagementArea = _PartnerFund.FinancialManagementArea
                                                                                         and $projection.PartnerFund             = _PartnerFund.Fund
  
  association [0..1] to I_Grant                        as _Grant                         on  $projection.GrantID                 = _Grant.GrantID
   
  association [0..1] to I_Grant                        as _PartnerGrant                  on  $projection.PartnerGrant            = _PartnerGrant.GrantID
  
  association [0..1] to I_BudgetPeriod                 as _BudgetPeriod                  on  $projection.BudgetPeriod = _BudgetPeriod.BudgetPeriod
    
  association [0..1] to I_BudgetPeriod                 as _PartnerBudgetPeriod           on  $projection.PartnerBudgetPeriod = _PartnerBudgetPeriod.BudgetPeriod
  
  association [0..1] to I_FundsMgmtFunctionalArea      as _PartnerFunctionalArea         on  $projection.PartnerFunctionalArea = _PartnerFunctionalArea.FunctionalArea
  
  association [0..1] to I_FundsMgmtFunctionalArea      as _FunctionalArea                on  $projection.FunctionalArea = _FunctionalArea.FunctionalArea
    
{
  key _Item.FiscalYear,
  key cast(_Item.ReferenceDocument as referencedocument preserving type) as ReferenceDocument,
  key _Item.ControllingArea,
  key cast(_Item.CompanyCode as receivercompanycode preserving type) as CompanyCode,  
  key _Item.LedgerGLLineItem,
  key _Item.ReferenceDocumentItem,
      _Item.AccountingDocument,
  
      _Item.SourceLedger,
       
      _Item.FiscalYear as FiscalYearForEdit,
      cast(_Item.ReferenceDocument as referencedocument preserving type) as ReferenceDocumentForEdit,
      _Item.ControllingArea as ControllingAreaForEdit,
      _Item.CompanyCode as CompanyCodeForEdit,   
      _Item.LedgerGLLineItem as LedgerGLLineItemForEdit,
      _Item.ReferenceDocumentItem as ReferenceDocumentItemForEdit,
      
      _Item.DocumentItemText,
      
      cast(_Item.GLAccount as fco_allocation_account preserving type) as GLAccount,   
      
      _Item.PersonnelNumber,   
      
      //Senders and Receivers      

      cast(_Sender.AccountAssignment as sender_co_obj_k) as AccountAssignment,      
      cast(_Sender.AccountAssignmentType as j_obart preserving type) as AccountAssignmentType,
      
      cast(_Item.AccountAssignment as receiver_co_obj_k) as PartnerAccountAssignment,      
      cast(_Item.AccountAssignmentType as receiver_object_type preserving type) as PartnerAccountAssignmentType,
      
      cast(_Sender.CostCtrActivityType as lstar preserving type) as CostCtrActivityType,
      cast(_Sender.CostCenter as sendercostcenter preserving type) as OriginCostCenter,
      
      cast(_Item.CostCenter as fis_skost preserving type) as PartnerCostCenter,
      //Cost Center/Activity Type

      cast(_Item.CostCtrActivityType as fis_par_lstar preserving type) as PartnerCostCtrActivityType,          
      
      
      //WBS Element

      cast(_Item.WBSElementInternalID as fis_partner_wbsint_no_conv preserving type) as PartnerWBSElementInternalID,      
      cast(_Sender.WBSElementInternalID as fis_wbsint_no_conv preserving type) as WBSElementInternalID,
      
      cast(_Item._WBSElementBasicData.WBSElementExternalID as fis_partner_wbsext_no_conv preserving type) as PartnerWBSElementExternalID,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor:   'PartnerWBSElementExternalID'
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: 'PartnerWBSElementExternalID'
      cast(_Item._WBSElementBasicData.WBSElementExternalID as fis_par_psp_pnr_ext preserving type) as PartnerWBSElement,  
      
      cast(_Sender._WBSElementBasicData.WBSElementExternalID as fis_wbsext_no_conv preserving type) as WBSElementExternalID,    
      @API.element.releaseState: #DEPRECATED
      @API.element.successor:   'WBSElementExternalID'
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: 'WBSElementExternalID'
      cast(_Sender._WBSElementBasicData.WBSElementExternalID as ps_posid_edit preserving type) as WBSElement,
      
      
      //Service Contract Item and Service Order Item

      cast(_Item.ServiceDocumentType as fco_psrvdoc_type preserving type) as PartnerServiceDocumentType,
      cast(_Item.ServiceDocument as fco_psrvdoc_id preserving type) as PartnerServiceDocument,
      cast(_Item.ServiceDocumentItem as fco_psrvdoc_item_id preserving type) as PartnerServiceDocumentItem,
      
      cast(_Sender.ServiceDocumentType as fco_srvdoc_type preserving type) as ServiceDocumentType,
      cast(_Sender.ServiceDocument as fco_srvdoc_id preserving type) as ServiceDocument,
      cast(_Sender.ServiceDocumentItem as fco_srvdoc_item_id preserving type) as ServiceDocumentItem,
      
      //Network

      cast(_Item.ProjectNetwork as par_npln preserving type) as PartnerProjectNetwork,
      cast(_Item.RelatedNetworkActivity as par_vornr_auf preserving type) as PartnerProjectNetworkActivity,
      
      cast(_Sender.RelatedNetworkActivity as npvrg preserving type) as RelatedNetworkActivity,      
      cast(_Sender.ProjectNetwork as nplnr preserving type) as ProjectNetwork,
      
      //Activity or Order

      cast(_Item.OrderID as fis_par_aufnr preserving type) as PartnerOrder,
      
      cast(_Sender.OrderID as fis_aufnr preserving type) as OrderID,
      
      //Order operation

      cast(_Item.OrderOperation as vdm_vornr preserving type) as PartnerOrderOperation,
      cast(_Sender.OrderOperation as vdm_vornr preserving type) as OrderOperation,      
                  
      //Real Estate Management - Rental Unit

      cast(_Sender.CompanyCode as sendercompanycode preserving type) as SenderCompanyCode,
      
      //Cost object

      cast(_Item.CostObject as par_kstrg preserving type) as PartnerCostObject,
      cast(_Sender.CostObject as kstrg preserving type) as CostObject,  
      
      //Sales Order

      cast(_Item.SalesDocument as fis_par_kdauf preserving type) as PartnerSalesDocument,
      cast(_Item.SalesDocumentItem as fis_par_kdpos preserving type) as PartnerSalesDocumentItem,
      
      cast(_Sender.SalesDocument as vbeln_va preserving type) as SalesDocument,
      cast(_Sender.SalesDocumentItem as posnr_va preserving type) as SalesDocumentItem,
      
      cast(_Item.BusinessProcess as par_prznr preserving type) as PartnerBusinessProcess,
      cast(_Sender.BusinessProcess as sprznr preserving type) as BusinessProcess,  
      
      //Recovery indicator

      _Item.JointVentureCostRecoveryCode,
      cast(_Sender.JointVentureCostRecoveryCode as jv_srecind_cds preserving type) as SenderCostRecoveryCode,
            
      //Public Sector

      cast(_Sender.Fund as fm_sfonds preserving type) as Fund,
      cast(_Sender.FunctionalArea as fm_sfarea preserving type) as FunctionalArea,
      cast(_Sender.GrantID as gm_grant_sender preserving type) as GrantID,
      cast(_Sender.BudgetPeriod as fm_budget_period preserving type) as BudgetPeriod,
      cast(_Item.Fund as fm_efonds preserving type) as PartnerFund,
      cast(_Item.FunctionalArea as fm_efarea preserving type) as PartnerFunctionalArea,
      cast(_Item.GrantID as gm_grant_receiver preserving type) as PartnerGrant,
      cast(_Item.BudgetPeriod as fm_pbudget_period preserving type) as PartnerBudgetPeriod,
      
      //Workitem

      _Sender.WorkItem as WorkItem,
      _Item.WorkItem as PartnerWorkItem,      
      
      _Item.FinancialManagementArea,
      
      cast(_Item.BillableControl as ebemot preserving type) as RcvrAcctgIndCode,
      cast(_Sender.BillableControl as bemot preserving type) as BillableControl,
      
      cast(
        case _Item.AccountAssignmentType
          when 'EO' then _Item.AccountAssignment
          else ''
      end as rkepobj) as PartnerProfitabilitySegment,
      
      cast(
        case _Sender.AccountAssignmentType
          when 'EO' then _Sender.AccountAssignment
          else ''
      end as rkeobjnr) as ProfitabilitySegment, 
      
      @Semantics.booleanIndicator
      cast(
        case _Item.AccountAssignmentType
          when 'EO' then 'X'
          else ''
      end as profitabilitysegmentisassigned preserving type) as PartProfitabilitySgmtIsAssgd,
      
      @Semantics.booleanIndicator
      cast(
        case _Sender.AccountAssignmentType
          when 'EO' then 'X'
          else ''
      end as profitabilitysegmentisassigned preserving type) as ProfitabilitySegmentIsAssigned, 
           
      _Item.OperatingConcern,
      
      
      @Semantics.unitOfMeasure:true
      _Item.BaseUnit,
      
      @Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
      cast(_Item.Quantity as lstxx) as Quantity,
      
      @Semantics.currencyCode:true
      _Item.TransactionCurrency,
      
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      cast(_Item.AmountInTransactionCurrency as fis_wsl preserving type) as AmountInTransactionCurrency,
      
      @Semantics.currencyCode:true
      _Item.CompanyCodeCurrency,
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      cast(_Item.AmountInCompanyCodeCurrency as fis_hsl preserving type) as AmountInCompanyCodeCurrency,
      
      @Semantics.currencyCode:true
      _Item.GlobalCurrency,
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      cast(_Item.AmountInGlobalCurrency as fis_ksl preserving type) as AmountInGlobalCurrency,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency1,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      _Item.AmountInFreeDefinedCurrency1,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency2,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      _Item.AmountInFreeDefinedCurrency2,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency3,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      _Item.AmountInFreeDefinedCurrency3,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency4,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      _Item.AmountInFreeDefinedCurrency4,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency5,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      _Item.AmountInFreeDefinedCurrency5,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency6,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      _Item.AmountInFreeDefinedCurrency6,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency7,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      _Item.AmountInFreeDefinedCurrency7,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency8,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      _Item.AmountInFreeDefinedCurrency8,
      
      @Semantics.currencyCode:true
      _Item.FunctionalCurrency,
      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
      _Item.AmountInFunctionalCurrency,
      
      //RealEstate

      cast(_Item.CompanyCode as pbukrs preserving type) as ReceiverRECompanyCode,
      cast(_Item.REBusinessEntity as rebdvdmpbeno preserving type) as REPartnerBusinessEntity,
      cast(_Item.RealEstateBuilding as rebdvdmpbuno preserving type) as RealEstatePartnerBuilding,
      cast(_Item.RealEstateProperty as rebdvdmpprno preserving type) as RealEstatePartnerProperty,
      cast(_Item.RERentalObject as rebdvdmprono preserving type) as REPartnerRentalObject,
      cast(_Item.RealEstateContract as recnvdmpcnnr preserving type) as RealEstatePartnerContract,
      cast(_Item.REServiceChargeKey as rescvdmpsckey preserving type) as REPartnerServiceChargeKey,
      cast(_Item.RESettlementUnitID as rescvdmpsuid preserving type) as REPartnerSettlementUnitID,
      cast(_Item.SettlementReferenceDate as fins_par_dabrbez preserving type) as PartnerSettlementReferenceDate,
      
      cast(_Sender.CompanyCode as vvsbukrs preserving type) as SenderRECompanyCode,
      cast(_Sender.REBusinessEntity as rebdvdmbeno preserving type) as REBusinessEntity,
      cast(_Sender.RealEstateBuilding as rebdvdmbuno preserving type) as RealEstateBuilding,
      cast(_Sender.RealEstateProperty as rebdvdmprno preserving type) as RealEstateProperty,
      cast(_Sender.RERentalObject as rebdvdmrono preserving type) as RERentalObject,
      cast(_Sender.RealEstateContract as recnvdmcnnr preserving type) as RealEstateContract,
      cast(_Sender.REServiceChargeKey as rescvdmsckey preserving type) as REServiceChargeKey,
      cast(_Sender.RESettlementUnitID as rescvdmsuid preserving type) as RESettlementUnitID,
      cast(_Sender.SettlementReferenceDate as farp_dabrbez preserving type) as SettlementReferenceDate,
      
      cast('' as fis_prctr) as ProfitCenter,
      cast('' as fis_prctr) as PartnerProfitCenter,
      
      _Item.ControllingBusTransacType,
      _Item.ChartOfAccounts, 
      _Item.PostingDate,
      _Item.DocumentDate,
      _Item.AccountingDocCreatedByUser,
      _Item.IsReversal,
      _Item.IsReversed,    
      _Item.ReferenceDocumentType, 
      _Item.ReversalReferenceDocument,   
      
      _Item.ControllingObject as PartnerControllingObject,
      _Sender.ControllingObject,
      _Item.TransactionSubitem,
      _Item.AccountingDocumentType,
      
      _Item._CompanyCode as _CompanyCodeText,
      _Item._BaseUnit,
      _Item._JournalEntry,
      _Fund,
      _PartnerFund,
      _Grant,
      _PartnerGrant,
      _BudgetPeriod,
      _PartnerBudgetPeriod,
      _FunctionalArea,
      _PartnerFunctionalArea      

}
where
  (
       ( _Item.ControllingBusTransacType = 'KAMV' and _Item.BusinessTransactionCategory = 'KAMV' )  
    or ( _Item.ControllingBusTransacType = 'RKU1' and _Item.BusinessTransactionCategory = 'RKU1' )     
  )
  and
  _Item.ReferenceDocumentType = 'COBK'
  and
  _Item.OriginCtrlgDebitCreditCode = 'S'
  and
  _Item._Ledger.IsLeadingLedger = 'X'
  and _Item.LogicalSystem = '' 
  and _Item._JournalEntry.SenderLogicalSystem = '' 
  and (_Item.SourceLedger = _Item._JournalEntry.LedgerGroup or _Item._JournalEntry.LedgerGroup = '' )
   
  union all select from I_GLAccountLineItemRawData as _Item
    
  inner join I_AccountAssignmentType as _AccountAssignmentType
    on _AccountAssignmentType.AccountAssignmentType = _Item.AccountAssignmentType
    
  association [0..1] to I_GLAccountLineItemRawData     as _Sender                        on _Item.SourceLedger = _Sender.SourceLedger
                                                                                         and _Item.PartnerCompanyCode = _Sender.CompanyCode
                                                                                         and _Item.FiscalYear = _Sender.FiscalYear
                                                                                         and _Item.TransactionSubitem = _Sender.TransactionSubitem
                                                                                         and _Sender.OriginCtrlgDebitCreditCode = 'S'
                                                                                         and _Sender.ControllingBusTransacType = _Item.ControllingBusTransacType     
                                                                                         and _Sender.ReferenceDocumentType = 'COBK'
                                                                                         and _Item.ReferenceDocument = _Sender.ReferenceDocument
                                                                                         and _Sender.BusinessTransactionCategory = _Item.BusinessTransactionCategory
  
   association [0..1] to I_Fund                         as _Fund                          on  $projection.FinancialManagementArea = _Fund.FinancialManagementArea
                                                                                         and $projection.Fund                    = _Fund.Fund
  
  association [0..1] to I_Fund                         as _PartnerFund                   on  $projection.FinancialManagementArea = _PartnerFund.FinancialManagementArea
                                                                                         and $projection.PartnerFund             = _PartnerFund.Fund
  
  association [0..1] to I_Grant                        as _Grant                         on  $projection.GrantID                 = _Grant.GrantID
   
  association [0..1] to I_Grant                        as _PartnerGrant                  on  $projection.PartnerGrant            = _PartnerGrant.GrantID
  
  association [0..1] to I_BudgetPeriod                 as _BudgetPeriod                  on  $projection.BudgetPeriod = _BudgetPeriod.BudgetPeriod
    
  association [0..1] to I_BudgetPeriod                 as _PartnerBudgetPeriod           on  $projection.PartnerBudgetPeriod = _PartnerBudgetPeriod.BudgetPeriod
  
  association [0..1] to I_FundsMgmtFunctionalArea      as _PartnerFunctionalArea         on  $projection.PartnerFunctionalArea = _PartnerFunctionalArea.FunctionalArea
  
  association [0..1] to I_FundsMgmtFunctionalArea      as _FunctionalArea                on  $projection.FunctionalArea = _FunctionalArea.FunctionalArea
  
{
  key _Item.FiscalYear,
  key cast(_Item.ReferenceDocument as referencedocument preserving type) as ReferenceDocument,
  key _Item.ControllingArea,
  key cast(_Item.CompanyCode as receivercompanycode preserving type) as CompanyCode,
  key _Item.LedgerGLLineItem,
  key _Item.ReferenceDocumentItem,
      _Item.AccountingDocument,
  
      _Item.SourceLedger,
       
      _Item.FiscalYear as FiscalYearForEdit,
      cast(_Item.ReferenceDocument as referencedocument preserving type) as ReferenceDocumentForEdit,
      _Item.ControllingArea as ControllingAreaForEdit,
      _Item.CompanyCode as CompanyCodeForEdit,  
      _Item.LedgerGLLineItem as LedgerGLLineItemForEdit,
      _Item.ReferenceDocumentItem as ReferenceDocumentItemForEdit,
      
      _Item.DocumentItemText,
      
      cast(_Item.GLAccount as fco_allocation_account preserving type) as GLAccount,      
      
      _Item.PersonnelNumber, 
      
      //Senders and Receivers      

      
      cast(_Sender.AccountAssignment as sender_co_obj_k) as AccountAssignment,      
      cast(_Sender.AccountAssignmentType as j_obart preserving type) as AccountAssignmentType,
      
      cast(_Item.AccountAssignment as receiver_co_obj_k) as PartnerAccountAssignment,      
      cast(_Item.AccountAssignmentType as receiver_object_type preserving type) as PartnerAccountAssignmentType,
      
      cast(_Sender.CostCtrActivityType as lstar preserving type) as CostCtrActivityType,
      cast(_Sender.CostCenter as sendercostcenter preserving type) as OriginCostCenter,
      
      cast(_Item.CostCenter as fis_skost preserving type) as PartnerCostCenter,
      //Cost Center/Activity Type

      cast(_Item.CostCtrActivityType as fis_par_lstar preserving type) as PartnerCostCtrActivityType,          
      
      
      //WBS Element

      cast(_Item.WBSElementInternalID as fis_partner_wbsint_no_conv preserving type) as PartnerWBSElementInternalID,      
      cast(_Sender.WBSElementInternalID as fis_wbsint_no_conv preserving type) as WBSElementInternalID,
      
      cast(_Item._WBSElementBasicData.WBSElementExternalID as fis_partner_wbsext_no_conv preserving type) as PartnerWBSElementExternalID,
      @API.element.releaseState: #DEPRECATED
      @API.element.successor:   'PartnerWBSElementExternalID'
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: 'PartnerWBSElementExternalID'
      cast(_Item._WBSElementBasicData.WBSElementExternalID as fis_par_psp_pnr_ext preserving type) as PartnerWBSElement,   
      
      cast(_Sender._WBSElementBasicData.WBSElementExternalID as fis_wbsext_no_conv preserving type) as WBSElementExternalID,    
      @API.element.releaseState: #DEPRECATED
      @API.element.successor:   'WBSElementExternalID'
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: 'WBSElementExternalID'   
      cast(_Sender._WBSElementBasicData.WBSElementExternalID as ps_posid_edit preserving type) as WBSElement,
      
      
      //Service Contract Item and Service Order Item

      cast(_Item.ServiceDocumentType as fco_psrvdoc_type preserving type) as PartnerServiceDocumentType,
      cast(_Item.ServiceDocument as fco_psrvdoc_id preserving type) as PartnerServiceDocument,
      cast(_Item.ServiceDocumentItem as fco_psrvdoc_item_id preserving type) as PartnerServiceDocumentItem,
      
      cast(_Sender.ServiceDocumentType as fco_srvdoc_type preserving type) as ServiceDocumentType,
      cast(_Sender.ServiceDocument as fco_srvdoc_id preserving type) as ServiceDocument,
      cast(_Sender.ServiceDocumentItem as fco_srvdoc_item_id preserving type) as ServiceDocumentItem,
      
      //Network

      cast(_Item.ProjectNetwork as par_npln preserving type) as PartnerProjectNetwork,
      cast(_Item.RelatedNetworkActivity as par_vornr_auf preserving type) as PartnerProjectNetworkActivity,
      
      cast(_Sender.RelatedNetworkActivity as npvrg preserving type) as RelatedNetworkActivity,      
      cast(_Sender.ProjectNetwork as nplnr preserving type) as ProjectNetwork,
      
      //Activity or Order

      cast(_Item.OrderID as fis_par_aufnr preserving type) as PartnerOrder,
      
      cast(_Sender.OrderID as fis_aufnr preserving type) as OrderID,
      
      //Order operation

      cast(_Item.OrderOperation as vdm_vornr preserving type) as PartnerOrderOperation,
      cast(_Sender.OrderOperation as vdm_vornr preserving type) as OrderOperation,      
            
      //Real Estate Management - Rental Unit

      cast(_Sender.CompanyCode as sendercompanycode preserving type) as SenderCompanyCode,
      
      //Cost object

      cast(_Item.CostObject as par_kstrg preserving type) as PartnerCostObject,
      cast(_Sender.CostObject as kstrg preserving type) as CostObject,  
      
      //Sales Order

      cast(_Item.SalesDocument as fis_par_kdauf preserving type) as PartnerSalesDocument,
      cast(_Item.SalesDocumentItem as fis_par_kdpos preserving type) as PartnerSalesDocumentItem,
      
      cast(_Sender.SalesDocument as vbeln_va preserving type) as SalesDocument,
      cast(_Sender.SalesDocumentItem as posnr_va preserving type) as SalesDocumentItem,
      
      cast(_Item.BusinessProcess as par_prznr preserving type) as PartnerBusinessProcess,
      cast(_Sender.BusinessProcess as sprznr preserving type) as BusinessProcess,  
      
      //Recovery indicator

      _Item.JointVentureCostRecoveryCode,
      cast(_Sender.JointVentureCostRecoveryCode as jv_srecind_cds preserving type) as SenderCostRecoveryCode,
            
      //Public Sector

      cast(_Sender.Fund as fm_sfonds preserving type) as Fund,
      cast(_Sender.FunctionalArea as fm_sfarea preserving type) as FunctionalArea,
      cast(_Sender.GrantID as gm_grant_sender preserving type) as GrantID,
      cast(_Sender.BudgetPeriod as fm_budget_period preserving type) as BudgetPeriod,
      cast(_Item.Fund as fm_efonds preserving type) as PartnerFund,
      cast(_Item.FunctionalArea as fm_efarea preserving type) as PartnerFunctionalArea,
      cast(_Item.GrantID as gm_grant_receiver preserving type) as PartnerGrant,
      cast(_Item.BudgetPeriod as fm_pbudget_period preserving type) as PartnerBudgetPeriod,
      
      //Workitem

      _Sender.WorkItem as Workitem,
      _Item.WorkItem as PartnerWorkitem,
      
      _Item.FinancialManagementArea,
      
      cast(_Item.BillableControl as ebemot preserving type) as RcvrAcctgIndCode,
      cast(_Sender.BillableControl as bemot preserving type) as BillableControl,
      
      cast(
        case _Item.AccountAssignmentType
          when 'EO' then _Item.AccountAssignment
          else ''
      end as rkepobj) as PartnerProfitabilitySegment,
      
      cast(
        case _Sender.AccountAssignmentType
          when 'EO' then _Sender.AccountAssignment
          else ''
      end as rkeobjnr) as ProfitabilitySegment, 
      
      @Semantics.booleanIndicator
      cast(
        case _Item.AccountAssignmentType
          when 'EO' then 'X'
          else ''
      end as profitabilitysegmentisassigned preserving type) as PartProfitabilitySgmtIsAssgd,
      
      @Semantics.booleanIndicator
      cast(
        case _Sender.AccountAssignmentType
          when 'EO' then 'X'
          else ''
      end as profitabilitysegmentisassigned preserving type) as ProfitabilitySegmentIsAssigned, 
           
      _Item.OperatingConcern,
     
      @Semantics.unitOfMeasure:true
      _Item.BaseUnit,
      
      @Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
      cast((-1) * _Item.Quantity as lstxx) as Quantity,
      
      @Semantics.currencyCode:true
      _Item.TransactionCurrency,
      
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      (-1) * cast(_Item.AmountInTransactionCurrency as fis_wsl preserving type) as AmountInTransactionCurrency,
      
      @Semantics.currencyCode:true
      _Item.CompanyCodeCurrency,
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      (-1) * cast(_Item.AmountInCompanyCodeCurrency as fis_hsl preserving type) as AmountInCompanyCodeCurrency,
      
      @Semantics.currencyCode:true
      _Item.GlobalCurrency,
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      (-1) * cast(_Item.AmountInGlobalCurrency as fis_ksl preserving type) as AmountInGlobalCurrency,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency1,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      (-1) * _Item.AmountInFreeDefinedCurrency1 as AmountInFreeDefinedCurrency1,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency2,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      (-1) * _Item.AmountInFreeDefinedCurrency2 as AmountInFreeDefinedCurrency2,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency3,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      (-1) * _Item.AmountInFreeDefinedCurrency3 as AmountInFreeDefinedCurrency3,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency4,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      (-1) * _Item.AmountInFreeDefinedCurrency4 as AmountInFreeDefinedCurrency4,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency5,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      (-1) * _Item.AmountInFreeDefinedCurrency5 as AmountInFreeDefinedCurrency5,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency6,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      (-1) * _Item.AmountInFreeDefinedCurrency6 as AmountInFreeDefinedCurrency6,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency7,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      (-1) * _Item.AmountInFreeDefinedCurrency7 as AmountInFreeDefinedCurrency7,
      
      @Semantics.currencyCode:true
      _Item.FreeDefinedCurrency8,
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      (-1) * _Item.AmountInFreeDefinedCurrency8 as AmountInFreeDefinedCurrency8,
      
      @Semantics.currencyCode:true
      _Item.FunctionalCurrency,
      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
      (-1) * _Item.AmountInFunctionalCurrency as AmountInFunctionalCurrency,
      
      //RealEstate

      cast(_Item.CompanyCode as pbukrs preserving type) as ReceiverRECompanyCode,
      cast(_Item.REBusinessEntity as rebdvdmpbeno preserving type) as REPartnerBusinessEntity,
      cast(_Item.RealEstateBuilding as rebdvdmpbuno preserving type) as RealEstatePartnerBuilding,
      cast(_Item.RealEstateProperty as rebdvdmpprno preserving type) as RealEstatePartnerProperty,
      cast(_Item.RERentalObject as rebdvdmprono preserving type) as REPartnerRentalObject,
      cast(_Item.RealEstateContract as recnvdmpcnnr preserving type) as RealEstatePartnerContract,
      cast(_Item.REServiceChargeKey as rescvdmpsckey preserving type) as REPartnerServiceChargeKey,
      cast(_Item.RESettlementUnitID as rescvdmpsuid preserving type) as REPartnerSettlementUnitID,
      cast(_Item.SettlementReferenceDate as fins_par_dabrbez preserving type) as PartnerSettlementReferenceDate,
      
      cast(_Sender.CompanyCode as vvsbukrs preserving type) as SenderRECompanyCode,
      cast(_Sender.REBusinessEntity as rebdvdmbeno preserving type) as REBusinessEntity,
      cast(_Sender.RealEstateBuilding as rebdvdmbuno preserving type) as RealEstateBuilding,
      cast(_Sender.RealEstateProperty as rebdvdmprno preserving type) as RealEstateProperty,
      cast(_Sender.RERentalObject as rebdvdmrono preserving type) as RERentalObject,
      cast(_Sender.RealEstateContract as recnvdmcnnr preserving type) as RealEstateContract,
      cast(_Sender.REServiceChargeKey as rescvdmsckey preserving type) as REServiceChargeKey,
      cast(_Sender.RESettlementUnitID as rescvdmsuid preserving type) as RESettlementUnitID,
      cast(_Sender.SettlementReferenceDate as farp_dabrbez preserving type) as SettlementReferenceDate,
      
      cast('' as fis_prctr) as ProfitCenter,
      cast('' as fis_prctr) as PartnerProfitCenter,      
      
      _Item.ControllingBusTransacType,
      
      _Item.ChartOfAccounts, 
      _Item.PostingDate,
      _Item.DocumentDate,
      _Item.AccountingDocCreatedByUser,
      _Item.IsReversal,
      _Item.IsReversed,    
      _Item.ReferenceDocumentType, 
      _Item.ReversalReferenceDocument, 
      
      _Item.ControllingObject as PartnerControllingObject,
      _Sender.ControllingObject,
      _Item.TransactionSubitem,
      _Item.AccountingDocumentType,      
       
      _Item._CompanyCode as _CompanyCodeText,
      _Item._BaseUnit,
      _Item._JournalEntry,
      _Fund,
      _PartnerFund,
      _Grant,
      _PartnerGrant,
      _BudgetPeriod,
      _PartnerBudgetPeriod,
      _FunctionalArea,
      _PartnerFunctionalArea       

}
where
  (
       _Item.ControllingBusTransacType = 'RKU2'
       and _Item.BusinessTransactionCategory = 'RKU2'     
  )
  and
  _Item.ReferenceDocumentType = 'COBK'
  and
  _Item.OriginCtrlgDebitCreditCode = 'H'
  and
  _Item._Ledger.IsLeadingLedger = 'X'
  and _Item.LogicalSystem = '' 
  and _Item._JournalEntry.SenderLogicalSystem = '' 
  and (_Item.SourceLedger = _Item._JournalEntry.LedgerGroup or _Item._JournalEntry.LedgerGroup = '' )