@AbapCatalog.sqlViewName: 'PCONTRACTITEM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
--@EndUserText.label: 'Contract Item'
@ClientHandling.type: #INHERITED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
define view I_ContItem as select from wbhk
inner join I_ACMTradingContractItemData as wbhi
on wbhk.tkonn = wbhi.TradingContractNumber
left outer join I_ACMTrdgContractBusinessData as I_WBHD
//inner join i_wbhd
on wbhi.TradingContractNumber = I_WBHD.TradingContractNumber
and wbhi.TradingContractItem = I_WBHD.TradingContractItem
inner join I_ContSubItem as _sub
on wbhi.TradingContractNumber = _sub.TradingContractNumber
{
key wbhi.TradingContractNumber,
key wbhi.TradingContractItem,
wbhi.TrdgContrCommoditySubitem,
wbhi.ContractMaterial,
wbhi.ContractPlant,
wbhi.ContractStorageLocation,
wbhi.TrdgContrSalesQuantity,
wbhi.BaseUnit,
wbhi.PrcgCndnTradingContrCurrency,
wbhi.TradingContractSalesCurrency,
wbhi.Commodity,
wbhi.ProfitCenter,
wbhk.knumv_sd,
--i_wbhd.tkonn,
--i_wbhd.tposn,
case
when I_WBHD.TrdgContrCommoditySubitem is null
then _sub.TrdgContrCommoditySubitem
else I_WBHD.TrdgContrCommoditySubitem
end as tposn_sub_1,
case
when I_WBHD.PurchaseOrderSupplier is null
then _sub.PurchaseOrderSupplier
else I_WBHD.PurchaseOrderSupplier
end as elifn,
case
when I_WBHD.PurchasingOrganization is null
then _sub.PurchasingOrganization
else I_WBHD.PurchasingOrganization
end as ekorg,
case
when I_WBHD.PurchasingGroup is null
then _sub.PurchasingGroup
else I_WBHD.PurchasingGroup
end as ekgrp,
/*case
when I_WBHD.IHREZ is null
then _sub.IHREZ
else I_WBHD.IHREZ
end as irhez,
case
when I_WBHD.EBDAT is null
then _sub.EBDAT
else I_WBHD.EBDAT
end as ebdat,
case
when I_WBHD.EINDT is null
then _sub.EINDT
else I_WBHD.EINDT
end as eindt,
case
when I_WBHD.LPEIN_INT is null
then _sub.LPEIN_INT
else I_WBHD.LPEIN_INT
end as lpein,
case
when I_WBHD.WAERS_PURCH is null
then _sub.WAERS_PURCH
else I_WBHD.WAERS_PURCH
end as waers_purch_1,
case
when I_WBHD.TKRATE_MM is null
then _sub.TKRATE_MM
else I_WBHD.TKRATE_MM
end as tkrate_mm,
case
when
I_WBHD.KURST_MM is null
then _sub.KURST_MM
else I_WBHD.KURST_MM
end as kurst_mm,
case
when
I_WBHD.ZTERM is null
then _sub.ZTERM
else I_WBHD.ZTERM
end as zterm,
case
when I_WBHD.VALDT is null
then _sub.VALDT
else I_WBHD.VALDT
end as valdt,
case
when I_WBHD.TERMDES_MM is null
then _sub.TERMDES_MM
else I_WBHD.TERMDES_MM
end as termdes_mm,
case
when I_WBHD.PRSDT_MM is null
then _sub.PRSDT_MM
else I_WBHD.PRSDT_MM
end as prsdt_mm,
case
when I_WBHD.PRSDT_SD is null
then _sub.PRSDT_SD
else I_WBHD.PRSDT_SD
end as prsdt_sd,
--i_wbhd.ernam as bus_data_ernam,
--i_wbhd.erdat,
--i_wbhd.erzet,
case
when I_WBHD.WERK_MM is null
then _sub.WERK_MM
else I_WBHD.WERK_MM
end as werk_mm,*/
case
when I_WBHD.ACMPurgIncotermsPart1 is null
then _sub.ACMPurgIncotermsPart1
else I_WBHD.ACMPurgIncotermsPart1
end as inco1_mm,
/*
case
when I_WBHD.IHRAN is null
then _sub.IHRAN
else I_WBHD.IHRAN
end as ihran,
case
when I_WBHD.EDATU_VBAK is null
then _sub.EDATU_VBAK
else I_WBHD.EDATU_VBAK
end as edatu_vbak,
case
when I_WBHD.PRGRS_VBAK is null
then _sub.PRGRS_VBAK
else I_WBHD.PRGRS_VBAK
end as prgrs_vbak,*/
case
when I_WBHD.ACMSlsIncotermsPart1 is null
then _sub.ACMSlsIncotermsPart1
else I_WBHD.ACMSlsIncotermsPart1
end as inco1_sd,
/*case
case
when I_WBHD.ACMSlsIncotermsPart2 is null
then _sub.INCO2_SD
else I_WBHD.ACMSlsIncotermsPart2
end as inco2_sd,
when I_WBHD.ZTERM_SALES is null
then _sub.ZTERM_SALES
else I_WBHD.ZTERM_SALES
end as zterm_sales,
case
when I_WBHD.TERMDES_SD is null
then _sub.TERMDES_SD
else I_WBHD.TERMDES_SD
end as termdes_sd,
case
when I_WBHD.VALDTD is null
then _sub.VALDTD
else I_WBHD.VALDTD
end as valdtd,
case
when I_WBHD.ZLSCH is null
then _sub.ZLSCH
else I_WBHD.ZLSCH
end as zlsch,
case
when I_WBHD.KDATB_MM is null
then _sub.KDATB_MM
else I_WBHD.KDATB_MM
end as kdatb_mm,
case
when I_WBHD.KDATE_MM is null
then _sub.KDATE_MM
else I_WBHD.KDATE_MM
end as kdate_mm,
case
when I_WBHD.AUSNR_MM is null
then _sub.AUSNR_MM
else I_WBHD.AUSNR_MM
end as ausnr_mm,
case
when I_WBHD.ANGNR_MM is null
then _sub.ANGNR_MM
else I_WBHD.ANGNR_MM
end as angnr_mm,
case
when I_WBHD.VERKF_MM is null
then _sub.VERKF_MM
else I_WBHD.VERKF_MM
end as verkf_mm,
case
when I_WBHD.TELF1_MM is null
then _sub.TELF1_MM
else I_WBHD.TELF1_MM
end as telf1_mm,
case
when I_WBHD.LLIEF_MM is null
then _sub.LLIEF_MM
else I_WBHD.LLIEF_MM
end as llief_mm,
case
when I_WBHD.UNSEZ_MM is null
then _sub.UNSEZ_MM
else I_WBHD.UNSEZ_MM
end as unsez_mm,
case
when I_WBHD.EVERS_MM is null
then _sub.EVERS_MM
else I_WBHD.EVERS_MM
end as evers_mm,
case
when I_WBHD.BSTAE_MM is null
then _sub.BSTAE_MM
else I_WBHD.BSTAE_MM
end as bstae_mm,
case
when I_WBHD.KZABS_MM is null
then _sub.KZABS_MM
else I_WBHD.KZABS_MM
end as kzabs_mm,
case
when I_WBHD.LABNR is null
then _sub.LABNR
else I_WBHD.LABNR
end as labnr,
case
when I_WBHD.KZAZU is null
then _sub.KZAZU
else I_WBHD.KZAZU
end as kzazu,
case
when I_WBHD.HKLA is null
then _sub.HKLA
else I_WBHD.HKLA
end as hkla,
case
when I_WBHD.LCNUM is null
then _sub.LCNUM
else I_WBHD.LCNUM
end as lcnum,
case
when I_WBHD.ABSSC is null
then _sub.ABSSC
else I_WBHD.ABSSC
end as abssc,
case
when I_WBHD.AKPRZ is null
then _sub.AKPRZ
else I_WBHD.AKPRZ
end as akprz,
case
when I_WBHD.POSPLIT is null
then _sub.POSPLIT
else I_WBHD.POSPLIT
end as posplit,
case
when I_WBHD.KUFIX is null
then _sub.KUFIX
else I_WBHD.KUFIX
end as kufix,
case
when I_WBHD.BSTYP is null
then _sub.BSTYP
else I_WBHD.BSTYP
end as bstyp,
case
when I_WBHD.BSART is null
then _sub.BSART
else I_WBHD.BSART
end as bsart,*/
case
when I_WBHD.TrdgContrSalesIncotermsVersion is null
then _sub.TrdgContrSalesIncotermsVersion
else I_WBHD.TrdgContrSalesIncotermsVersion
end as incov_sd,
case
when I_WBHD.TrdgContrSlsIncotermsLoc1Text is null
then _sub.TrdgContrSlsIncotermsLoc1Text
else I_WBHD.TrdgContrSlsIncotermsLoc1Text
end as inco2_l_Sd,
case
when I_WBHD.TrdgContrSlsIncotermsLoc2Text is null
then _sub.TrdgContrSlsIncotermsLoc2Text
else I_WBHD.TrdgContrSlsIncotermsLoc2Text
end as inco3_l_Sd,
/*
case
when I_WBHD.TrdgContrPurgIncotermsVersion is null
then _sub.INCOV_MM
else I_WBHD.TrdgContrPurgIncotermsVersion
end as incov_mm,
case
when I_WBHD.TrdgContrPurgIncotermsLoc1Text is null
then _sub.INCO2_L_MM
else I_WBHD.TrdgContrPurgIncotermsLoc1Text
end as inco2_l_mm,
case
when I_WBHD.TrdgContrPurgIncotermsLoc2Text is null
then _sub.INCO3_L_MM
else I_WBHD.TrdgContrPurgIncotermsLoc2Text
end as inco3_l_mm,
--i_wbhd._dataaging,
when I_WBHD.DUMMY_WBHD_INCL_EEW_PS is null
then _sub.DUMMY_WBHD_INCL_EEW_PS
else I_WBHD.DUMMY_WBHD_INCL_EEW_PS
end as dummy_i_wbhd_incl_eew_ps,
case
when I_WBHD.VSART is null
then _sub.VSART
else I_WBHD.VSART
end as vsart,
case
when I_WBHD.BSTKD_E is null
then _sub.BSTKD_E
else I_WBHD.BSTKD_E
end as bstkd_e,
case
when I_WBHD.POSEX_E is null
then _sub.POSEX_E
else I_WBHD.POSEX_E
end as posex_e,
case
when I_WBHD.BSTKD is null
then _sub.BSTKD
else I_WBHD.BSTKD
end as bstkd,
case
when I_WBHD.BSTDK is null
then _sub.BSTDK
else I_WBHD.BSTDK
end as bstdk,
case
when I_WBHD.BSTDK_E is null
then _sub.BSTDK_E
else I_WBHD.BSTDK_E
end as bstdk_E,
case
when I_WBHD.KALSM_MM is null
then _sub.KALSM_MM
else I_WBHD.KALSM_MM
end as kalsm_mm,*/
case
when I_WBHD.PricingDocument is null
then _sub.PricingDocument
else I_WBHD.PricingDocument
end as knumv_mm
/*case
when I_WBHD.KURSK_SD is null
then _sub.KURSK_SD
else I_WBHD.KURSK_SD
end as kursk_sd,
case
when I_WBHD.RESWK is null
then _sub.RESWK
else I_WBHD.RESWK
end as reswk,
case
when I_WBHD.RETPC is null
then _sub.RETPC
else I_WBHD.RETPC
end as retpc,
case
when I_WBHD.DPTYP is null
then _sub.DPTYP
else I_WBHD.DPTYP
end as dptyp,
case
when I_WBHD.DPPCT is null
then _sub.DPPCT
else I_WBHD.DPPCT
end as dppct,
case
when I_WBHD.DPAMT is null
then _sub.DPAMT
else I_WBHD.DPAMT
end as dpamt,
case
when I_WBHD.DPDAT is null
then _sub.DPDAT
else I_WBHD.DPDAT
end as dpdat,
case
when I_WBHD.PODKZ is null
then _sub.PODKZ
else I_WBHD.PODKZ
end as podkz,
case
when I_WBHD.J_1AINDXP is null
then _sub.J_1AINDXP
else I_WBHD.J_1AINDXP
end as j_1aindxp,
case
when I_WBHD.J_1AIDATEP is null
then _sub.J_1AIDATEP
else I_WBHD.J_1AIDATEP
end as j_1aidatep,
case
when I_WBHD.J_1AFITP_SD is null
then _sub.J_1AFITP_SD
else I_WBHD.J_1AFITP_SD
end as j_1afitp_sd,
case
when I_WBHD.J_1ARFZ_SD is null
then _sub.J_1ARFZ_SD
else I_WBHD.J_1ADTYP_SD
end as j_1adtyp_sd,
case
when I_WBHD.J_1AREGIO_SD is null
then _sub.J_1AREGIO_SD
else I_WBHD.J_1AREGIO_SD
end as j_1aregio_sd,
case
when I_WBHD.J_1AGICD_SD is null
then _sub.J_1AGICD_SD
else I_WBHD.J_1AGICD_SD
end as j_1agicd_sd,
case
when I_WBHD.J_1ADTYP_SD is null
then _sub.J_1ADTYP_SD
else I_WBHD.J_1ADTYP_SD
end as j_1adtyp_Sd_1,
case
when I_WBHD.J_1ATXREL_SD is null
then _sub.J_1ATXREL_SD
else I_WBHD.J_1ATXREL_SD
end as j_1atxrel_sd,
case
when I_WBHD.MNDID is null
then _sub.MNDID
else I_WBHD.MNDID
end as mndid,
case
when I_WBHD.SEPA_REL_SD is null
then _sub.SEPA_REL_SD
else I_WBHD.SEPA_REL_SD
end as sepa_rel_sd */
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACMTRADINGCONTRACTITEMDATA",
"I_ACMTRDGCONTRACTBUSINESSDATA",
"I_CONTSUBITEM",
"WBHK"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/