@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.sqlViewName: 'IALLOCRUNRES'
@AbapCatalog.buffering.status: #NOT_ALLOWED
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Allocation Run Result'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
define view I_AllocationRunResult
as select from alloc_run_res
association [0..1] to I_AllocationRun as _Run on $projection.UniversalAllocationRun = _Run.UniversalAllocationRun
// see I_JournalEntryItem for possible associations
{
key run_id as UniversalAllocationRun,
key cycle_key as AllocationCycle,
key sdate_key as AllocationCycleStartDate,
key cast( segment_key as fco_alloc_run_segment_number preserving type ) as AllocationCycleSegment,
key data_type as AllocationRunDataCategory,
key alloc_result_seqnr as AllocationRunResultItem,
rldnr as Ledger,
@Consumption.semanticObject: 'CompanyCode'
rbukrs as CompanyCode,
cast(gjahr as fis_gjahr preserving type ) as FiscalYear,
cast(belnr as farp_belnr_d preserving type ) as AccountingDocument,
// cast(docln as farp_buzei) as AccountingDocumentItem
// @Semantics.fiscal.year: true
cast(ryear as fis_ryear preserving type ) as LedgerFiscalYear,
rrcty as GLRecordType,
///////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_00 Unified Journal Entry: Transaction, Currencies, Units
///////////////////////////////////////////////////////////////////////////////
cast(rmvct as fis_rmvct preserving type) as FinancialTransactionType,
// vorgn,
// vrgng,
cast(bttype as fis_bttype preserving type) as BusinessTransactionType,
cast(awtyp as fis_awtyp preserving type) as ReferenceDocumentType,
cast(awsys as logsystem preserving type) as LogicalSystem,
cast(aworg as fis_aworg preserving type) as ReferenceDocumentContext,
awref as ReferenceDocument,
cast( awitem as fis_awitem preserving type ) as ReferenceDocumentItem,
cast( awitgrp as fis_awitgrp preserving type ) as ReferenceDocumentItemGroup,
subta as TransactionSubitem,
xreversing as IsReversal,
xreversed as IsReversed,
// xtruerev,
// awtyp_rev,
cast( aworg_rev as fis_aworg_rev preserving type ) as ReversalReferenceDocumentCntxt,
cast( awref_rev as fis_awref_rev preserving type ) as ReversalReferenceDocument,
// subta_rev,
xsettling as IsSettlement,
xsettled as IsSettled,
cast( prec_awtyp as fis_prec_awtyp preserving type ) as PredecessorReferenceDocType,
cast( prec_aworg as fis_prec_aworg preserving type ) as PredecessorReferenceDocCntxt,
cast( prec_awref as fis_prec_awref preserving type ) as PredecessorReferenceDocument,
cast( prec_awitem as fis_prec_awitem preserving type ) as PredecessorReferenceDocItem,
// prec_subta,
// prec_awmult,
// xsecondary,
cast( src_awtyp as fis_src_awtyp preserving type ) as SourceReferenceDocumentType,
cast( src_awsys as fis_src_awsys preserving type ) as SourceLogicalSystem,
cast( src_aworg as fis_src_aworg preserving type ) as SourceReferenceDocumentCntxt,
cast( src_awref as fis_src_awref preserving type ) as SourceReferenceDocument,
cast( src_awitem as fis_src_awitem preserving type ) as SourceReferenceDocumentItem,
cast( src_awsubit as fis_src_awsubit preserving type ) as SourceReferenceDocSubitem,
cast( xcommitment as fis_xcommitment preserving type ) as IsCommitment,
obs_reason as JrnlEntryItemObsoleteReason,
@Semantics.currencyCode:true
// cast(rtcur as alloc_run_fins_currt) as BalanceTransactionCurrency,
cast(rtcur as fis_rtcur preserving type) as BalanceTransactionCurrency,
@Semantics.currencyCode:true
cast(rwcur as fis_rwcur preserving type) as TransactionCurrency,
@Semantics.currencyCode:true
// cast(rhcur as alloc_run_fins_currh) as CompanyCodeCurrency,
cast(rhcur as fis_hwaer preserving type) as CompanyCodeCurrency,
@Semantics.currencyCode:true
cast(rkcur as fis_rkcur preserving type) as GlobalCurrency,
@Semantics.currencyCode:true
cast(rocur as fis_rocur preserving type) as FreeDefinedCurrency1,
@Semantics.currencyCode:true
cast(rvcur as fis_rvcur preserving type) as FreeDefinedCurrency2,
@Semantics.currencyCode:true
cast( rbcur as fis_curr3 preserving type ) as FreeDefinedCurrency3,
@Semantics.currencyCode:true
cast( rccur as fis_curr4 preserving type ) as FreeDefinedCurrency4,
@Semantics.currencyCode:true
cast( rdcur as fis_curr5 preserving type ) as FreeDefinedCurrency5,
@Semantics.currencyCode:true
cast( recur as fis_curr6 preserving type ) as FreeDefinedCurrency6,
@Semantics.currencyCode:true
cast(rfcur as fis_rfcur preserving type) as FreeDefinedCurrency7,
@Semantics.currencyCode:true
cast( rgcur as fis_curr8 preserving type ) as FreeDefinedCurrency8,
@Semantics.currencyCode:true
rco_ocur as ControllingObjectCurrency,
@Semantics.unitOfMeasure:true
runit as BaseUnit,
@Semantics.unitOfMeasure:true
cast(rvunit as fis_co_meinh preserving type) as CostSourceUnit,
// rrunit,
// riunit,
@Semantics.unitOfMeasure:true
cast( qunit1 as fis_qunit1 preserving type ) as AdditionalQuantity1Unit,
@Semantics.unitOfMeasure:true
cast( qunit2 as fis_qunit2 preserving type ) as AdditionalQuantity2Unit,
@Semantics.unitOfMeasure:true
cast( qunit3 as fis_qunit3 preserving type ) as AdditionalQuantity3Unit,
// co_meinh,
cast(racct as fis_racct preserving type) as GLAccount,
///////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_GL_ACCAS Universal Journal Entry: G/L additional account assignments
///////////////////////////////////////////////////////////////////////////////
cast(rcntr as fis_kostl preserving type) as CostCenter,
cast(prctr as fis_prctr preserving type) as ProfitCenter,
cast(rfarea as fm_farea preserving type) as FunctionalArea,
cast(rbusa as fis_rbusa preserving type) as BusinessArea,
cast(kokrs as fis_kokrs preserving type) as ControllingArea,
cast(segment as fco_reporting_segment preserving type ) as ReportingSegment,
cast(scntr as fis_skost preserving type) as PartnerCostCenter,
cast(pprctr as fis_pprctr preserving type) as PartnerProfitCenter,
cast(sfarea as fis_sfkber preserving type) as PartnerFunctionalArea,
cast(sbusa as fis_pargb preserving type) as PartnerBusinessArea,
cast(rassc as fis_rassc preserving type) as PartnerCompany,
psegment as PartnerSegment,
///////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_VALUE_DATA Universal Journal Entry: Value Fields
///////////////////////////////////////////////////////////////////////////////
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'BalanceTransactionCurrency'} }
cast(tsl as fis_tsl preserving type) as AmountInBalanceTransacCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
cast(wsl as fis_wsl preserving type) as AmountInTransactionCurrency,
// wsl2,
// wsl3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
cast(hsl as alloc_run_fins_vhcur12 preserving type ) as AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(ksl as alloc_run_fins_vkcur12 preserving type ) as AmountInGlobalCurrency,
@Semantics.currencyCode:true
rfccur as FunctionalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
cast(fcsl as fis_vfccur12 preserving type) as AmountInFunctionalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
cast(osl as fis_osl preserving type) as AmountInFreeDefinedCurrency1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
cast(vsl as fis_vsl preserving type) as AmountInFreeDefinedCurrency2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
cast(bsl as fis_bsl preserving type) as AmountInFreeDefinedCurrency3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
cast(csl as fis_csl preserving type) as AmountInFreeDefinedCurrency4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
cast(dsl as fis_dsl preserving type) as AmountInFreeDefinedCurrency5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
cast(esl as fis_esl preserving type) as AmountInFreeDefinedCurrency6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
cast(fsl as fis_fsl preserving type) as AmountInFreeDefinedCurrency7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
cast(gsl as fis_gsl preserving type) as AmountInFreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(kfsl as fis_kfsl preserving type) as FixedAmountInGlobalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast( kfsl2 as fis_vgcur12_fix2 preserving type ) as GrpValnFixedAmtInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast( kfsl3 as fis_vgcur12_fix3 preserving type ) as PrftCtrValnFxdAmtInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(psl as fis_psl preserving type) as TotalPriceVarcInGlobalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast( psl2 as fis_vpcur12_2 preserving type ) as GrpValnTotPrcVarcInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast( psl3 as fis_vpcur12_3 preserving type ) as PrftCtrValnTotPrcVarcInGlbCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast(pfsl as fis_pfsl preserving type) as FixedPriceVarcInGlobalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast( pfsl2 as fis_vpfcur12_2 preserving type ) as GrpValnFixedPrcVarcInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast( pfsl3 as fis_vpfcur12_3 preserving type ) as PrftCtrValnFxdPrcVarcInGlbCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
cast( co_osl as fis_vco_ocur12 preserving type ) as AmountInObjectCurrency,
// hslalt,
// kslalt,
// oslalt,
// vslalt,
// bslalt,
// cslalt,
// dslalt,
// eslalt,
// fslalt,
// gslalt,
// hslext,
// kslext,
// oslext,
// vslext,
// bslext,
// cslext,
// dslext,
// eslext,
// fslext,
// gslext,
// hvkwrt,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
msl as Quantity,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
cast( mfsl as fis_quan1_12_fix preserving type ) as FixedQuantity,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'CostSourceUnit'} }
cast( vmsl as fis_vquan1_12 preserving type ) as ValuationQuantity,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'CostSourceUnit'} }
cast( vmfsl as fis_vquan1_12_fix preserving type ) as ValuationFixedQuantity,
// rmsl,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'AdditionalQuantity1Unit'} }
cast( quant1 as fis_quan1_l preserving type ) as AdditionalQuantity1,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'AdditionalQuantity2Unit'} }
cast( quant2 as fis_quan2_l preserving type ) as AdditionalQuantity2,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'AdditionalQuantity3Unit'} }
cast( quant3 as fis_quan3_l preserving type ) as AdditionalQuantity3,
// co_megbtr,
// co_mefbtr,
// hsalk3,
// ksalk3,
// osalk3,
// vsalk3,
// hsalkv,
// ksalkv,
// osalkv,
// vsalkv,
// hpvprs,
// kpvprs,
// opvprs,
// vpvprs,
// hstprs,
// kstprs,
// ostprs,
// vstprs,
// hvksal,
// lbkum,
/////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_FIX Unified Journal Entry: Mandatory fields for G/L
////////////////////////////////////////////////////////////////////////////
cast(drcrk as fis_shkzg preserving type) as DebitCreditCode,
@Semantics.fiscal.period: true
cast(poper as fins_fiscalperiod preserving type) as FiscalPeriod,
@Semantics.fiscal.yearVariant: true
cast(periv as fis_periv preserving type) as FiscalYearVariant,
@Semantics.fiscal.yearPeriod: true
cast(fiscyearper as fis_jahrper_conv preserving type ) as FiscalYearPeriod,
cast(budat as fis_budat preserving type) as PostingDate,
cast(bldat as fis_bldat preserving type) as DocumentDate,
cast(blart as fis_blart preserving type) as AccountingDocumentType,
cast(buzei as fis_buzei preserving type) as AccountingDocumentItem,
cast(zuonr as fis_zuonr preserving type) as AssignmentReference,
cast(bschl as fis_bschl preserving type) as PostingKey,
cast(bstat as fis_bstat preserving type) as AccountingDocumentCategory,
// linetype,
cast(ktosl as fac_ktosl preserving type) as TransactionTypeDetermination,
slalittype as SubLedgerAcctLineItemType,
// xsplitmod,
cast(usnam as fis_usnam preserving type) as AccountingDocCreatedByUser,
cast( timestamp as fis_chng_tstamp preserving type ) as LastChangeDateTime,
cast( timestamp as fis_crea_tstamp preserving type ) as CreationDateTime,
cast( eprctr as fis_eprctr preserving type ) as EliminationProfitCenter,
cast(rhoart as fis_hoart preserving type) as OriginObjectType,
glaccount_type as GLAccountType,
cast(ktopl as fis_ktopl preserving type) as ChartOfAccounts,
cast(lokkt as fis_altkt_skb1 preserving type) as AlternativeGLAccount,
cast(ktop2 as fis_ktop2 preserving type) as CountryChartOfAccounts,
cast( xsplitmod as xsplitmod_acd preserving type ) as ItemIsSplit,
///////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_GEN Unified Journal Entry: Fields for several subledgers
//////////////////////////////////////////////////////////////////////////
cast(rebzg as fis_rebzg preserving type) as InvoiceReference,
cast(rebzj as fis_rebzj preserving type) as InvoiceReferenceFiscalYear,
cast(rebzz as fis_rebzz preserving type) as InvoiceItemReference,
cast( rebzt as fis_rebzt preserving type ) as FollowOnDocumentType,
// cast(rebzt as alloc_run_ref_po_category preserving type) as ReferencePurchaseOrderCategory,
cast(rbest as fis_refbtyp preserving type) as ReferencePurchaseOrderCategory,
cast(ebeln as fis_ebeln preserving type) as PurchasingDocument,
cast(ebelp as fis_ebelp preserving type) as PurchasingDocumentItem,
cast( zekkn as fis_dzekkn preserving type ) as AccountAssignmentNumber,
cast(sgtxt as farp_sgtxt preserving type) as DocumentItemText,
cast(kdauf as vdm_sales_order preserving type) as SalesOrder,
cast(kdpos as posnr_va preserving type) as SalesDocumentItem,
@VDM.lifecycle.status: #DEPRECATED
@VDM.lifecycle.successor: 'Product'
matnr as Material,
werks as Plant,
cast(lifnr as md_supplier preserving type) as Supplier,
cast(kunnr as kunnr preserving type) as Customer,
fbuda as ServicesRenderedDate,
coco_num as ConditionContract,
/////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_FI Unified Journal Entry: Fields for FI subledgers
/////////////////////////////////////////////////////////////////////////
cast(koart as farp_koart preserving type) as FinancialAccountType,
cast(umskz as fac_umskz preserving type) as SpecialGLCode,
cast(mwskz as fis_mwskz preserving type) as TaxCode,
cast(hbkid as farp_hbkid preserving type) as HouseBank,
cast(hktid as fac_hktid preserving type) as HouseBankAccount,
cast(xopvw as fis_xopvw preserving type) as IsOpenItemManaged,
cast(augdt as fis_augdt preserving type) as ClearingDate,
cast(augbl as fis_augbl preserving type) as ClearingAccountingDocument,
cast(auggj as fis_auggj preserving type) as ClearingDocFiscalYear,
/////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_FAA Unified Journal Entry: Fields for Asset Accounting
/////////////////////////////////////////////////////////////////////////
cast(afabe as fis_afabe_d preserving type) as AssetDepreciationArea,
cast(anln1 as fis_anln1 preserving type) as MasterFixedAsset,
cast(anln2 as fis_anln2 preserving type) as FixedAsset,
bzdat as AssetValueDate,
anbwa as AssetTransactionType,
movcat as AssetAcctTransClassfctn,
cast(depr_period as fis_peraf preserving type) as DepreciationFiscalPeriod,
cast(anlgr as fis_anlgr preserving type) as GroupMasterFixedAsset,
cast(anlgr2 as fis_anlgr2 preserving type) as GroupFixedAsset,
// settlement_rule,
anlkl as AssetClass,
//////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_ML Unified Journal Entry: Fields for Material Ledger
//////////////////////////////////////////////////////////////////////////
// ktogr,
// panl1,
// panl2,
// ubzdt_pn,
// xvabg_pn,
// prozs_pn,
// xmanpropval_pn,
cast(kalnr as fis_kalnr preserving type) as CostEstimate,
// vprsv,
// mlast,
cast( kzbws as fis_inventoryspclstockvalntype preserving type ) as InventorySpecialStockValnType,
// xobew,
cast( sobkz as fis_inventoryspecialstocktype preserving type ) as InventorySpecialStockType,
// vtstamp,
cast( mat_kdauf as fis_mlmat_kdauf preserving type ) as InventorySpclStkSalesDocument, // as InventorySpecialStockSalesDocument,
cast( mat_kdpos as fis_mlmat_kdpos preserving type ) as InventorySpclStkSalesDocItm, // as InventorySpecialStockSalesDocumentItem,
cast( mat_pspnr as fis_invspstock_wbsint_no_conv preserving type ) as InvtrySpclStockWBSElmntIntID,
cast( mat_ps_posid as fis_invspstock_wbs_no_conv preserving type ) as InventorySpclStockWBSElement,
// as InventorySpecialStockWBSElement,
cast(mat_lifnr as fis_mlmat_lifnr preserving type) as InventorySpecialStockSupplier,
cast( bwtar as fis_bwtar_d preserving type ) as InventoryValuationType,
bwkey as ValuationArea,
// hpeinh,
// kpeinh,
// opeinh,
// vpeinh,
// mlptyp,
// mlcateg,
// qsbvalt,
// qsprocess,
// perart,
// mlposnr,
// inv_mov_categ,
////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_CFIN Unified Journal Entry: Fields for Central Finance
//////////////////////////////////////////////////////////////////////////////
cast( bukrs_sender as fis_bukrs_sender preserving type ) as SenderCompanyCode,
//@ObjectModel.foreignKey.association: '_SenderGLAccount'
racct_sender as SenderGLAccount,
cast( accas_sender as fis_accas_sender preserving type ) as SenderAccountAssignment,
cast( accasty_sender as fis_accasty_sender preserving type ) as SenderAccountAssignmentType,
////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_CO Unified Journal Entry: CO fields
///////////////////////////////////////////////////////////////////////////
cast( objnr as fis_objnr preserving type) as ControllingObject,
// hrkft,
hkgrp as CostOriginGroup,
// parob1,
// parobsrc,
cast( uspob as fis_uspob preserving type) as OriginSenderObject,
cast( co_belkz as fis_co_belkz preserving type ) as ControllingDebitCreditCode,
// co_beknz,
cast( beltp as fis_bp_inout preserving type ) as ControllingObjectDebitType,
muvflg as QuantityIsIncomplete,
cast(gkont as fis_gkont preserving type) as OffsettingAccount,
cast( gkoar as fis_gkoar preserving type ) as OffsettingAccountType,
cast(erlkz as fis_kblerlkz preserving type) as LineItemIsCompleted,
pernr as PersonnelNumber,
// paobjnr,
// xpaobjnr_co_rel,
cast( scope as alloc_run_scope_cv preserving type ) as ControllingObjectClass,
// logsyso,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_CompanyCodeStdVH',
element: 'CompanyCode' }
}]
cast( pbukrs as fis_pbukrs preserving type ) as PartnerCompanyCode,
cast( pscope as alloc_run_partner_obj_class preserving type ) as PartnerControllingObjectClass,
// logsysp,
// bwstrat,
// objnr_hk,
// aufnr_org,
cast(ukostl as fis_usp_kostl preserving type) as OriginCostCenter,
cast(ulstar as fins_usp_lstar preserving type) as OriginCostCtrActivityType,
// uprznr,
uprctr as OriginProfitCenter,
accas as AccountAssignment,
cast(accasty as fis_accasty preserving type) as AccountAssignmentType,
lstar as CostCtrActivityType,
cast(aufnr as fis_aufnr preserving type) as OrderID,
autyp as OrderCategory,
cast( ps_psp_pnr as fis_wbsint_no_conv preserving type ) as WBSElementInternalID,
cast( ps_posid as fis_wbs preserving type ) as WBSElement,
cast( ps_posid as fis_wbsext_no_conv preserving type ) as WBSElementExternalID,
cast( ps_prj_pnr as fis_projectint_no_conv preserving type ) as ProjectInternalID,
cast( ps_pspid as fis_project preserving type ) as Project,
nplnr as ProjectNetwork,
nplnr_vorgn as RelatedNetworkActivity,
prznr as BusinessProcess,
kstrg as CostObject,
cast(bemot as fis_bemot preserving type ) as BillableControl,
cast(rsrce as fis_co_resource preserving type ) as CostAnalysisResource,
cast( qmnum as fis_qmnum preserving type ) as CustomerServiceNotification,
service_doc_type as ServiceDocumentType,
service_doc_id as ServiceDocument,
service_doc_item_id as ServiceDocumentItem,
service_contract_type as ServiceContractType,
service_contract_id as ServiceContract,
service_contract_item_id as ServiceContractItem,
cast(solution_order_id as crms4_solo_object_id preserving type ) as BusinessSolutionOrder,
cast(solution_order_item_id as crms4_solo_number_int preserving type ) as BusinessSolutionOrderItem,
cast( vtkey as fis_vtkey_kk preserving type ) as CAProviderContract,
cast( vtpos as fis_vtpos_kk preserving type ) as CAProviderContractItemNumber,
overtimecat as TimeSheetOvertimeCategory,
cast( ps_posid as /cpd/plan_item_id ) as WorkPackage,
work_item_id as WorkItem,
erkrs as OperatingConcern,
cast(paccas as fis_paccas preserving type) as PartnerAccountAssignment,
cast(paccasty as fins_paccasty preserving type) as PartnerAccountAssignmentType,
cast(plstar as fis_par_lstar preserving type) as PartnerCostCtrActivityType,
cast(paufnr as fis_par_aufnr preserving type) as PartnerOrder,
cast(pautyp as fis_par_auftyp preserving type) as PartnerOrderCategory,
// @Analytics.internalName: #LOCAL
cast( pps_psp_pnr as fis_partner_wbsint_no_conv preserving type ) as PartnerWBSElementInternalID,
cast( pps_posid as fis_partner_wbs preserving type ) as PartnerWBSElement,
// @Analytics.internalName: #LOCAL
cast( pps_prj_pnr as fis_part_projectint_no_conv preserving type ) as PartnerProjectInternalID,
cast( pps_pspid as fis_part_project_no_conv preserving type ) as PartnerProject,
cast(pkdauf as fis_par_kdauf preserving type) as PartnerSalesDocument,
cast(pkdpos as fis_par_kdpos preserving type) as PartnerSalesDocumentItem,
// ppaobjnr,
cast( pnplnr as fis_par_npln preserving type ) as PartnerProjectNetwork,
cast( pnplnr_vorgn as fis_par_vornr_auf preserving type ) as PartnerProjectNetworkActivity,
cast( pprznr as fis_par_prznr preserving type ) as PartnerBusinessProcess,
pkstrg as PartnerCostObject,
// pservice_doc_type,
// pservice_doc_id,
// pservice_doc_item_id,
// co_accasty_n1,
// co_accasty_n2,
// co_accasty_n3,
// co_zlenr,
// co_belnr,
// co_buzei,
// co_buzei1,
// co_buzei2,
// co_buzei5,
// co_buzei6,
// co_buzei7,
// co_refbz,
// co_refbz1,
// co_refbz2,
// co_refbz5,
// co_refbz6,
// co_refbz7,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_COPA Unified Journal Entry: CO-PA fields
//////////////////////////////////////////////////////////////////////
fkart as BillingDocumentType,
vkorg as SalesOrganization,
vtweg as DistributionChannel,
spart as OrganizationDivision,
cast (matnr_copa as fins_matnr_pa preserving type) as SoldProduct,
cast (matkl as productgroup preserving type) as SoldProductGroup,
kdgrp as CustomerGroup,
cast( land1 as fis_land1_gp preserving type ) as CustomerSupplierCountry,
cast( brsch as fis_brsch preserving type ) as CustomerSupplierIndustry,
bzirk as SalesDistrict,
kunre as BillToParty,
kunwe as ShipToParty,
cast( konzs as fis_konzs preserving type ) as CustomerSupplierCorporateGroup,
// acdoc_copa_eew_dummy_pa,
// bonus_pa as VolumeRebateGroup,
// vkgrp_pa as SalesGroup,
// maabc_pa as MaterialABCClassification,
// vkbur_pa as SalesOffice,
// eform_pa,
// gebie_pa,
// wwfzm_pa,
// kmvkbu_pa,
// kmvtnr_pa,
// kmwnhg_pa as MaterialGroup,
// wwfzc_pa,
// wwflg_pa,
// brsch_pa as CustomerSupplierIndustry,
// wwfzl_pa,
// wwfzr_pa,
// partner_pa,
// prodh_pa as ProductHierarchy,
// kmkdgr_pa as CustomerGroup,
// kmland_pa,
// saisj_pa,
// saiso_pa,
// wwg01_pa,
// wwg02_pa,
// wwg03_pa,
// wwg04_pa,
// wwg05_pa,
// wwg06_pa,
// kmatyp_pa,
// kmopdy_pa,
// ww020_pa as CostOriginGroup,
// ww021_pa,
// wwgg1_pa,
// wwcst_pa,
// posar_pa,
// wwprc_pa,
// kmorig_pa,
// colle_pa,
// wwex1_pa,
// wwex2_pa,
// wwex3_pa,
// crmcsty_pa,
// crmelem_pa,
// ww111_pa,
// dummy_mrkt_sgmnt_eew_ps,
// re_bukrs,
// re_account,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_PS Unified Journal Entry: Fields for Public Sector
/////////////////////////////////////////////////////////////////////
cast('A000' as fikrs preserving type ) as FinancialManagementArea, // temporary for public sector
cast(fistl as farp_fistl preserving type) as FundsCenter,
measure as FundedProgram,
rfund as Fund,
rgrant_nbr as GrantID,
rbudget_pd as BudgetPeriod,
sfund as PartnerFund,
sgrant_nbr as PartnerGrant,
cast( sbudget_pd as fis_fm_pbudget_period preserving type ) as PartnerBudgetPeriod,
// bdgt_account,
// bdgt_account_cocode,
// bdgt_cnsmpn_date,
// bdgt_cnsmpn_period,
// bdgt_cnsmpn_year,
// bdgt_relevant,
// bdgt_cnsmpn_type,
// bdgt_cnsmpn_amount_type,
///////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_JVA Unified Journal Entry: Fields for Joint Venture Accounting
///////////////////////////////////////////////////////////////////////
vname as JointVenture,
cast( egrup as jv_egroup_cds preserving type ) as JointVentureEquityGroup,
cast( recid as jv_recind_cds preserving type ) as JointVentureCostRecoveryCode,
cast( vptnr as jv_part_cds preserving type ) as JointVenturePartner,
cast( btype as jv_bilind_cds preserving type ) as JointVentureBillingType,
cast( etype as jv_etype_cds preserving type ) as JointVentureEquityType,
cast( prodper as jv_prodper_cds preserving type ) as JointVentureProductionDate,
cast( billm as jv_billm_cds preserving type ) as JointVentureBillingDate,
cast( pom as jv_pom_cds preserving type ) as JointVentureOperationalDate,
cast( cbrunid as jv_cbrunid_cds preserving type ) as CutbackRun,
cast( jvactivity as jv_activity_cds preserving type ) as JointVentureAccountingActivity,
cast( pvname as fco_alloc_run_partner_venture preserving type ) as PartnerVenture,
cast( pegrup as jv_pegrup_cds preserving type ) as PartnerEquityGroup,
cast( s_recind as jv_srecind_cds preserving type ) as SenderCostRecoveryCode,
cast( cbracct as jv_cbracct_cds preserving type ) as CutbackAccount,
cast( cbobjnr as jv_cbobjnr_cds preserving type ) as CutbackCostObject,
///////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_RE STRU 0 0 Unified Journal Entry: Fields for Real Estate
///////////////////////////////////////////////////////////////////////
cast(swenr as rebdvdmbeno preserving type ) as REBusinessEntity,
cast(sgenr as rebdvdmbuno preserving type ) as RealEstateBuilding,
cast(sgrnr as rebdvdmprno preserving type ) as RealEstateProperty,
cast(smenr as rebdvdmrono preserving type ) as RERentalObject,
cast(recnnr as recnvdmcnnr preserving type ) as RealEstateContract,
cast(snksl as rescvdmsckey preserving type ) as REServiceChargeKey,
cast(sempsl as rescvdmsuid preserving type ) as RESettlementUnitID,
cast( dabrz as fis_dabrbez preserving type ) as SettlementReferenceDate,
cast(pswenr as rebdvdmpbeno preserving type ) as REPartnerBusinessEntity,
cast(psgenr as rebdvdmpbuno preserving type ) as RealEstatePartnerBuilding,
cast(psgrnr as rebdvdmpprno preserving type ) as RealEstatePartnerProperty,
cast(psmenr as rebdvdmprono preserving type ) as REPartnerRentalObject,
cast(precnnr as recnvdmpcnnr preserving type ) as RealEstatePartnerContract,
cast(psnksl as rescvdmpsckey preserving type ) as REPartnerServiceChargeKey,
cast(psempsl as rescvdmpsuid preserving type ) as REPartnerSettlementUnitID,
cast(pdabrz as fins_par_dabrbez preserving type ) as PartnerSettlementReferenceDate,
///////////////////////////////////////////////////////////////////////
// newly added fields
///////////////////////////////////////////////////////////////////////
vrgng as ControllingBusTransacType,
prec_bukrs as PrdcssrJournalEntryCompanyCode,
cast(prec_gjahr as fins_prec_gjahr_gfc_no_conv preserving type ) as PrdcssrJournalEntryFiscalYear,
prec_belnr as PredecessorJournalEntry,
prec_docln as PredecessorJournalEntryItem,
orgl_change as OrganizationalChange,
@Semantics.currencyCode:true
rgm_ocur as GrantCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GrantCurrency'} }
gm_osl as AmountInGrantCurrency,
@Semantics.unitOfMeasure:true
cast( rrunit as fis_ref_qty_uom preserving type ) as ReferenceQuantityUnit,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'ReferenceQuantityUnit'} }
rmsl as ReferenceQuantity,
cast(kdauf as vbeln_va preserving type) as SalesDocument,
cast (matnr as productnumber preserving type ) as Product,
perop_beg as PerformancePeriodStartDate,
perop_end as PerformancePeriodEndDate,
tax_country as TaxCountry,
valut as ValueDate,
co_beknz as OriginCtrlgDebitCreditCode,
cast(umatnr as fis_origin_matnr preserving type) as OriginProduct,
cast(varc_uacct as fis_varc_origin_acct preserving type) as VarianceOriginGLAccount,
cast( pservice_doc_type as fis_psrvdoc_type preserving type ) as PartnerServiceDocumentType,
cast( pservice_doc_id as fis_psrvdoc_id preserving type ) as PartnerServiceDocument,
cast( pservice_doc_item_id as fis_psrvdoc_item_id preserving type ) as PartnerServiceDocumentItem,
re_bukrs as CashLedgerCompanyCode,
re_account as CashLedgerAccount,
bdgt_account as PubSecBudgetAccount,
bdgt_account_cocode as PubSecBudgetAccountCoCode,
bdgt_cnsmpn_date as PubSecBudgetCnsmpnDate,
bdgt_cnsmpn_period as PubSecBudgetCnsmpnFsclPeriod,
bdgt_cnsmpn_year as PubSecBudgetCnsmpnFsclYear,
bdgt_relevant as PubSecBudgetIsRelevant,
bdgt_cnsmpn_type as PubSecBudgetCnsmpnType,
bdgt_cnsmpn_amount_type as PubSecBudgetCnsmpnAmtType,
rsponsored_prog as SponsoredProgram,
rsponsored_class as SponsoredClass,
///////////////////////////////////////////////////////////////////////
// Allocation Fields
///////////////////////////////////////////////////////////////////////
stagr as StatisticalKeyFigure,
// rvers,
category as AllocationCycleCategory,
// cycle as AllocationCycle,
cyctxt as AllocationCycleNameText,
cast(substring(cycle, 3, 8) as fco_alloc_cycle preserving type ) as AllocationCycleName,
// sdate,
// type,
// seqnr as AllocationCycleSegment,
seqname as SegmentName,
seqtxt as SegmentNameDescription,
_Run.AllocationActualPlanVariant,
_Run.AllocationPostingType,
_Run.AllocationType,
_Run.AllocationRunType
}