@AbapCatalog: { sqlViewName: 'PFIACDOCPCOM',
preserveKey:true,
compiler.compareFilter:true }
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM: { viewType: #BASIC,
private:true }
//@EndUserText.label: 'P_ACDOCP_COM'
define view P_ACDOCP_COM as select from acdocp
// needed in I_FinancialPlanningEntryItem to retrieve ProductGroup
association [0..1] to I_Product as _Product on $projection.matnr = _Product.Product
/*
association [0..1] to I_WBSElementBasicData as _WBSElementBasicData on $projection.ps_posid = _WBSElementBasicData.WBSElement
association [0..1] to I_ProjectBasicData as _ProjectBasicData on $projection.ps_pspid = _ProjectBasicData.Project
association [0..1] to I_WBSElementBasicData as _PartnerWBSElementBasicData on $projection.pps_posid = _PartnerWBSElementBasicData.WBSElement
association [0..1] to I_ProjectBasicData as _PartnerProjectBasicData on $projection.pps_pspid = _PartnerProjectBasicData.Project
*/
{
key cast( reqtsn as fis_fp_request_tsn preserving type) as reqtsn,
key cast( datapakid as fis_fp_data_packet preserving type) as datapakid,
key cast( record as fis_fp_entry_item_no_sign ) as record,
cast(rbukrs as fis_bukrs preserving type) as rbukrs,
cast(rldnr as fis_rldnr preserving type) as rldnr,
cast(racct as fis_racct preserving type) as racct,
////////////////////////////////////////////////////////////////////////////////////
// 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,
/////////////////////////////////////////////////////////////////////////////////////
// Value Fields
/////////////////////////////////////////////////////////////////////////////////////
@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.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,
// Controlling Object Currency
@Semantics.currencyCode:true
rco_ocur,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'rgcur'} } co_osl,
//@Semantics.currencyCode:true
//cast(rkcur as fis_rkcur preserving type) as rkcur,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'rkcur'} } cast(kfsl as fis_kfsl preserving type) as kfsl,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'rhcur'} }
//case when ksl = 0 or kfsl = 0 then 0 else
// cast( cast( hsl * (
// //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,
cast(hfsl as fis_hfsl preserving type) as hfsl,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'rwcur'} }
cast(wfsl as fis_wfsl preserving type) as wfsl,
//@Semantics.unitOfMeasure:true
//runit as runit,
@Semantics.unitOfMeasure:true
cast(rvunit as co_meinh preserving type) as rvunit,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'rvunit'} }
cast( vmsl as fis_vquan1_12 preserving type ) as vmsl,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'rvunit'} }
cast( vmfsl as fis_vquan1_12_fix preserving type ) as vmfsl,
@Semantics.unitOfMeasure:true
cast( rrunit as fis_ref_qty_uom preserving type ) as rrunit,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'rrunit'} }
rmsl,
/////////////////////////////////////////////////////////////////////////////
// Mandatory fields for G/L
////////////////////////////////////////////////////////////////////////////
cast(ryear as fis_gjahr_no_conv preserving type) as gjahr,
cast(ryear as fis_ryear_no_conv preserving type) as ryear,
cast(poper as fins_fiscalperiod preserving type) as poper,
cast(fiscyearper as fis_jahrper_conv preserving type ) as fiscyearper,
cast(budat as fis_budat preserving type) as budat,
cast(periv as fis_periv preserving type) as periv,
cast(ktopl as fis_ktopl preserving type) as ktopl,
zuonr,
slalittype,
///////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_00 Unified Journal Entry: Transaction, Currencies, Units
///////////////////////////////////////////////////////////////////////////////
bttype,
rmvct,
cast(awtyp as fis_awtyp preserving type) as awtyp,
cast(aworg as fis_aworg preserving type) as aworg,
awref,
usnam,
////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_GEN Fields for several subledgers
///////////////////////////////////////////////////////////////////////////
cast(kdauf as vdm_sales_order preserving type) as kdauf,
cast(kdpos as sales_order_item preserving type) as kdpos,
werks,
matnr,
kunnr,
////////////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOCP_SI_CO Unified Journal Entry: CO fields
///////////////////////////////////////////////////////////////////////////
objnr,
co_belkz,
/*
cast(
case ps_psp_pnr
when '00000000' then _WBSElementBasicData.WBSElementInternalID
else ps_psp_pnr
end
as fis_wbsint_no_conv preserving type ) as ps_psp_pnr,
*/
cast( ps_psp_pnr as fis_wbsint_no_conv preserving type ) as ps_psp_pnr,
ps_posid,
/*
cast(
case ps_prj_pnr
when '00000000' then _ProjectBasicData.ProjectInternalID
else ps_prj_pnr
end
as fis_projectint_no_conv preserving type ) as ps_prj_pnr,
*/
cast( ps_prj_pnr as fis_projectint_no_conv preserving type ) as ps_prj_pnr,
ps_pspid,
pernr,
pbukrs,
cast(ukostl as fis_usp_kostl preserving type) as ukostl,
cast(ulstar as fis_usp_lstar preserving type) as ulstar,
uprctr,
cast(accasty as fis_accasty preserving type) as accasty,
paccasty,
lstar,
cast(aufnr as fis_aufnr preserving type) as aufnr,
cast(rsrce as fis_co_resource preserving type) as rsrce,
cast(plstar as fis_par_lstar preserving type) as plstar,
cast(paufnr as fis_par_aufnr preserving type) as paufnr,
/*
cast(
case pps_psp_pnr
when '00000000' then _PartnerWBSElementBasicData.WBSElementInternalID
else pps_psp_pnr
end
as fis_partner_wbsint_no_conv preserving type ) as pps_psp_pnr,
*/
cast( pps_psp_pnr as fis_partner_wbsint_no_conv preserving type ) as pps_psp_pnr,
cast( pps_posid as fis_par_posid preserving type) as pps_posid,
/*
cast(
case pps_prj_pnr
when '00000000' then _PartnerProjectBasicData.ProjectInternalID
else pps_prj_pnr
end
as fis_part_projectint_no_conv preserving type ) as pps_prj_pnr,
*/
cast( pps_prj_pnr as fis_part_projectint_no_conv preserving type) as pps_prj_pnr,
cast( pps_pspid as fis_par_pspid preserving type) as pps_pspid,
work_item_id,
cast(bemot as fis_bemot preserving type) as bemot,
psknz,
service_doc_type,
service_doc_id,
service_doc_item_id,
service_contract_type,
service_contract_id,
service_contract_item_id,
nplnr,
cast(gkont as fis_gkont preserving type) as gkont,
cast(gkoar as farp_gkoar preserving type) as gkoar,
cast( aufnr_org as fco_aufnr_org preserving type) as aufnr_org,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOCP_SI_MCE STRU 0 0 0 ACDOCP: Fields for material cost estimate
//////////////////////////////////////////////////////////////////////
losgr,
lsunit,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_COPA Unified Journal Entry: CO-PA fields
//////////////////////////////////////////////////////////////////////
fkart,
vkorg,
vtweg,
spart,
matnr_copa,
matkl,
kdgrp,
cast(land1 as fis_land1_copa preserving type) as land1,
cast(brsch as fis_brsch_copa preserving type) as brsch,
bzirk,
kunre,
kunwe,
cast(konzs as fis_konzs_copa preserving type) as konzs,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_PS Universal Journal Entry: Fields for Public Sector
//////////////////////////////////////////////////////////////////////
fikrs,
rfund,
rgrant_nbr,
rbudget_pd,
rsponsored_prog,
rsponsored_class,
rbdgt_vldty_nbr,
budget_process,
budget_subcategory,
bdgt_doc_workflow_status,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_LOG Universal Journal Entry: Fields for Logistics
//////////////////////////////////////////////////////////////////////
arbid,
cast( vornr as fis_vornr_no_conv preserving type ) as vornr,
aufps,
paufps,
// new fields with CE2002
cast( uvorn as fis_uvorn_no_conv preserving type ) as uvorn,
equnr,
tplnr,
istru,
ilart,
plknz,
artpr,
priok,
maufnr,
matkl_mm,
cast( vornr_org as fis_origin_order_operation preserving type) as vornr_org,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOCP_SI_FAA ACDOCP: Fields for Asset Accounting
//////////////////////////////////////////////////////////////////////
afabe,
anln1,
anln2,
movcat,
anlkl,
///////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_JVA Unified Journal Entry: Fields for Joint Venture Accounting
///////////////////////////////////////////////////////////////////////
vname,
egrup,
recid,
prodper,
///////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOCP_SI_EAM ACDOCP: Fields for EAM (maintenace orders)
///////////////////////////////////////////////////////////////////////
rsnum,
cast(rspos as eam_reservation_item preserving type ) as rspos,
cast(rsart as eam_reservation_type preserving type ) as rsart,
cast(packno as eam_service_package preserving type ) as packno,
cast(introw as eam_service_line_item preserving type ) as introw,
///////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOCP_SI_RE ACDOCP: 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,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOCP_SI_MCE ACDOCP: Fields for material cost estimate
//////////////////////////////////////////////////////////////////////
cast(pmatnr as fis_produced_product preserving type ) as pmatnr ,
cast(costg_from_date as fis_ck_abdat preserving type ) as costg_from_date,
cast(costg_to_date as fis_ck_bidat preserving type) as costg_to_date,
hkgrp,
//////////////////////////////////////////////////////////////////////
// .INCLUDE ACDOC_SI_ACR 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,
//////////////////////////////////////////////////////////////////////
// Fields not in ACDOCA
//////////////////////////////////////////////////////////////////////
category,
kprice,
hprice,
wprice,
sgtxt,
_Product
}