I_ProductsForSaleInRtlStore

DDL: I_PRODUCTSFORSALEINRTLSTORE SQL: IRTSTSELLABLPROD Type: view COMPOSITE Package: ODATA_RETAIL_ST_COMMON

Retail Store Products available for sale

I_ProductsForSaleInRtlStore is a Composite CDS View that provides data about "Retail Store Products available for sale" in SAP S/4HANA. It reads from 2 data sources (I_ProductPlant, I_Site) and exposes 3 fields with key fields Store, Product. It has 2 associations to related views. Part of development package ODATA_RETAIL_ST_COMMON.

Data Sources (2)

SourceAliasJoin Type
I_ProductPlant I_ProductPlant from
I_Site I_Site inner

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_ProductSalesDeliveryPOS _ProductPosControlSalesOrg _ProductPosControlSalesOrg.Product = I_ProductPlant.Product and _ProductPosControlSalesOrg.ProductSalesOrg = I_Site.SalesOrganization and _ProductPosControlSalesOrg.ProductDistributionChnl = I_Site.DistributionChannel and _ProductPosControlSalesOrg.Plant = ''
[0..1] I_ProductSalesDeliveryPOS _ProductPosControlStore _ProductPosControlStore.Product = I_ProductPlant.Product and _ProductPosControlStore.ProductSalesOrg = I_Site.SalesOrganization and _ProductPosControlStore.ProductDistributionChnl = I_Site.DistributionChannel and _ProductPosControlStore.Plant = I_Site.Site

Annotations (11)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
AbapCatalog.sqlViewName IRTSTSELLABLPROD view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
EndUserText.label Retail Store Products available for sale view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY Store I_ProductPlant Plant
KEY Product I_ProductPlant Product
_Plant _Plant
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@AbapCatalog.sqlViewName: 'IRTSTSELLABLPROD'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE

@EndUserText.label: 'Retail Store Products available for sale'
define view I_ProductsForSaleInRtlStore
  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, 
  
  _Plant
}
// 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
      )
    )
  )