I_PREAGRMTTRADINGCONTRACTITEM

CDS View

Trading Contract Items

I_PREAGRMTTRADINGCONTRACTITEM is a CDS View in S/4HANA. Trading Contract Items. It contains 7 fields. 11 CDS views read from this table.

CDS Views using this table (11)

ViewTypeJoinVDMDescription
I_PrepayBarterProposedLinks view inner COMPOSITE PPMT Proposed Linkages Barter
I_PrepaymentProposedLinkages view inner COMPOSITE Prepayment Agreement Proposed Linkages
P_PpaytPrpsdLnkgCMMContrAmt view inner COMPOSITE Prepayment Proposed CMM Contract Amount
P_PpaytPrpsdLnkgContrAmt view inner COMPOSITE Prepayment Proposed Contract Amount
P_PpaytPrpsdLnkgCPEContrAmt view inner COMPOSITE Prepayment Proposed CPE Contract Amount
P_PpaytPrpsdLnkgDocContrAmt view inner COMPOSITE Prepayment Proposed Document Contract Amount
P_PrepaymentCMMContractAmount view inner COMPOSITE Prepayment Contract CMM Amount
P_PrepaymentCPEContractAmount view inner COMPOSITE Prepayment Contract CPE Amount
P_PrepaymentDocContractAmount view inner COMPOSITE Prepayment Contract Document Amount
P_PrepaymentDocumentFixedVal view inner COMPOSITE Document Fixed Pricing
P_PrepaymentRefDocTotalAmount view inner COMPOSITE Prepayment Document Total Amount

Fields (7)

KeyField CDS FieldsUsed in Views
KEY TradingContractItem DocumentItemNumber,TradingContractItem 10
Material Material 5
PrepaymentRefDocItmValdFromDte PrepaymentRefDocItmValdFromDte 4
PrepaymentRefDocItmValdToDte PrepaymentRefDocItmValdToDte 4
TradingContractItemQuantity OrderQuantity 5
TrdgContractItemUnitOfMeasure OrderQuantityUnit 5
TrdgContrTotalNetAmountCrcy PrepaymentTotalAmtCrcy 3
@AbapCatalog.sqlViewName              : 'IPPMGCONTRITEM'
@AbapCatalog.compiler.compareFilter   : true
@AbapCatalog.preserveKey              : true
@ClientHandling.algorithm             : #SESSION_VARIABLE
@AccessControl.authorizationCheck     : #CHECK
@Metadata.ignorePropagatedAnnotations : true
@AccessControl.personalData.blocking  : #REQUIRED
@VDM.viewType                         : #BASIC
@ObjectModel.usageType.serviceQuality : #B
@ObjectModel.usageType.sizeCategory   : #XL
@ObjectModel.usageType.dataClass      : #TRANSACTIONAL
@EndUserText.label                    : 'Trading Contract Items'

define view I_PreAgrmtTradingContractItem 
as select from wbhi
  left outer to one join wb2_d_comsub on wbhi.tkonn             = wb2_d_comsub.tkonn
                         and wbhi.tposn             = wb2_d_comsub.tposn
                         and wb2_d_comsub.tposn_com = '000001'
  
  association [1..1] to I_PreAgrmtTradingContract     as _TradingContract           on  $projection.TradingContract = _TradingContract.TradingContract
  
  association [0..1] to I_Plant                       as _Plant                     on  $projection.Plant = _Plant.Plant

  association [0..1] to I_StorageLocation             as _StorageLocation           on  $projection.Plant           = _StorageLocation.Plant
                                                                                   and $projection.StorageLocation = _StorageLocation.StorageLocation
  association [0..1] to I_Material                    as _Material                  on  $projection.Material = _Material.Material

  association [0..1] to I_UnitOfMeasure               as _TrdgContrItemQtyUnit      on  $projection.TrdgContractItemUnitOfMeasure = _TrdgContrItemQtyUnit.UnitOfMeasure
  
 // Extension

  association [0..1] to E_TradingContractItem         as _Extension                 on $projection.TradingContract     = _Extension.TradingContract
                                                                                   and $projection.TradingContractItem = _Extension.TradingContractItem
                                                                                   and $projection.ContractSubItem     = _Extension.ContractSubItem 
  
{
    @ObjectModel.foreignKey.association: '_TradingContract'
    key wbhi.tkonn                                                as TradingContract,
    key wbhi.tposn                                                as TradingContractItem,
    key wbhi.tposn_sub                                            as ContractSubItem,
    
        wb2_d_comsub.date_from                                    as PrepaymentRefDocItmValdFromDte,
        
        wb2_d_comsub.date_to                                      as PrepaymentRefDocItmValdToDte,
    
        @ObjectModel.foreignKey.association: '_Material'
        wbhi.matnr                                                as Material,
                
        @ObjectModel.foreignKey.association: '_Plant'
        wbhi.werks                                                as Plant,
        
        @ObjectModel.foreignKey.association: '_StorageLocation'
        wbhi.lgort                                                as StorageLocation,
        
        @Semantics.quantity.unitOfMeasure: 'TrdgContractItemUnitOfMeasure'
        cast( case
        when wbhi.kwmeng is not initial and wbhi.menge is initial
        then wbhi.kwmeng
        when wbhi.menge is not initial and wbhi.kwmeng is initial
        then wbhi.menge
        else 0 end    as abap.quan( 15, 3 ) )                     as TradingContractItemQuantity,
        
        @Semantics.unitOfMeasure: true
        @ObjectModel.foreignKey.association: '_TrdgContrItemQtyUnit'
        case
        when wbhi.vrkme is not initial and wbhi.meins is initial
        then wbhi.vrkme
        when wbhi.meins is not initial and wbhi.vrkme is initial
        then wbhi.meins  
        end                                                       as TrdgContractItemUnitOfMeasure,
        
        @Semantics.amount.currencyCode: 'TrdgContrTotalNetAmountCrcy'
        cast( case
        when wbhi.netwrt_in_sdwrs is not initial and wbhi.netwrt_in_waers is initial
        then wbhi.netwrt_in_sdwrs
        when wbhi.netwrt_in_waers is not initial and wbhi.netwrt_in_sdwrs is initial
        then wbhi.netwrt_in_waers
        else 0 end    as abap.curr( 25,2 ) )                      as TrdgContrTotalNetAmount, 
        
        @Semantics.currencyCode: true        
        case
        when wbhi.sdwrs is not initial and wbhi.waers_purch is initial
        then wbhi.sdwrs
        when wbhi.waers_purch is not initial and wbhi.sdwrs is initial
        then wbhi.waers_purch  
        end                                                       as TrdgContrTotalNetAmountCrcy,
        _TradingContract.Counterparty                             as Counterparty,
      
//      Associations

        _TradingContract,
        _Plant,  
        _StorageLocation,
        _Material,
        _TrdgContrItemQtyUnit
} 
where wbhi.loekz <> 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PREAGRMTTRADINGCONTRACT",
"WB2_D_COMSUB",
"WBHI"
],
"ASSOCIATED":
[
"E_TRADINGCONTRACTITEM",
"I_MATERIAL",
"I_PLANT",
"I_PREAGRMTTRADINGCONTRACT",
"I_STORAGELOCATION",
"I_UNITOFMEASURE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/