P_PlantReferences

DDL: P_PLANTREFERENCES SQL: PLANTREF Type: view BASIC Package: VDM_MD_PRODUCT

Reference Store and Distribution Centre

P_PlantReferences is a Basic CDS View that provides data about "Reference Store and Distribution Centre" in SAP S/4HANA. It reads from 1 data source (t001w) and exposes 5 fields with key field Plant. Part of development package VDM_MD_PRODUCT.

Data Sources (1)

SourceAliasJoin Type
t001w t001w from

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PLANTREF view
VDM.viewType #BASIC view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #MASTER view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (5)

KeyFieldSource TableSource FieldDescription
KEY Plant t001w werks
SalesOrganization t001w vkorg
DistributionChannel t001w vtweg
PlantCategory t001w vlfkz
vlgfielseendasvlgfiasReferenceStore
@AbapCatalog.sqlViewName: 'PLANTREF'
@VDM.viewType: #BASIC
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true

@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory : #S
@ObjectModel.usageType.dataClass: #MASTER

@AbapCatalog.compiler.compareFilter:true
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_PlantReferences as select from t001w
    left outer to one join tvkov on  t001w.vkorg = tvkov.vkorg
                                 and t001w.vtweg = tvkov.vtweg
    left outer to one join twpa  on  t001w.mandt = twpa.mandt

{

  key t001w.werks      as Plant,
      t001w.vkorg      as SalesOrganization,
      t001w.vtweg      as DistributionChannel,
      //      t001w.spart,

      t001w.vlfkz      as PlantCategory,

      cast (
      case
      when t001w.vlfkz = 'B' and twpa.vlgvz = t001w.werks
        then ''
      when t001w.vlfkz = 'B'  //twpa.vlgvz <> t001w.werks

        then twpa.vlgvz
      else ''
      end as vlgvz )   as ReferenceDistributionCenter,



      cast (
      case
        when tvkov.vlgfi = t001w.werks and t001w.vlfkz = 'A'
          then ''  //t001w.werks is reference store

        when tvkov.vlgfi <> '' and t001w.vlfkz = 'A' //twpa.vlgfi <> t001w.werks

          then tvkov.vlgfi
        when tvkov.vlgfi = '' and t001w.vlfkz = 'A' and twpa.vlgfi = t001w.werks
          then ''  //t001w.werks is reference store

        when tvkov.vlgfi = '' and t001w.vlfkz = 'A' and twpa.vlgfi<> t001w.werks
          then twpa.vlgfi
        else ''  //no reference store maintained

      end as vlgfi )   as ReferenceStore,



      cast (
      case
        when t001w.vlfkz = 'B' and twpa.vlgvz = t001w.werks
          then 'X'
        else ''
      end as boole_d ) as IsReferenceDistributionCenter,



      cast (
      case
        when tvkov.vlgfi = t001w.werks and t001w.vlfkz = 'A'
          then 'X'
        when tvkov.vlgfi = '' and twpa.vlgfi = t001w.werks and t001w.vlfkz = 'A'
          then 'X'
        else ''
      end as boole_d ) as IsReferenceStore


}