P_PurDocInfoNtwkGraph

DDL: P_PURDOCINFONTWKGRAPH SQL: PURDOCINFONTWK Type: view CONSUMPTION

Purchasing Document Information at Network Graph

P_PurDocInfoNtwkGraph is a Consumption CDS View that provides data about "Purchasing Document Information at Network Graph" in SAP S/4HANA. It reads from 2 data sources (I_SchedgAgrmtItm, I_PurchaseOrderItem) and exposes 118 fields with key fields PurchasingDocument, PurchasingDocumentItem, PurchasingDocumentItem. It has 3 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_SchedgAgrmtItm _Item union_all
I_PurchaseOrderItem I_PurchaseOrderItem from

Associations (3)

CardinalityTargetAliasCondition
[0..1] C_POItemNextDeliveryCalc _NextDeliveryCalc $projection.PurchasingDocument = _NextDeliveryCalc.PurchaseOrder and $projection.PurchasingDocumentItem = _NextDeliveryCalc.PurchaseOrderItem
[0..1] C_POItemQtyAndValueCalc _QtyAndValueCalc $projection.PurchasingDocument = _QtyAndValueCalc.PurchaseOrder and $projection.PurchasingDocumentItem = _QtyAndValueCalc.PurchaseOrderItem
[0..1] C_SchedgAgrmtItmDelivCalc _SchedgAgrmtItmDelivCalc $projection.PurchasingDocument = _SchedgAgrmtItmDelivCalc.SchedulingAgreement and $projection.PurchasingDocumentItem = _SchedgAgrmtItmDelivCalc.SchedulingAgreementItem

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PURDOCINFONTWK view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
VDM.private true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label Purchasing Document Information at Network Graph view

Fields (118)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument PurchaseOrder
KEY PurchasingDocumentItem PurchaseOrderItem
FormattedPurchasingDocItem
PurchasingDocumentItemText
Assembly
AssemblyName
Plant Plant
PlantName _Plant PlantName
Subcontractor
SubcontractorName
MaterialGroup MaterialGroup
MaterialGroupName
AccountAssignmentCategory
CompanyCode CompanyCode
CompanyCodeName _CompanyCode CompanyCodeName
PurchasingOrganization
PurchasingOrganizationName
PurchasingGroup _PurchaseOrder PurchasingGroup
PurchasingGroupName
StorageLocation StorageLocation
StorageLocationName
RequirementTracking
PurchasingDocumentCategory PurchaseOrderCategory
PurchasingDocumentCategoryName
PurchasingDocumentType
PurchasingDocumentTypeName
SchedAgrmtValidityStatus
StatusDescription
ValidityStartDate
ValidityEndDate
PurchaseOrderType _PurchaseOrder PurchaseOrderType
PurchaseOrderTypeName
OrderQuantity OrderQuantity
NetAmount NetAmount
TargetAmount
ReleasedQuantity
ReleasedAmount
GoodsReceiptQty
GoodsReceiptAmountInCoCodeCrcy
StillToBeDeliveredQuantity
StillToBeDeliveredValue
ScheduleLineDeliveryDate
OpenPurchaseOrderQuantity
DeliveryStatus
DeliveryStatusDescription
MaterialComponent
MaterialName
Supplier
SupplierName
ShippingStatus
ShippingStatusText
RequirementDate
RequiredQuantity
DocumentCurrency DocumentCurrency
PurchaseOrderQuantityUnit PurchaseOrderQuantityUnit
BaseUnit PurchaseOrderQuantityUnit
PurchaseOrderItemCategory PurchaseOrderItemCategory
SupplierIsSubcontractor SupplierIsSubcontractor
DifferenceInDays
KEY PurchasingDocumentItem SchedulingAgreementItem
FormattedPurchasingDocItem
PurchasingDocumentItemText
Assembly
AssemblyName
Plant Plant
PlantName _Plant PlantName
Subcontractor
SubcontractorName
MaterialGroup MaterialGroup
MaterialGroupName
AccountAssignmentCategory
CompanyCode CompanyCode
CompanyCodeName _CompanyCode CompanyCodeName
PurchasingOrganization
PurchasingOrganizationName
PurchasingGroup _Schedgagrmthdr PurchasingGroup
PurchasingGroupName
StorageLocation StorageLocation
StorageLocationName
RequirementTracking
PurchasingDocumentCategory PurchasingDocumentCategory
PurchasingDocumentCategoryName
PurchasingDocumentType _Schedgagrmthdr PurchasingDocumentType
PurchasingDocumentTypeName _Schedgagrmthdr PurchasingDocumentTypeName
SchedAgrmtValidityStatus
StatusDescription
ValidityStartDate _Schedgagrmthdr ValidityStartDate
ValidityEndDate _Schedgagrmthdr ValidityEndDate
PurchaseOrderType
PurchaseOrderTypeName
OrderQuantity TargetQuantity
NetAmount _SchedgAgrmtItmDelivCalc NetAmount
TargetAmount _Schedgagrmthdr TargetAmount
ReleasedQuantity
ReleasedAmount
GoodsReceiptQty
GoodsReceiptAmountInCoCodeCrcy
StillToBeDeliveredQuantity
StillToBeDeliveredValue
ScheduleLineDeliveryDate
OpenPurchaseOrderQuantity
DeliveryStatus
DeliveryStatusDescription
MaterialComponent
MaterialName
Supplier
SupplierName
ShippingStatus
ShippingStatusText
RequirementDate
RequiredQuantity
DocumentCurrency DocumentCurrency
PurchaseOrderQuantityUnit OrderQuantityUnit
BaseUnit OrderQuantityUnit
PurchaseOrderItemCategory
SupplierIsSubcontractor SupplierIsSubcontractor
DifferenceInDays _SchedgAgrmtItmDelivCalc DifferenceInDays
MRPArea MRPArea
@AbapCatalog.sqlViewName: 'PURDOCINFONTWK'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.semanticKey: ['FormattedPurchasingDocItem']
@EndUserText.label: 'Purchasing Document Information at Network Graph'
define view P_PurDocInfoNtwkGraph as select from  I_PurchaseOrderItem

  association [0..1] to C_POItemNextDeliveryCalc as _NextDeliveryCalc on  $projection.PurchasingDocument     = _NextDeliveryCalc.PurchaseOrder
                                                                      and $projection.PurchasingDocumentItem = _NextDeliveryCalc.PurchaseOrderItem

  association [0..1] to C_POItemQtyAndValueCalc  as _QtyAndValueCalc  on  $projection.PurchasingDocument     = _QtyAndValueCalc.PurchaseOrder
                                                                      and $projection.PurchasingDocumentItem = _QtyAndValueCalc.PurchaseOrderItem
{
      @Consumption.semanticObject: 'PurchaseOrder'
  key PurchaseOrder                                                                                              as  PurchasingDocument,

  key PurchaseOrderItem                                                                                          as  PurchasingDocumentItem,

      cast(concat(concat(PurchaseOrder, '/'), PurchaseOrderItem) as vdm_formattedpurchasedocitm )                as  FormattedPurchasingDocItem,

      cast(PurchaseOrderItemText as farp_pa_sgtxt)                                                               as  PurchasingDocumentItemText,


      // Assembly

      cast(Material as bagrp)                                                                                    as  Assembly,

      _Material._Text[1: Language = $session.system_language].MaterialName                                       as  AssemblyName,


      Plant,

      _Plant.PlantName,


      // Subcontractor

      cast(_PurchaseOrder.Supplier as vdm_subcontractor)                                                         as  Subcontractor,


      _PurchaseOrder._Supplier.SupplierName                                                                      as  SubcontractorName,


      MaterialGroup,

      cast( _MaterialGroup._Text[1: Language = $session.system_language ].MaterialGroupName as ps_s4_wgbez )     as  MaterialGroupName,


      cast(AccountAssignmentCategory as knttp_ll preserving type)                                                as  AccountAssignmentCategory,


      CompanyCode,

      _CompanyCode.CompanyCodeName,


      cast (_PurchaseOrder.PurchasingOrganization as ekorg_ll)                                                   as  PurchasingOrganization,

      cast ( _PurchaseOrder._PurchasingOrganization.PurchasingOrganizationName as vdm_purchasingorgname)         as  PurchasingOrganizationName,


      _PurchaseOrder.PurchasingGroup,

      cast (_PurchaseOrder._PurchasingGroup.PurchasingGroupName as vdm_purchasinggroupname)                      as  PurchasingGroupName,


      StorageLocation,

      cast (_StorageLocation.StorageLocationName as ps_s4_lgort_name )                                           as  StorageLocationName,


      cast(RequirementTracking as rqmttrckgnmbr_ll)                                                              as  RequirementTracking,


      // Document Type

      PurchaseOrderCategory                                                                                      as  PurchasingDocumentCategory,

      _PurgDocumentCategory._Text[1: Language = $session.system_language].PurchasingDocumentCategoryName,


      // Agreement Type

      cast ('' as bsart)                                                                                         as  PurchasingDocumentType,

      cast ('' as batxt)                                                                                         as  PurchasingDocumentTypeName,

      // Agreement Validity Status

      cast ('' as abap.char(10))                                                                                 as  SchedAgrmtValidityStatus,

      cast ('' as abap.char(10))                                                                                 as  StatusDescription,


      cast ('00000000' as kdatb)                                                                                 as  ValidityStartDate,

      cast ('00000000' as kdate)                                                                                 as  ValidityEndDate,


      //Order Type

      _PurchaseOrder.PurchaseOrderType,

      _PurchaseOrder._PurchaseOrderType._Text[1: Language = $session.system_language].PurchasingDocumentTypeName as  PurchaseOrderTypeName,


      // Order Quantity

      OrderQuantity,

      // Net Order Value

      NetAmount,

      cast(0 as ktwrt)                                                                                           as  TargetAmount,

      cast(0 as abap.quan(13,3))                                                                                 as  ReleasedQuantity,

      cast(0 as vdm_releasedvalue)                                                                               as  ReleasedAmount,

      // Delivered Quantity

      cast(_QtyAndValueCalc.GoodsReceiptQty as mm_a_delivererd_quantity)                                         as  GoodsReceiptQty,

      // Delivered Value

      cast(_QtyAndValueCalc.GoodsReceiptAmountInCoCodeCrcy as mm_delivered_value)                                as  GoodsReceiptAmountInCoCodeCrcy,

      // Still to be Delivered Quantity

      cast(_QtyAndValueCalc.StillToBeDeliveredQuantity as vdm_stilltobedeliveredquantity )                       as  StillToBeDeliveredQuantity,

      // Still to be Delivered Value

      cast(_QtyAndValueCalc.StillToBeDeliveredValue as vdm_stilltobedeliveredvalue)                              as  StillToBeDeliveredValue,


      // Next Delivery Date

      cast(_NextDeliveryCalc.ScheduleLineDeliveryDate as vdm_nextscheddelivdte)                                  as  ScheduleLineDeliveryDate,


      // Next Delivery Quantity

      cast(_NextDeliveryCalc.ScheduleLineOpenQty as nextscheddelivqty_ll)                                        as  OpenPurchaseOrderQuantity,


      // Delivery Status

      cast(_NextDeliveryCalc.DeliveryStatus as vdm_nextscheddelivsts)                                            as  DeliveryStatus,

      cast (_NextDeliveryCalc._DeliveryStatusText.DomainText as vdm_nextscheddelivsts)                           as  DeliveryStatusDescription,


      // Component

      cast(' ' as vdm_component)                                                                                 as  MaterialComponent,

      cast(' ' as maktx)                                                                                         as  MaterialName,


      // Third Party Supplier

      cast(' ' as vdm_thirdptysuplr)                                                                             as  Supplier,

      cast(' ' as suppliername)                                                                                  as  SupplierName,


      // Shipping Status

      cast(' ' as vdm_nextschedshipgsts)                                                                         as  ShippingStatus,

      cast (' ' as vdm_nextschedshipgsts)                                                                        as  ShippingStatusText,


      // Next Shipping Date

      cast('00000000' as vdm_nextschedshipgdte)                                                                  as  RequirementDate,


      // Next Shipping Quantity

      cast(0 as nextschedshipgqty_ll)                                                                            as  RequiredQuantity,


      DocumentCurrency,

      PurchaseOrderQuantityUnit,

      PurchaseOrderQuantityUnit                                                                                  as  BaseUnit,


      // ---------------------------------------------------------------

      // Required for restricting Purchase Orders in where condition

      // ---------------------------------------------------------------

      PurchaseOrderItemCategory,

      SupplierIsSubcontractor,

      cast( 0 as abap.int4)                                                                                      as  DifferenceInDays,

      MRPArea

      // Criticality for Delivery date

      //      @UI.hidden: true

      //      case

      //        when _NextDeliveryCalc.ScheduleLineDeliveryDate < $session.system_date

      //        then 1

      //        when _NextDeliveryCalc.ScheduleLineDeliveryDate = $session.system_date

      //        then 2

      //        else 3

      //      end                      as  DeliveryDateCriticality

      //



}

where

  // ---------------------------------------------------------------

  // Subcontracting Orders Only - Condition for First Tab

  // ---------------------------------------------------------------


  (
      (  PurchaseOrderItemCategory                     =  '3'
        or SupplierIsSubcontractor                            =  'X')
    and PurchasingDocumentDeletionCode                <> 'L'
    and _PurchaseOrder.PurchasingDocumentDeletionCode <> 'L'
    and IsCompletelyDelivered                         =  ' '
    and _NextDeliveryCalc.ScheduleLineOrderQuantity   >  _NextDeliveryCalc.RoughGoodsReceiptQty
  )

// ---------------------------------------------------------------

// Scheduling Agreement

// ---------------------------------------------------------------


union all select from I_SchedgAgrmtItm as _Item

association [0..1] to C_SchedgAgrmtItmDelivCalc as _SchedgAgrmtItmDelivCalc on  $projection.PurchasingDocument     = _SchedgAgrmtItmDelivCalc.SchedulingAgreement
                                                                            and $projection.PurchasingDocumentItem = _SchedgAgrmtItmDelivCalc.SchedulingAgreementItem
{

      @Consumption.semanticObject: 'PurchaseSchedulingAgreement'
  key SchedulingAgreement                                                                                     as  PurchasingDocument,

  key SchedulingAgreementItem                                                                                 as  PurchasingDocumentItem,

      cast(concat(concat(SchedulingAgreement, '/'), SchedulingAgreementItem) as vdm_formattedpurchaseorditm ) as  FormattedPurchasingDocItem,

      cast(PurchasingDocumentItemText as farp_pa_sgtxt)                                                       as  PurchasingDocumentItemText,


      // Assembly

      cast(Material as bagrp)                                                                                 as  Assembly,

      _Material._Text[1: Language = $session.system_language].MaterialName                                    as  AssemblyName,

      //      Material                                    as Assembly,

      //

      //      _Material._Text[1: Language = $session.system_language].MaterialName               as AssemblyName,



      Plant,

      _Plant.PlantName,


      // Subcontractor

      cast(_Schedgagrmthdr.Supplier as vdm_subcontractor)                                                     as  Subcontractor,


      _Schedgagrmthdr._Supplier.SupplierName                                                                  as  SubcontractorName,

      //      _Schedgagrmthdr.Supplier                    as Subcontractor,

      //

      //      _Schedgagrmthdr._Supplier.SupplierName      as SubcontractorName,



      MaterialGroup,

      cast( _MaterialGroup._Text[1: Language = $session.system_language ].MaterialGroupName as ps_s4_wgbez )  as  MaterialGroupName,


      cast(AccountAssignmentCategory as knttp_ll preserving type)                                             as  AccountAssignmentCategory,


      CompanyCode,

      _CompanyCode.CompanyCodeName,


      cast (_Schedgagrmthdr.PurchasingOrganization as ekorg_ll)                                               as  PurchasingOrganization,

      cast ( _Schedgagrmthdr._PurchasingOrganization.PurchasingOrganizationName as vdm_purchasingorgname)     as  PurchasingOrganizationName,


      _Schedgagrmthdr.PurchasingGroup,

      cast (_Schedgagrmthdr._PurchasingGroup.PurchasingGroupName as vdm_purchasinggroupname)                  as  PurchasingGroupName,


      StorageLocation,

      cast (_StorageLocation.StorageLocationName as ps_s4_lgort_name )                                        as  StorageLocationName,


      cast(RequirementTracking as rqmttrckgnmbr_ll)                                                           as  RequirementTracking,


      //Document Type

      PurchasingDocumentCategory,

      _PurgDocumentCategory._Text[1: Language = $session.system_language ].PurchasingDocumentCategoryName,


      //Agreement Type

      _Schedgagrmthdr.PurchasingDocumentType,

      _Schedgagrmthdr.PurchasingDocumentTypeName,


      // Agreement Validity Status

      cast (_SchedgAgrmtItmDelivCalc.SchedAgrmtValidityStatus as abap.char(10))                               as  SchedAgrmtValidityStatus,

      cast (_SchedgAgrmtItmDelivCalc._ValidityStatusVH.Name as abap.char(10))                                 as  StatusDescription,


      _Schedgagrmthdr.ValidityStartDate,

      _Schedgagrmthdr.ValidityEndDate,


      //Order Type

      cast('' as bsart)                                                                                       as  PurchaseOrderType,

      cast('' as batxt)                                                                                       as  PurchaseOrderTypeName,


      TargetQuantity                                                                                          as  OrderQuantity,

      _SchedgAgrmtItmDelivCalc.NetAmount                                                                      as  NetAmount,

      //Agreement Target Value

      _Schedgagrmthdr.TargetAmount,


      cast (_SchedgAgrmtItmDelivCalc.ReleasedQuantity as vdm_stilltobedeliveredquantity)                      as  ReleasedQuantity,

      cast (_SchedgAgrmtItmDelivCalc.ReleasedAmount as vdm_stilltobedeliveredvalue)                           as  ReleasedAmount,

      cast (_SchedgAgrmtItmDelivCalc.GoodsReceiptQty as mm_a_delivererd_quantity)                             as  GoodsReceiptQty,

      cast (_SchedgAgrmtItmDelivCalc.GoodsReceiptAmountInCoCodeCrcy as mm_delivered_value)                    as  GoodsReceiptAmountInCoCodeCrcy,

      cast (_SchedgAgrmtItmDelivCalc.StillToBeDeliveredQuantity as vdm_stilltobedeliveredquantity)            as  StillToBeDeliveredQuantity,

      cast (_SchedgAgrmtItmDelivCalc.StillToBeDeliveredValue as vdm_stilltobedeliveredvalue)                  as  StillToBeDeliveredValue,

      cast(_SchedgAgrmtItmDelivCalc.ScheduleLineDeliveryDate as vdm_nextscheddelivdte)                        as  ScheduleLineDeliveryDate,


      // Next Delivery Quantity

      @Semantics.quantity.unitOfMeasure: 'PurchaseOrderQuantityUnit'
      cast(_SchedgAgrmtItmDelivCalc.ScheduleLineOpenQty as nextscheddelivqty_ll)                              as  OpenPurchaseOrderQuantity,



      // Next Delivery Status

      cast(_SchedgAgrmtItmDelivCalc.DeliveryStatus as vdm_nextscheddelivsts)                                  as  DeliveryStatus,

      cast (_SchedgAgrmtItmDelivCalc._DeliveryStatusText.DomainText as vdm_nextscheddelivsts)                 as  DeliveryStatusDescription,


      // Component

      cast(' ' as vdm_component)                                                                              as  MaterialComponent,

      cast(' ' as maktx)                                                                                      as  MaterialName,

      // Third Party Supplier

      cast(' ' as vdm_thirdptysuplr)                                                                          as  Supplier,

      cast(' ' as suppliername)                                                                               as  SupplierName,

      //Shipping Status

      cast(' 'as vdm_nextschedshipgsts)                                                                       as  ShippingStatus,

      cast (' ' as vdm_nextschedshipgsts)                                                                     as  ShippingStatusText,




      // Next Shipping Date

      cast('00000000' as vdm_nextschedshipgdte)                                                               as  RequirementDate,


      // Next Shipping Quantity

      cast(0 as nextschedshipgqty_ll)                                                                         as  RequiredQuantity,



      @Semantics.currencyCode: true
      DocumentCurrency,

      @Semantics.unitOfMeasure:true
      OrderQuantityUnit                                                                                       as  PurchaseOrderQuantityUnit,

      @Semantics.unitOfMeasure: true
      OrderQuantityUnit                                                                                       as  BaseUnit,

      cast ('' as pstyp)                                                                                      as  PurchaseOrderItemCategory,

      SupplierIsSubcontractor,

      _SchedgAgrmtItmDelivCalc.DifferenceInDays,

      MRPArea

      // Criticality for Shipping date

      //      @UI.hidden: true

      //      case

      //        when _SchedgAgrmtItmDelivCalc.ScheduleLineDeliveryDate < $session.system_date

      //        then 1

      //        when _SchedgAgrmtItmDelivCalc.ScheduleLineDeliveryDate = $session.system_date

      //        then 2

      //        else 3

      //      end                      as  DeliveryDateCriticality



}

where

  // ---------------------------------------------------------------

  // Subcontracting SA Only - Condition for First Tab

  // ---------------------------------------------------------------


  (
       ( PurchasingDocumentItemCategory                     =  '3'
        or  SupplierIsSubcontractor                            =  'X')
    and PurchasingDocumentDeletionCode                     <> 'L'
    and _Schedgagrmthdr.PurchasingDocumentDeletionCode     <> 'L'

    and _SchedgAgrmtItmDelivCalc.ScheduleLineOrderQuantity >  _SchedgAgrmtItmDelivCalc.RoughGoodsReceiptQty
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_MM_VALIDITYSTATUSVALHELP",
"C_POITEMNEXTDELIVERYCALC",
"C_POITEMQTYANDVALUECALC",
"C_SCHEDGAGRMTITMDELIVCALC",
"I_COMPANYCODE",
"I_MATERIAL",
"I_MATERIALGROUP",
"I_MATERIALGROUPTEXT",
"I_MATERIALTEXT",
"I_PLANT",
"I_PROCMTSHIPPINGSTATUSTEXT",
"I_PURCHASEORDER",
"I_PURCHASEORDERITEM",
"I_PURCHASINGDOCUMENTCATEGORY",
"I_PURCHASINGDOCUMENTTYPE",
"I_PURCHASINGDOCUMENTTYPETEXT",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"I_PURGDOCUMENTCATEGORYTEXT",
"I_SCHEDGAGRMTHDR",
"I_SCHEDGAGRMTITM",
"I_STORAGELOCATION",
"I_SUPPLIER"
],
"ASSOCIATED":
[
"C_POITEMNEXTDELIVERYCALC",
"C_POITEMQTYANDVALUECALC"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/