P_MSPWSELLABLEPRODUCT

CDS View

P_MSPWSELLABLEPRODUCT is a CDS View in S/4HANA. It contains 2 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_MSPWMovableProduct view from BASIC

Fields (2)

KeyField CDS FieldsUsed in Views
KEY Product Product 1
KEY Store Store 1
@ClientHandling.algorithm: #SESSION_VARIABLE //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #L //Inserted by VDM CDS Suite Plugin

@AbapCatalog.sqlViewName: 'PMSPWSELLABLPROD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@VDM.private: true
@VDM.viewType: #BASIC
//Remark: Planned to be made reusable as I_SellableProductsInRtlStore (see GTNC)

define view P_MSPWSellableProduct
  as select from I_ProductPlant
    inner join I_Site on I_ProductPlant.Plant = I_Site.Site
  association [0..1] to I_ProductSalesDeliveryPOS as _ProductPosControlSalesOrg on  _ProductPosControlSalesOrg.Product                 = I_ProductPlant.Product
                                                                                and _ProductPosControlSalesOrg.ProductSalesOrg         = I_Site.SalesOrganization
                                                                                and _ProductPosControlSalesOrg.ProductDistributionChnl = I_Site.DistributionChannel
                                                                                and _ProductPosControlSalesOrg.Plant                   = ''
  association [0..1] to I_ProductSalesDeliveryPOS as _ProductPosControlStore    on  _ProductPosControlStore.Product                 = I_ProductPlant.Product
                                                                                and _ProductPosControlStore.ProductSalesOrg         = I_Site.SalesOrganization
                                                                                and _ProductPosControlStore.ProductDistributionChnl = I_Site.DistributionChannel
                                                                                and _ProductPosControlStore.Plant                   = I_Site.Site
{
  key I_ProductPlant.Plant as Store,
  key I_ProductPlant.Product

}
// Select only stores

where
            I_Site.SiteCategory                           = 'A'
  and(
    (
            // Allow entry when PosControl for Store exists.

            _ProductPosControlStore.Product               is not null
      and(
            _ProductPosControlStore.StoreSaleStartDate    <= $session.system_date
        and _ProductPosControlStore.StoreSaleEndDate      >= $session.system_date
      )
    )
    or(
            // If ProductPosControlStore does not exist, then use the sales org specific ruleset

            _ProductPosControlSalesOrg.Product            is not null
      and   _ProductPosControlStore.Product               is null
      and(
            _ProductPosControlSalesOrg.StoreSaleStartDate <= $session.system_date
        and _ProductPosControlSalesOrg.StoreSaleEndDate   >= $session.system_date
      )
    )
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PRODUCTPLANT",
"I_PRODUCTSALESDELIVERYPOS",
"I_SITE"
],
"ASSOCIATED":
[
"I_PRODUCTSALESDELIVERYPOS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/