I_FldLogsPurchasingItem

DDL: I_FLDLOGSPURCHASINGITEM Type: view_entity COMPOSITE Package: ODATA_FLOG_PROCESS_RECEIPTS

Field Logistics Purchasing Items

I_FldLogsPurchasingItem is a Composite CDS View that provides data about "Field Logistics Purchasing Items" in SAP S/4HANA. It reads from 2 data sources (I_FldLogsPlants, I_PurchasingDocumentItem) and exposes 56 fields with key fields PurchasingDocument, PurchasingDocumentItem, DeliveryDocument, DeliveryDocumentItem. It has 12 associations to related views. Part of development package ODATA_FLOG_PROCESS_RECEIPTS.

Data Sources (2)

SourceAliasJoin Type
I_FldLogsPlants _FldLogsAllPlants inner
I_PurchasingDocumentItem _PurchasingDocumentItem from

Associations (12)

CardinalityTargetAliasCondition
[0..1] I_FldLogsPurOrdOpenQty _POOpenQty $projection.PurchasingDocument = _POOpenQty.PurchasingDocument and $projection.PurchasingDocumentItem = _POOpenQty.PurchasingDocumentItem
[0..*] I_FldLogsValuationType _ValuationType _PurchasingDocumentItem.Material = _ValuationType.Material and _PurchasingDocumentItem.Plant = _ValuationType.Plant
[0..1] I_FldLogsMaterialDetails _MaterialDetails _PurchasingDocumentItem.Material = _MaterialDetails.Material
[1..1] I_FldLogsMaterialPlantDetails _ProductPlant _PurchasingDocumentItem.Material = _ProductPlant.Material and _PurchasingDocumentItem.Plant = _ProductPlant.Plant
[0..1] I_FldLogsAggregateBlockedQty _OpenBlockedItems $projection.PurchasingDocument = _OpenBlockedItems.PurchaseOrder and $projection.PurchasingDocumentItem = _OpenBlockedItems.PurchaseOrderItem and $projection.DeliveryDocument = _OpenBlockedItems.DeliveryDocument and $projection.DeliveryDocumentItem = _OpenBlockedItems.DeliveryDocumentItem
[0..1] I_FldLogsAggregateReceivedQty _ReceivedItems $projection.PurchasingDocument = _ReceivedItems.PurchaseOrder and $projection.PurchasingDocumentItem = _ReceivedItems.PurchaseOrderItem and $projection.DeliveryDocument = _ReceivedItems.DeliveryDocument and $projection.DeliveryDocument = _ReceivedItems.DeliveryDocumentItem
[0..1] I_FldLogsInbDelivWhseTsk _FldLogsInbDelivWhseTsk _DeliveryItem.DistrStatusByDecentralizedWrhs is not initial and $projection.EWMWhseReqRefDocumentNumber = _FldLogsInbDelivWhseTsk.EWMDelivery and $projection.EWMWhseRequestRefDocumentItem = _FldLogsInbDelivWhseTsk.EWMDeliveryItem
[0..1] I_FldLogsAggregateDelivQty _DeliveryAggrgQty _DeliveryItem.DeliveryDocument is not initial and _DeliveryItem.DeliveryDocument = _DeliveryAggrgQty.DeliveryDocument and $projection.DeliveryDocumentItem = _DeliveryAggrgQty.DeliveryDocumentItem
[0..1] I_FldLogsOpenPackQty _OpenPackQty _DeliveryItem.DeliveryDocument is not initial and _DeliveryItem.DeliveryDocument = _OpenPackQty.DeliveryDocument and $projection.DeliveryDocumentItem = _OpenPackQty.DeliveryDocumentItem
[0..1] I_Supplier _Supplier $projection.supplier = _Supplier.Supplier
[0..1] I_Customer _SoldToParty _DeliveryItem.SoldToParty = _SoldToParty.Customer
[0..1] I_Customer _ShipToParty _DeliveryItem.ShipToParty = _ShipToParty.Customer

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
EndUserText.label Field Logistics Purchasing Items view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view

Fields (56)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument I_PurchasingDocumentItem PurchasingDocument
KEY PurchasingDocumentItem I_PurchasingDocumentItem PurchasingDocumentItem
KEY DeliveryDocument
KEY DeliveryDocumentItem
PurchaseRequisition I_PurchasingDocumentItem PurchaseRequisition
PurchaseRequisitionItem I_PurchasingDocumentItem PurchaseRequisitionItem
FldLogsPurOrdItem
FldLogsDelivDocItem
IsCompletelyDelivered I_PurchasingDocumentItem IsCompletelyDelivered
Material I_PurchasingDocumentItem Material
Plant I_PurchasingDocumentItem Plant
TargetStockType I_PurchasingDocumentItem StockType
DeliveryDate
FldLogsDelivQty
DeliveryQuantityUnit _DeliveryItem DeliveryQuantityUnit
OpenQtyInPurchaseOrderUnit _POOpenQty OpenQtyInPurchaseOrderUnit
FldLogsPOTotalQty I_PurchasingDocumentItem OrderQuantity
OrderQuantityUnit I_PurchasingDocumentItem OrderQuantityUnit
StorageLocationendasStorageLocation
Batch
DocumentCurrency I_PurchasingDocumentItem DocumentCurrency
NetPriceAmount I_PurchasingDocumentItem NetPriceAmount
PurchasingDocumentSubtype
Supplier
MaterialGroup I_PurchasingDocumentItem MaterialGroup
_MaterialDetails _MaterialDetails
_POOpenQty _POOpenQty
_ValuationType _ValuationType
_ProductPlant _ProductPlant
_PurchasingDocument I_PurchasingDocumentItem _PurchasingDocument
_Plant I_PurchasingDocumentItem _Plant
_Supplier _Supplier
InboundDelivery _DeliveryItem DeliveryDocument
GoodsMovementStatus _DeliveryItem GoodsMovementStatus
GoodsMovementType _DeliveryItem GoodsMovementType
ActualDeliveryQuantity _DeliveryItem ActualDeliveryQuantity
InventoryValuationType
FldLogsStatus _DeliveryItem FldLogsStatus
DistrStatusByDecentralizedWrhs _DeliveryItem DistrStatusByDecentralizedWrhs
DeliveryDocumentBySupplier _DeliveryItem DeliveryDocumentBySupplier
LoadingPoint _DeliveryItem LoadingPoint
UnloadingPointName _DeliveryItem UnloadingPointName
PickingStatus _DeliveryItem PickingStatus
IsToBeAcceptedAtOrigin
PurchasingDocumentItemCategory I_PurchasingDocumentItem PurchasingDocumentItemCategory
IsEndOfPurposeBlocked
IsBusinessPurposeCompleted _ShipToParty IsBusinessPurposeCompleted
IsBusPrpsCmpltdCustomer _SoldToParty IsBusinessPurposeCompleted
SuplrCoIsBusPrpsCmpltd
EWMWhseReqRefDocumentNumber
EWMWhseRequestRefDocumentItem
_FldLogsInbDelivWhseTsk _FldLogsInbDelivWhseTsk
_OpenPackQty _OpenPackQty
_DeliveryAggrgQty _DeliveryAggrgQty
_OpenBlockedItems _OpenBlockedItems
_ReceivedItems _ReceivedItems
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Field Logistics Purchasing Items'
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@ObjectModel.usageType:{
  serviceQuality: #C,
  sizeCategory: #L,
  dataClass: #TRANSACTIONAL
}
define view entity I_FldLogsPurchasingItem
  as select from           I_PurchasingDocumentItem as _PurchasingDocumentItem
  // Replace with new CDS -2

    inner join             I_FldLogsPlants          as _FldLogsAllPlants on _PurchasingDocumentItem.Plant = _FldLogsAllPlants.Plant
  // Temporary join - replace with new return flag check -1

    left outer to one join I_FldLogsPlantBasic      as _RemotePlant      on _PurchasingDocumentItem.Plant = _RemotePlant.Plant

    left outer to one join I_FldLogsDeliveryDocItem as _DeliveryItem     on  _PurchasingDocumentItem.PurchasingDocument     = _DeliveryItem.ReferenceSDDocument
                                                                         and _PurchasingDocumentItem.PurchasingDocumentItem = _DeliveryItem.PurchasingDocumentItem
  association [0..1] to I_FldLogsPurOrdOpenQty        as _POOpenQty              on  $projection.PurchasingDocument     = _POOpenQty.PurchasingDocument
                                                                                 and $projection.PurchasingDocumentItem = _POOpenQty.PurchasingDocumentItem
  // 2 step GR for future release

  //  association [0..1] to I_FldLogsPurchasingDocItem    as _POOrigin         on  _PurchasingDocumentItem.PurchasingDocument     = _POOrigin.PurchasingDocument

  //                                                                           and _PurchasingDocumentItem.PurchasingDocumentItem = _POOrigin.PurchasingDocumentItem

  association [0..*] to I_FldLogsValuationType        as _ValuationType          on  _PurchasingDocumentItem.Material = _ValuationType.Material
                                                                                 and _PurchasingDocumentItem.Plant    = _ValuationType.Plant

  association [0..1] to I_FldLogsMaterialDetails      as _MaterialDetails        on  _PurchasingDocumentItem.Material = _MaterialDetails.Material

  association [1..1] to I_FldLogsMaterialPlantDetails as _ProductPlant           on  _PurchasingDocumentItem.Material = _ProductPlant.Material
                                                                                 and _PurchasingDocumentItem.Plant    = _ProductPlant.Plant
  // 2 step GR for future release

  association [0..1] to I_FldLogsAggregateBlockedQty  as _OpenBlockedItems       on  $projection.PurchasingDocument     = _OpenBlockedItems.PurchaseOrder
                                                                                 and $projection.PurchasingDocumentItem = _OpenBlockedItems.PurchaseOrderItem
                                                                                 and $projection.DeliveryDocument        = _OpenBlockedItems.DeliveryDocument
                                                                                 and $projection.DeliveryDocumentItem    = _OpenBlockedItems.DeliveryDocumentItem 
                                                                                 
  association [0..1] to I_FldLogsAggregateReceivedQty as _ReceivedItems          on  $projection.PurchasingDocument     = _ReceivedItems.PurchaseOrder
                                                                                 and $projection.PurchasingDocumentItem = _ReceivedItems.PurchaseOrderItem
                                                                                 and $projection.DeliveryDocument        = _ReceivedItems.DeliveryDocument
                                                                                 and $projection.DeliveryDocument    = _ReceivedItems.DeliveryDocumentItem 
                                                                                                                                                                  
  association [0..1] to I_FldLogsInbDelivWhseTsk      as _FldLogsInbDelivWhseTsk on  _DeliveryItem.DistrStatusByDecentralizedWrhs is not initial
//Start - Comment on 26022025 - Performance  

//                                                                                 and $projection.DeliveryDocumentItem             = _FldLogsInbDelivWhseTsk.DeliveryDocumentItem

//                                                                                 and _DeliveryItem.DeliveryDocument               = _FldLogsInbDelivWhseTsk.DeliveryDocument

//End - Comment on 26022025 - Performance

//Start - Add on 26022025 - Performance

                                                                                 and $projection.EWMWhseReqRefDocumentNumber    = _FldLogsInbDelivWhseTsk.EWMDelivery
                                                                                 and $projection.EWMWhseRequestRefDocumentItem  = _FldLogsInbDelivWhseTsk.EWMDeliveryItem
//End - Add on 26022025 - Performance                                            

  association [0..1] to I_FldLogsAggregateDelivQty    as _DeliveryAggrgQty       on  _DeliveryItem.DeliveryDocument   is not initial
                                                                                 and _DeliveryItem.DeliveryDocument   = _DeliveryAggrgQty.DeliveryDocument
                                                                                 and $projection.DeliveryDocumentItem = _DeliveryAggrgQty.DeliveryDocumentItem


  association [0..1] to I_FldLogsOpenPackQty          as _OpenPackQty            on  _DeliveryItem.DeliveryDocument   is not initial
                                                                                 and _DeliveryItem.DeliveryDocument   = _OpenPackQty.DeliveryDocument
                                                                                 and $projection.DeliveryDocumentItem = _OpenPackQty.DeliveryDocumentItem
  association [0..1] to I_Supplier                    as _Supplier               on  $projection.supplier = _Supplier.Supplier
  association [0..1] to I_Customer                    as _SoldToParty            on  _DeliveryItem.SoldToParty = _SoldToParty.Customer
  association [0..1] to I_Customer                    as _ShipToParty            on  _DeliveryItem.ShipToParty = _ShipToParty.Customer
{
  key  _PurchasingDocumentItem.PurchasingDocument                                                                          as PurchasingDocument,
  key  _PurchasingDocumentItem.PurchasingDocumentItem                                                                      as PurchasingDocumentItem,
  key coalesce(_DeliveryItem.DeliveryDocument,' ')                                                                         as DeliveryDocument,
  key coalesce(_DeliveryItem.DeliveryDocumentItem,'000000')                                                                as DeliveryDocumentItem,                     
       _PurchasingDocumentItem.PurchaseRequisition                                                                         as PurchaseRequisition,
       _PurchasingDocumentItem.PurchaseRequisitionItem                                                                     as PurchaseRequisitionItem,

       concat(concat(_PurchasingDocumentItem.PurchasingDocument, '/'), _PurchasingDocumentItem.PurchasingDocumentItem)     as FldLogsPurOrdItem,
       concat(concat(_DeliveryItem.DeliveryDocument, '/'), _DeliveryItem.DeliveryDocumentItem)                             as FldLogsDelivDocItem,
       _PurchasingDocumentItem.IsCompletelyDelivered                                                                       as IsCompletelyDelivered,

       _PurchasingDocumentItem.Material                                                                                    as Material,
       _PurchasingDocumentItem.Plant                                                                                       as Plant,

       _PurchasingDocumentItem.StockType                                                                                   as TargetStockType,
       coalesce( _DeliveryItem.DeliveryDate,_POOpenQty.DeliveryDate )                                                      as DeliveryDate,
       @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
       cast( coalesce( _DeliveryItem.ActualDeliveryQuantity,0) as lfimg )                                                                     as FldLogsDelivQty,    
       _DeliveryItem.DeliveryQuantityUnit,
       @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
       _POOpenQty.OpenQtyInPurchaseOrderUnit,
       // 2 step GR for future release

//       @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'

//        cast( coalesce(_OpenBlockedItems.FldLogsBlockedQty,0) as lfimg )                                                   as FldLogsBlockedQty,

//       @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'

//       cast( coalesce(_ReceivedItems.FldLogsTotalReceivedQty,0) as lfimg )                                                 as FldLogsTotalReceivedQty,

       @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
       _PurchasingDocumentItem.OrderQuantity                                                                               as FldLogsPOTotalQty,
       _PurchasingDocumentItem.OrderQuantityUnit                                                                           as OrderQuantityUnit,
       //2370018858 Remote  STO  Storage location

       case when _PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentSubtype = 'T'
       then _PurchasingDocumentItem.StorageLocation
       else
       coalesce(_DeliveryItem.StorageLocation,_PurchasingDocumentItem.StorageLocation )                                end as StorageLocation,
       coalesce(_DeliveryItem.Batch,_POOpenQty.Batch)                                                                      as Batch,
       _PurchasingDocumentItem.DocumentCurrency                                                                            as DocumentCurrency,
       @Semantics.amount.currencyCode: 'DocumentCurrency'
       _PurchasingDocumentItem.NetPriceAmount                                                                              as NetPriceAmount,
       _PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentSubtype,
       _PurchasingDocumentItem._PurchasingDocument.Supplier,
       case when _PurchasingDocumentItem.StockType = 'X'
       then cast('X' as boolean )
       when _PurchasingDocumentItem.StockType <> 'X' 
       then cast( '' as boolean) end                                                                                       as QltyMgmtInProcmtIsActive,
       _PurchasingDocumentItem.MaterialGroup,
       _MaterialDetails,
       _POOpenQty,
       _ValuationType,
       _ProductPlant,
       _PurchasingDocumentItem._PurchasingDocument,
       _PurchasingDocumentItem._Plant,
       _Supplier,
       _DeliveryItem.DeliveryDocument                                                                                      as InboundDelivery,
       _DeliveryItem.GoodsMovementStatus,
       _DeliveryItem.GoodsMovementType,
       @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
       _DeliveryItem.ActualDeliveryQuantity,
       coalesce(_DeliveryItem.InventoryValuationType, _PurchasingDocumentItem.ValuationType)                               as InventoryValuationType,
       _DeliveryItem.FldLogsStatus,
       _DeliveryItem.DistrStatusByDecentralizedWrhs,
       _DeliveryItem.DeliveryDocumentBySupplier,
       _DeliveryItem.LoadingPoint,
       _DeliveryItem.UnloadingPointName,
       _DeliveryItem.PickingStatus,
       cast('' as boolean)                                                                                                 as IsToBeAcceptedAtOrigin,
       _PurchasingDocumentItem.PurchasingDocumentItemCategory,
       @Semantics.booleanIndicator: true
       _PurchasingDocumentItem._PurchasingDocument.IsEndOfPurposeBlocked,
       @Semantics.booleanIndicator: true
       _ShipToParty.IsBusinessPurposeCompleted,
       @Semantics.booleanIndicator: true
       _SoldToParty.IsBusinessPurposeCompleted                                                                             as IsBusPrpsCmpltdCustomer,
       @Semantics.booleanIndicator: true
       _DeliveryItem._Supplier.IsBusinessPurposeCompleted                                                                  as SuplrCoIsBusPrpsCmpltd,
       
       //Start - Add on 26022025 - Performance

       lpad(_DeliveryItem.DeliveryDocument, 35, '0')                                                                       as EWMWhseReqRefDocumentNumber,
       cast(lpad(_DeliveryItem.DeliveryDocumentItem, 10, '0') as /scdl/dl_itemno )                                         as EWMWhseRequestRefDocumentItem,   
       //End - Add on 26022025 -  Performance

       
       _FldLogsInbDelivWhseTsk,
       _OpenPackQty,
       _DeliveryAggrgQty,
       _OpenBlockedItems,
       _ReceivedItems
}
where

  (
          _PurchasingDocumentItem.PurchasingDocumentCategory                    = 'F' // To support receipt of Purchase orders and Stock Transport orders

    or    _PurchasingDocumentItem.PurchasingDocumentCategory                    = 'L' // L is added to support sub contracting PO's


  )

  and(
          _PurchasingDocumentItem.PurchasingDocumentItemCategory                = '0' // To support only POs and STOs for stock items

    or    _PurchasingDocumentItem.PurchasingDocumentItemCategory                = '7'
    or    _PurchasingDocumentItem.PurchasingDocumentItemCategory                = '3' // 3 is added to support sub contracting PO's


  )

  and(
          _PurchasingDocumentItem.ProductType                                   = '1'
    or    _PurchasingDocumentItem.ProductType                                   is initial
  ) //Stock Items


  and(
          _PurchasingDocumentItem._PurchasingDocument.PurchasingDocumentSubtype = 'T'
    //Required to process the items having Account Assignment - Q Project Stock

    or    _PurchasingDocumentItem.AccountAssignmentCategory                     = 'Q'
    or    _PurchasingDocumentItem.AccountAssignmentCategory                     is initial
  )


  and     _PurchasingDocumentItem.IsReturnsItem                                 is initial
  and     _PurchasingDocumentItem.PurchasingDocumentDeletionCode                is initial
  //  filter for remote plant return STO will not be needed once return item flag is checkcan ed in return STO

  and(
    (
          _PurchasingDocumentItem._PurchasingDocument.SupplyingPlant            is not initial
      and _RemotePlant.Plant                                                    = _PurchasingDocumentItem.Plant
    )
    or    _PurchasingDocumentItem._PurchasingDocument.SupplyingPlant            is initial
  )