P_ACDOCA

CDS View

P_ACDOCA is a CDS View in S/4HANA. It contains 60 fields. 13 CDS views read from this table.

CDS Views using this table (13)

ViewTypeJoinVDMDescription
aro_gross_spend_amount view from ARO Gross Spend Amount - CC Currency
FARR_JournalEntryItem view from Revenue Accounting-ACDOCA Extended View
I_AROAcctPostingLineItemData view from BASIC ARO Account Posting Line Item Data
I_GLAccountLineItemRawData view from BASIC Raw Data of G/L Account Line Item
I_GteeMBlldElmntItmCube view from BASIC Grantee Mgmt Billed Element Item - Cube
I_PubSecCmtmtAgingBasic view from BASIC commitment aging basic view
I_RAJournalEntryItem view_entity from COMPOSITE Revenue Accounting VDM Extending ACDOCA
P_DMVCGLAccItemProfitCenter view from COMPOSITE
P_DMVCGLAccLineItemEdge view inner COMPOSITE
P_DMVCMatlActyProcessCategory view left_outer COMPOSITE
P_DMVCOrderDetail view from BASIC
P_DrctCarryFwdDeltaPostgByQ view from COMPOSITE
P_DrctCarryFwdDeltaPostgByQ view union_all COMPOSITE

Fields (60)

KeyField CDS FieldsUsed in Views
KEY awitem awitem 1
KEY aworg aworg,ReferenceDocumentContext 3
KEY awref awref,ReferenceDocument 3
KEY awtyp awtyp,OriginalReferenceDocumentType 3
KEY belnr AccountingDocument,Belnr 7
KEY docln Docln,GLAccountLineItem,LedgerGLLineItem 7
KEY drcrk DebitCreditCode,SHKZG 2
KEY gjahr FiscalYear,Gjahr 6
KEY ktosl ktosl,TransactionKey 2
KEY ra_contract_id CONTRACT_ID,RevenueAccountingContract 3
KEY ra_pob_id PerformanceObligation,POB_ID 3
KEY rbukrs COMPANY_CODE,CompanyCode,rbukrs,SourceCompanyCode 8
KEY rldnr Ledger,Rldnr,SourceLedger 5
KEY slalittype slalittype,SubLedgerAcctLineItemType 2
aufnr aufnr,OrderID,ProductionOrder 3
augbl ClearingAccountingDocument 1
augdt ClearingDate 1
awsys awsys,ReferenceDocumentLogicalSystem 2
bstat bstat 1
budat budat,PostingDate 2
bwkey bwkey 1
ebeln PurchasingDocument 1
ebelp PurchasingDocumentItem 1
fiscyearper FiscalYearPeriod 1
kalnr CostEstimate,kalnr 2
kdauf kdauf,SalesOrder 3
kdpos kdpos,SalesOrderItem 2
koart FinancialAccountType 1
kunnr Customer 1
matnr matnr 1
mig_source mig_source 1
mlptyp mlptyp,ProcessCategory 2
netdt NetDueDate 1
paobjnr paobjnr 2
periv FiscalYearVariant 1
poper FiscalPeriod,poper 2
prctr prctr,ProfitCenter 4
ps_psp_pnr ps_psp_pnr 1
qsprocess ProductionProcess,qsprocess 2
racct GLAccount,HKONT 3
rbcur FreeCurrency3 1
rbusa BusinessArea,GSBER 2
rccur FreeCurrency4 1
rcntr CostCenter,KOSTL 2
rdcur FreeCurrency5 1
recur FreeCurrency6 1
rfarea FKBER,FunctionalArea 2
rfcur FreeCurrency7 1
rgcur FreeCurrency8 1
rgrant_nbr GrantID 1
rhcur CompanyCodeCurrency 1
rkcur GlobalCurrency 1
rocur FreeCurrency1 1
rsponsored_prog SponsoredProgram 1
rvcur FreeCurrency2 1
rwcur DocumentCurrency,SalesDocumentCurrency,TransactionCurrency 3
segment segment 2
timestamp RAPostingItemLastChgDateTime,timestamp 4
valobj_id Valobj_Id 1
valobjtype ValobjType 1
//@EndUserText.label: 'Private view on ACDOCA without logic'

@AbapCatalog.sqlViewName: 'PFIACDOCA'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
define view P_ACDOCA
  as select from acdoca

  //            inner join finsc_ld_cmp      on acdoca.rldnr = finsc_ld_cmp.rldnr and acdoca.rbukrs = finsc_ld_cmp.bukrs


{
  key cast(acdoca.rldnr       as fins_ledger_pers preserving type)  as rldnr,
  key cast(acdoca.rbukrs      as fis_bukrs preserving type)         as rbukrs,
  key cast(acdoca.gjahr       as fis_gjahr_no_conv preserving type) as gjahr,
  key cast(acdoca.belnr       as fis_belnr preserving type)         as belnr,
  key cast(acdoca.docln       as fis_docln preserving type)         as docln,


      cast(acdoca.ryear       as fis_ryear_no_conv preserving type) as ryear,
      acdoca.rrcty,
      cast(acdoca.docnr_ld    as fis_docnr_ld preserving type)      as DOCNR_LD,

      ///////////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_00  Unified Journal Entry: Transaction, Currencies, Units

      ///////////////////////////////////////////////////////////////////////////////

      cast(rmvct as fis_rmvct preserving type)                     as rmvct,
      cast(vorgn as fis_vorgn preserving type )                    as vorgn,
      vrgng,
      cast(bttype as fis_bttype preserving type) as bttype,
      cast(cbttype as fis_custbttype preserving type) as cbttype,
      cast(closingstep as fis_closingstep preserving type) as closingstep,
      cast(awtyp as fis_awtyp preserving type)                     as awtyp,
      cast(awsys as logsystem preserving type)                     as awsys,
      cast(aworg as fis_aworg preserving type)                     as aworg,
      awref,
      awitem,
      awitgrp,
      subta,
      cast( acctg_notif_uuid as fis_hdr_technical_id preserving type ) as ACCTG_NOTIF_UUID,
      cast( offstg_docln as fis_offsetting_docln preserving type ) as offstg_docln,
      xreversing,
      xreversed,
      xtruerev,
      cast(awtyp_rev as fis_awtyp_rev preserving type ) as awtyp_rev,
      aworg_rev,
      awref_rev,
      cast( subta_rev as fis_subta_rev preserving type ) as subta_rev,
      xsettling,
      xsettled,
      prec_awtyp,
      prec_aworg,
      prec_awref,
      prec_awitem,
      prec_subta,
      prec_bukrs,
      cast( prec_gjahr as fins_prec_gjahr_gfc_no_conv preserving type ) as prec_gjahr,
      prec_belnr,
      prec_docln,

      src_awtyp,
      src_awsys,
      src_aworg,
      src_awref,
      src_awitem,
      src_awsubit,
      xcommitment,
      cast( obs_reason as fis_obsolete_item_reason preserving type ) as obs_reason,
      cast( xsecondary as journalentryissecondaryentry ) as XSECONDARY,
      closing_run_id,
      orgl_change,

      cast(racct as fis_racct preserving type)                     as racct,


      ////////////////////////////////////////////////////////////////////////////////////

      // .INCLUDE  ACDOC_SI_GL_ACCAS Unified Journal Entry: G/L additional account assignments

      ////////////////////////////////////////////////////////////////////////////////////

      cast(rcntr as fis_kostl preserving type)                     as rcntr,
      cast(prctr as fis_prctr preserving type)                     as prctr,
      cast(rfarea as fm_farea preserving type)                     as rfarea,
      cast(rbusa as fis_rbusa preserving type)                     as rbusa,
      cast(kokrs as fis_kokrs preserving type)                     as kokrs,
      segment,
      cast(scntr as fis_skost preserving type)                     as scntr,
      cast(pprctr as fis_pprctr preserving type)                   as pprctr,
      cast(sfarea as fis_sfkber preserving type)                   as sfarea,
      cast(sbusa as fis_pargb preserving type)                     as sbusa,
      cast(rassc as fis_rassc preserving type)                     as rassc,
      psegment,


      /////////////////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_VALUE_DATA Unified Journal Entry: Value Fields

      /////////////////////////////////////////////////////////////////////////////////////


      @Semantics.currencyCode:true
      cast(rtcur as fis_rtcur preserving type)                     as rtcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rtcur'} }
      cast(tsl as fis_tsl preserving type)                         as tsl,

      @Semantics.currencyCode:true
      cast(rwcur as fis_rwcur preserving type)                     as rwcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rwcur'} }
      cast(wsl as fis_wsl preserving type)                         as wsl,

      @Semantics.currencyCode:true
      cast(rhcur as fis_hwaer preserving type)                     as rhcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rhcur'} }
      cast(hsl as fis_hsl preserving type)                         as hsl,
      @Semantics: { amount : {currencyCode: 'rhcur'} }
      hvkwrt,

      @Semantics.currencyCode:true
      cast(rkcur as fis_rkcur preserving type)                     as rkcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      cast(ksl as fis_ksl preserving type)                         as ksl,

      // Functional Currency

      @Semantics.currencyCode:true
      rfccur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rfccur'} }
      cast(fcsl as fis_vfccur12 preserving type)                   as fcsl,

      // Freely Defined Currency 1

      @Semantics.currencyCode:true
      cast(rocur as fis_rocur preserving type)                     as rocur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rocur'} }
      cast(osl as fis_osl preserving type)                         as osl,

      // Freely Defined Currency 2

      @Semantics.currencyCode:true
      cast(rvcur as fis_rvcur preserving type)                     as rvcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rvcur'} }
      cast(vsl as fis_vsl preserving type)                         as vsl,

      // Freely Defined Currency 3

      @Semantics.currencyCode:true
      rbcur                                                        as rbcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rbcur'} }
      cast(bsl as fis_bsl preserving type)                         as bsl,

      // Freely Defined Currency 4

      @Semantics.currencyCode:true
      rccur                                                        as rccur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rccur'} }
      cast(csl as fis_csl preserving type)                         as csl,

      // Freely Defined Currency 5

      @Semantics.currencyCode:true
      rdcur                                                        as rdcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rdcur'} }
      cast(dsl as fis_dsl preserving type)                         as dsl,

      // Freely Defined Currency 6

      @Semantics.currencyCode:true
      recur                                                        as recur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'recur'} }
      cast(esl as fis_esl preserving type)                         as esl,

      // Freely Defined Currency 7

      @Semantics.currencyCode:true
      cast(rfcur as fis_rfcur preserving type)                     as rfcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rfcur'} }
      cast(fsl as fis_fsl preserving type)                         as fsl,

      // Freely Defined Currency 8

      @Semantics.currencyCode:true
      rgcur                                                        as rgcur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rgcur'} }
      cast(gsl as fis_gsl preserving type)                         as gsl,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      cast(kfsl as fis_kfsl preserving type)                       as kfsl,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      kfsl2                                                        as kfsl2,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      kfsl3                                                        as kfsl3,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rhcur'} }
      case when ksl = 0 or kfsl = 0 then cast('0' as fis_hfsl) else
        cast(
          cast(
            cast( cast( hsl as abap.dec(23,2) ) as abap.d34n ) *
      //CAST(CURR AS D34N) not allowed, use detour through fixed point DEC

            cast( cast( kfsl as abap.dec(23,2) ) as abap.d34n ) /
            cast( cast( ksl as abap.dec(23,2) ) as abap.d34n )
           as abap.dec(23,2) )
         as fis_hfsl )
         end as hfsl,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rwcur'} }
      case when ksl = 0 or kfsl = 0 then cast('0' as fis_wfsl) else
        cast(
          cast(
            cast( cast( wsl as abap.dec(23,2) ) as abap.d34n ) *
      //CAST(CURR AS D34N) not allowed, use detour through fixed point DEC

            cast( cast( kfsl as abap.dec(23,2) ) as abap.d34n ) /
            cast( cast( ksl as abap.dec(23,2) ) as abap.d34n )
           as abap.dec(23,2) )
         as fis_wfsl )
         end as wfsl,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'rhcur'} }

//      case when ksl = 0 then ksl else

//        cast( hsl * cast( kfsl2 as abap.d34n ) / cast( ksl as abap.d34n ) as fis_hfsl2 ) end as hfsl2,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'rhcur'} }

//      case when ksl = 0 then ksl else

//        cast( hsl * cast( kfsl3 as abap.d34n ) / cast( ksl as abap.d34n ) as fis_hfsl3 ) end as hfsl3,


      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      cast(psl as fis_psl preserving type)                         as psl,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      psl2                                                         as psl2,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      psl3                                                         as psl3,


      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      cast(pfsl as fis_pfsl preserving type)                       as pfsl,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      pfsl2                                                        as pfsl2,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rkcur'} }
      pfsl3                                                        as pfsl3,


      @Semantics.currencyCode:true
      rco_ocur                                                     as rco_ocur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rco_ocur'} }
      co_osl,

      @Semantics.currencyCode:true
      rgm_ocur                                                     as rgm_ocur,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rgm_ocur'} }
      gm_osl,


      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rhcur'} }
      hstprs,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'rhcur'} }
      hpvprs,


      @Semantics.unitOfMeasure:true
      runit                                              as runit,
      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'runit'} }
      msl,

      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'runit'} }
      mfsl,

      @Semantics.unitOfMeasure:true
      cast(rvunit as fis_co_meinh preserving type)                 as rvunit,
      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'rvunit'} }
      vmsl,

      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'rvunit'} }
      vmfsl,

      @Semantics.unitOfMeasure:true
      cast( rrunit as fis_ref_qty_uom preserving type )  as rrunit,
      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'rrunit'} }
      rmsl,

      @Semantics.unitOfMeasure:true
      qunit1                                             as qunit1,
      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'qunit1'} }
      quant1,

      @Semantics.unitOfMeasure:true
      qunit2                                             as qunit2,
      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'qunit2'} }
      quant2,

      @Semantics.unitOfMeasure:true
      qunit3                                             as qunit3,
      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'qunit3'} }
      quant3,

      @Semantics.unitOfMeasure:true
      cast( co_meinh as fis_fco_meinh preserving type ) as CO_MEINH,

      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'co_meinh'} }
      cast( co_megbtr as fis_fco_megbtr preserving type )  as CO_MEGBTR,

      @DefaultAggregation: #SUM
      @Semantics: { quantity : {unitOfMeasure: 'co_meinh'} }
      cast( co_mefbtr as fis_fco_mefbtr preserving type )  as CO_MEFBTR,

      /////////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_FIX  Unified Journal Entry: Mandatory fields for G/L

      ////////////////////////////////////////////////////////////////////////////

      cast(drcrk as fis_shkzg preserving type)           as drcrk,
      // cast(poper as FIS_POPER) as poper,

      cast(poper as fins_fiscalperiod preserving type)   as poper,
      cast(acdoca.periv as fis_periv preserving type)    as periv,
      cast(fiscyearper as fis_jahrper_conv preserving type ) as fiscyearper,
      cast(budat as fis_budat preserving type)           as budat,
      cast(bldat as fis_bldat preserving type)           as bldat,
      cast(blart as fis_blart preserving type)           as blart,
      // cast(blart as farp_blart) as blart,

      cast(buzei as fis_buzei preserving type)           as buzei,
      // cast(buzei as farp_buzei) as buzei,

      cast(zuonr as fis_zuonr preserving type)           as zuonr,
      cast(bschl as fis_bschl preserving type)           as bschl,
      cast(bstat as fis_bstat preserving type)           as bstat,
      // cast(bstat as farp_bstat_d) as bstat,

      cast(linetype as fis_linetype preserving type ) as linetype,
      cast(ktosl as fac_ktosl preserving type)           as ktosl,
      slalittype,
      xsplitmod,
      cast(usnam as fis_usnam preserving type)           as usnam,
      timestamp,
      last_change_datetime,
      eprctr,
      cast(rhoart as fis_hoart preserving type)          as rhoart,
      glaccount_type,
      cast(ktopl as fis_ktopl preserving type)           as ktopl,
      cast(lokkt as fis_altkt_skb1 preserving type)      as lokkt,
      cast(ktop2 as fis_ktop2 preserving type)           as ktop2,


      /////////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_FINCS   Universal Journal Entry: Fields for Group Reporting

      ////////////////////////////////////////////////////////////////////////////

      cast( rbunit as fis_md_bunit preserving type )     as rbunit,
      cast( rbuptr as fis_md_buptr preserving type )     as rbuptr,
      cast( rcomp  as fis_rcomp    preserving type )     as rcomp,
      cast( ritclg as fis_itclg    preserving type )     as ritclg,
      cast( ritem  as fis_fsi_item preserving type )     as ritem,
      cast( sityp  as fis_fc_sityp preserving type )     as sityp,
      cast( subit  as fis_fc_sitem preserving type )     as subit,


      ///////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_GEN  Unified Journal Entry: Fields for several subledgers

      //////////////////////////////////////////////////////////////////////////

      cast(rebzg as fis_rebzg preserving type)                           as rebzg,
      cast(rebzj as fis_rebzj_no_conv preserving type)                   as rebzj,
      cast(rebzz as fis_rebzz preserving type)                           as rebzz,
      cast(rebzt as farp_rebzt preserving type)                          as rebzt,
      cast(rbest as fis_refbtyp preserving type)                         as rbest,
      cast(ebeln as fis_ebeln preserving type)                           as ebeln,
      cast(ebelp as fis_ebelp preserving type)                           as ebelp,
      zekkn,
      // cast(sgtxt as FIS_SGTXT) as sgtxt,

      cast(sgtxt as farp_sgtxt preserving type)                          as sgtxt,
      cast(kdauf as vdm_sales_order preserving type)                     as kdauf,
      cast(kdpos as sales_order_item preserving type)                    as kdpos,
      matnr,
      werks,
      cast(lifnr as md_supplier preserving type)                         as lifnr,
      cast(kunnr as kunnr preserving type)                               as kunnr,
      fbuda,
      perop_beg,
      perop_end,
      coco_num,
      wwert                                                              as wwert,
      /////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_FI  Unified Journal Entry: Fields for FI subledgers

      /////////////////////////////////////////////////////////////////////////

      cast(koart as farp_koart preserving type)                          as koart,
      cast(umskz as fac_umskz preserving type)                           as umskz,
      cast(mwskz as fis_mwskz preserving type)                           as mwskz,
      tax_country,
      cast(hbkid as farp_hbkid preserving type)                          as hbkid,
      cast(hktid as fac_hktid preserving type)                           as hktid,
      cast(xopvw as fis_xopvw preserving type)                           as xopvw,
      cast(augdt as fis_augdt preserving type)                           as augdt,
      // cast(augbl as farp_augbl) as augbl,

      cast(augbl as fis_augbl preserving type)                           as augbl,
      cast(auggj as fis_auggj_no_conv preserving type)                   as auggj,

      cast( case augdt when '00000000' then cast( ' ' as xaugp  preserving type)
                                       else cast( 'X' as xaugp  preserving type)
            end  as xaugp  preserving type)                              as XAUGP,
      valut,
      cast(aging as fis_aging preserving type)                           as AGING,
      cast(aging_incrmnt as fis_incrmnt preserving type)                 as AGING_INCRMNT,

      /////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_FAA  Unified Journal Entry: Fields for Asset Accounting

      /////////////////////////////////////////////////////////////////////////

      cast(afabe as fis_afabe_d preserving type)                         as afabe,
      cast(anln1 as fis_anln1 preserving type)                           as anln1,
      cast(anln2 as fis_anln2 preserving type)                           as anln2,
      bzdat,
      cast(anbwa as fis_anbwa_vdm preserving type ) as anbwa,
      movcat,
      cast(depr_period as fis_peraf preserving type)                     as depr_period,
      cast(anlgr as fis_anlgr preserving type)                           as anlgr,
      cast(anlgr2 as fis_anlgr2 preserving type)                         as anlgr2,
      settlement_rule,
anlkl,
ktogr,
      cast(panl1 as fis_panl1 preserving type )                          as panl1,
      cast(panl2 as fis_panl2 preserving type )                          as panl2,

      //////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_ML Unified Journal Entry: Fields for Material Ledger

      //////////////////////////////////////////////////////////////////////////

      cast(kalnr as fis_kalnr preserving type)                           as kalnr,
      vprsv,
      mlast,
      cast(kzbws as inventoryspecialstockvalntype preserving type)       as kzbws,
      xobew,
      cast(sobkz as inventoryspecialstocktype preserving type)           as sobkz,
      // VTSTAMP,

      mat_kdauf,
      mat_kdpos,
      mat_pspnr,
      mat_ps_posid,
      cast(mat_lifnr as fis_mlmat_lifnr preserving type)                 as mat_lifnr,
      bwtar,
      bwkey,
      hpeinh,
      // KPEINH,

      // OPEINH,

      // VPEINH,

      mlptyp,
      mlcateg,
      qsbvalt,
      qsprocess,
      perart,

      ////////////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_CFIN   Unified Journal Entry: Fields for Central Finance

      //////////////////////////////////////////////////////////////////////////////

      bukrs_sender,
      cast(racct_sender as fis_racct_sender preserving type)             as racct_sender,
      accas_sender,
      accasty_sender,

      ////////////////////////////////////////////////////////////////////////////

      //  .INCLUDE  ACDOC_SI_CO  Unified Journal Entry: CO fields

      ///////////////////////////////////////////////////////////////////////////

      objnr,
      hrkft,
      hkgrp,
      parob1,
      parobsrc,
      cast( uspob as fis_uspob preserving type)          as uspob,
      co_belkz,
      beltp,
      muvflg,
      cast(gkont as fis_gkont preserving type)           as gkont,
      cast(gkoar as farp_gkoar preserving type)          as gkoar,
      cast(erlkz as fis_kblerlkz preserving type)        as erlkz,
      pernr,
      paobjnr,
      xpaobjnr_co_rel,
      cast(scope as fis_scope_cv_conv_co preserving type)   as scope,
      logsyso,
      pbukrs,
      cast(pscope as fis_pscope_cv_conv_co preserving type)   as pscope,
      logsysp,
      bwstrat,
      objnr_hk,
      cast( aufnr_org as fco_aufnr_org preserving type)   as aufnr_org,

      cast(ukostl as fis_usp_kostl    preserving type)     as ukostl,
      cast(ulstar as fins_usp_lstar    preserving type)    as ulstar,
      cast(umatnr as fis_origin_matnr preserving type)     as UMATNR,
      cast(varc_uacct as fis_varc_origin_acct preserving type) as VARC_UACCT,

      uprctr,
      accas,
      cast(accasty as fis_accasty preserving type) as accasty,
      lstar,
      cast(aufnr as fis_aufnr preserving type)           as aufnr,
      autyp,
      cast(ps_psp_pnr as ps_posnr preserving type)       as ps_psp_pnr,
      ps_posid,
      ps_prj_pnr,
      ps_pspid,
      nplnr,
      cast( nplnr_vorgn as fis_npvrg_no_conv preserving type ) as nplnr_vorgn,
      prznr,
      kstrg,
      cast(bemot as fis_bemot preserving type)           as bemot,
      cast(rsrce as fis_co_resource preserving type)     as rsrce,
      qmnum,
      service_doc_type,
      service_doc_id,
      service_doc_item_id,
      service_contract_type,
      service_contract_id,
      service_contract_item_id,
      cast(solution_order_id as crms4_solo_object_id preserving type ) as solution_order_id,
      cast(solution_order_item_id as crms4_solo_number_int preserving type ) as solution_order_item_id,

      cast( vtkey as fis_vtkey_kk preserving type ) as vtkey,
      cast( vtpos as fis_vtpos_kk preserving type ) as vtpos,

      cast( ra_contract_id as fis_contract_id preserving type ) as ra_contract_id,
      cast( ra_pob_id as fis_pob_id preserving type ) as ra_pob_id,

      erkrs,
      cast(paccas as fis_paccas preserving type)         as paccas,
      cast(paccasty as fins_paccasty preserving type)    as paccasty,
      cast(plstar as fis_par_lstar preserving type)      as plstar,
      cast(paufnr as fis_par_aufnr preserving type)      as paufnr,
      cast(pautyp as fis_par_auftyp preserving type)     as pautyp,
      cast(pps_posid as fis_par_posid preserving type)   as pps_posid,
      cast(pps_pspid as fis_par_pspid preserving type)   as pps_pspid,
      cast(pkdauf as fis_par_kdauf preserving type)      as pkdauf,
      cast(pkdpos as fis_par_kdpos preserving type)      as pkdpos,
      ppaobjnr,
      pnplnr,
      cast( pnplnr_vorgn as fis_par_vornr_auf_no_conv preserving type ) as pnplnr_vorgn,
      pprznr,
      pkstrg,
      cast(co_accasty_n1 as fis_accasty_n1 preserving type)         as co_accasty_n1,
      cast(co_accasty_n2 as fis_accasty_n2 preserving type)         as co_accasty_n2,
      cast(co_accasty_n3 as fis_accasty_n3 preserving type)         as co_accasty_n3,
      co_zlenr,
      co_belnr,
      co_buzei,
      co_refbz,
      overtimecat,
      work_item_id,
co_beknz,
uprznr,
pps_psp_pnr,
pps_prj_pnr,
pservice_doc_type,
pservice_doc_id,
pservice_doc_item_id,

varc_hkgrp,

      //////////////////////////////////////////////////////////////////////

      //  .INCLUDE  ACDOC_SI_COPA  Unified Journal Entry: CO-PA fields

      //////////////////////////////////////////////////////////////////////

      fkart,
      vkorg,
      vtweg,
      spart,
      matnr_copa,
      matkl,
      kdgrp,
      land1,
      brsch,
      bzirk,
      kunre,
      kunwe,
      konzs,

 //////////////////////////////////////////////////////////////////////

 // .INCLUDE ACDOC_SI_PS  Unified Journal Entry: Fields for Public Sector

 /////////////////////////////////////////////////////////////////////

re_bukrs,
re_account,
fikrs,
fipex,
cast(fistl as farp_fistl preserving type)  as fistl,
measure,
rfund,
rgrant_nbr,
rbudget_pd,
sfund,
sgrant_nbr,
sbudget_pd,
bdgt_account,
bdgt_account_cocode,
bdgt_cnsmpn_date,
bdgt_cnsmpn_period,
cast( bdgt_cnsmpn_year as psm_bdgt_cnsmpn_year_no_conv preserving type ) as bdgt_cnsmpn_year,
bdgt_relevant,
bdgt_cnsmpn_type,
bdgt_cnsmpn_amount_type,
rsponsored_prog,
rsponsored_class,
rbdgt_vldty_nbr,
cast(kblnr as fis_kblnr_fi preserving type ) as kblnr,
cast(kblpos as fis_kblpos preserving type ) as kblpos,


      ///////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_JVA  Universal Journal Entry: Fields for Financial Services

      ///////////////////////////////////////////////////////////////////////

cast(fs_product_group as fis_ffs_product_group preserving type ) as FS_PRODUCT_GROUP,
cast(branch_id as fis_ffs_branch_id preserving type ) as BRANCH_ID,
cast(datasource_id as fis_ffs_datasource_id preserving type ) as DATASOURCE_ID,


      ///////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_JVA  Unified Journal Entry: Fields for Joint Venture Accounting

      ///////////////////////////////////////////////////////////////////////

vname,
egrup,
recid,
vptnr,
btype,
etype,
prodper,
billm,
pom,
cbrunid,
jvactivity,
pvname,
pegrup,
s_recind,
cbracct,
cbobjnr,

      ///////////////////////////////////////////////////////////////////////

      // .INCLUDE ACDOC_SI_RE STRU  0 0 Unified Journal Entry: Fields for Real Estate

      ///////////////////////////////////////////////////////////////////////

      cast(swenr as rebdvdmbeno preserving type ) as SWENR,
      cast(sgenr as rebdvdmbuno preserving type ) as SGENR,
      cast(sgrnr as rebdvdmprno preserving type ) as SGRNR,
      cast(smenr as rebdvdmrono preserving type ) as SMENR,
      cast(recnnr as recnvdmcnnr preserving type ) as RECNNR,
cast(snksl as rescvdmsckey preserving type ) as snksl ,
cast(sempsl as rescvdmsuid preserving type ) as sempsl,
cast(dabrz as farp_dabrbez preserving type)  as dabrz,

cast(pswenr as rebdvdmpbeno preserving type ) as pswenr,
cast(psgenr as rebdvdmpbuno preserving type ) as psgenr,
cast(psgrnr as rebdvdmpprno preserving type ) as psgrnr,
cast(psmenr as rebdvdmprono preserving type ) as psmenr,
cast(precnnr as recnvdmpcnnr preserving type ) as precnnr,
cast(psnksl as rescvdmpsckey preserving type ) as psnksl,
cast(psempsl as rescvdmpsuid preserving type ) as psempsl,
cast(pdabrz as fins_par_dabrbez preserving type ) as pdabrz,


 ///////////////////////////////////////////////////////////////////////

 // .INCLUDE ACDOC_SI_ACR STRU  0 0 Universal Journal Entry: Fields for Accrual object

 ///////////////////////////////////////////////////////////////////////

acrobjtype,
acrlogsys,
acrobj_id,
acrsobj_id,
acritmtype,
cast( acrrefobj_id as fis_acr_refobj_id preserving type ) as acrrefobj_id,
acrvaldat,


///////////////////////////////////////////////////////////////////////

 // .INCLUDE ACDOC_SI_VAL STRU  0 0 Universal Journal Entry: Fields for Fin. Valuation Object

 ///////////////////////////////////////////////////////////////////////

valobjtype,
valobj_id,
valsobj_id,
cast(netdt as faedt_fpos preserving type) as netdt,
cast(risk_class as credit_risk_class preserving type) as risk_class,

      //////////////////////////////////////////////////////////////////////

      //  .INCLUDE  ACDOC_SI_LOG  Universal Journal Entry: Fields for Logistics

      //////////////////////////////////////////////////////////////////////


      arbid,
      cast( vornr as fis_vornr_no_conv preserving type ) as vornr,
      aufps,
      paufps,

      //////////////////////////////////////////////////

      // .INCLUDE  ACDOC_SI_LOG_ACT:  New Fields  PM  //

      //////////////////////////////////////////////////

cast( uvorn as fis_uvorn_no_conv preserving type ) as uvorn,
equnr,
tplnr,
istru,
ilart,
plknz,
artpr,
priok,
maufnr,
matkl_mm,
planned_parts_work,
cast( vornr_org as fis_origin_order_operation preserving type)   as vornr_org,

      //////////////////////////////////////////////////////////////////////////

      // .INCLUDE  ACDOC_SI_TECH:  Universal Journal Entry: Technical Fields  //

      //////////////////////////////////////////////////////////////////////////

cast(mig_source as fis_acdoc_mig_source preserving type) as mig_source


//      @DefaultAggregation: #SUM

//      cast( cast(1 as abap.dec( 12, 0 )) as fis_nbritm preserving type ) as nbritm


}
/* Filter for BSTAT not required as these are not written to ACDOCA */
//where

//  (

//    bstat <> 'D'

//  )

//  and(

//    bstat <> 'M'

//  )