I_RO_SAFTProduct

DDL: I_RO_SAFTPRODUCT Type: view COMPOSITE Package: GLO_LOG_SAFT_RO

RO SAFT Products

I_RO_SAFTProduct is a Composite CDS View that provides data about "RO SAFT Products" in SAP S/4HANA. It reads from 1 data source (I_MaterialPlant) and exposes 15 fields with key fields Product, Plant. It has 7 associations to related views. Part of development package GLO_LOG_SAFT_RO.

Data Sources (1)

SourceAliasJoin Type
I_MaterialPlant _MaterialPlant inner

Parameters (2)

NameTypeDefault
P_FromPostingDate figen_rep_date_from
P_ToPostingDate figen_rep_date_to

Associations (7)

CardinalityTargetAliasCondition
[0..1] I_RO_SAFTProductValuation _Prodval _Product.Product = _Prodval.Product and _MaterialPlant.Plant = _Prodval.ValuationArea and _Prodval.ValuationType is initial
[0..1] I_RO_SAFTCommodityCode _CommCode _Product.Product = _CommCode.ProductID and _CommCode.RO_SAFTComCodeValidFromDate <= $parameters.P_ToPostingDate and _CommCode.RO_SAFTComCodeValidToDate >= $parameters.P_FromPostingDate
[0..1] I_ProductText _description _Product.Product = _description.Product and _description.Language = '4'
[0..1] I_ProductText _descriptionE _Product.Product = _descriptionE.Product and _descriptionE.Language = 'E'
[0..1] I_RO_SAFTUnitOfMeasureMap _Uom _Product.BaseUnit = _Uom.SourceUnitOfMeasure
[0..1] I_ProductUnitsOfMeasure _ProductUom _Product.Product = _ProductUom.Product and _Product.BaseUnit = _ProductUom.AlternativeUnit
[0..1] I_RO_SAFTGoodsService _GoodsService _Product.ProductType = _GoodsService.MaterialType

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName IROSAFTPRODUCT view
AbapCatalog.preserveKey true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #CHECK view
EndUserText.label RO SAFT Products view
ObjectModel.representativeKey Product view
AbapCatalog.compiler.compareFilter true view
Analytics.internalName #LOCAL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (15)

KeyFieldSource TableSource FieldDescription
KEY Product I_MaterialPlant Material
KEY Plant I_MaterialPlant Plant
MaterialType _Product ProductType
RO_SAFTGoodsService _GoodsService RO_SAFTGoodsService
ProductGroup _Product ProductGroup
CommodityCodeText _CommCode CommodityCodeText
RO_SAFTComCodeValidFromDate _CommCode RO_SAFTComCodeValidFromDate
RO_SAFTComCodeValidToDate _CommCode RO_SAFTComCodeValidToDate
ProductName
ProductStandardID _Product ProductStandardID
BaseUnit _Product BaseUnit
SourceUnitOfMeasureFactor _Uom SourceUnitOfMeasureFactor
AlternativeUnit _ProductUom AlternativeUnit
QuantityNumerator _ProductUom QuantityNumerator
QuantityDenominator _ProductUom QuantityDenominator
// active core entity

@AbapCatalog: {
  sqlViewName: 'IROSAFTPRODUCT',
  preserveKey: true
}
@VDM.viewType: #COMPOSITE
@AccessControl: {
  authorizationCheck: #CHECK
}
@EndUserText.label: 'RO SAFT Products'
@ObjectModel.representativeKey: 'Product'
@AbapCatalog.compiler.compareFilter:true
@Analytics.internalName:#LOCAL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory : #XL
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ClientHandling.algorithm: #SESSION_VARIABLE

define view I_RO_SAFTProduct
  with parameters
    P_FromPostingDate : figen_rep_date_from,
    P_ToPostingDate   : figen_rep_date_to
  as select distinct from I_Product       as _Product
  //association [0..1] to I_Material                as _Material    on $projection.Product  = _Material.Material

    inner join            I_MaterialPlant as _MaterialPlant on _Product.Product = _MaterialPlant.Material
  association [0..1] to I_RO_SAFTProductValuation as _Prodval      on  _Product.Product       = _Prodval.Product
                                                                   and _MaterialPlant.Plant   = _Prodval.ValuationArea
                                                                   and _Prodval.ValuationType is initial
  association [0..1] to I_RO_SAFTCommodityCode    as _CommCode     on  _Product.Product                      = _CommCode.ProductID
                                                                   and _CommCode.RO_SAFTComCodeValidFromDate <= $parameters.P_ToPostingDate
                                                                   and _CommCode.RO_SAFTComCodeValidToDate   >= $parameters.P_FromPostingDate
  //and _MaterialPlant.Plant = _CommCode.Plant

  association [0..1] to I_ProductText             as _description  on  _Product.Product = _description.Product
                                                                   and _description.Language = '4'
  association [0..1] to I_ProductText             as _descriptionE on  _Product.Product = _descriptionE.Product
                                                                   and _descriptionE.Language = 'E'
  association [0..1] to I_RO_SAFTUnitOfMeasureMap as _Uom          on  _Product.BaseUnit = _Uom.SourceUnitOfMeasure
  association [0..1] to I_ProductUnitsOfMeasure   as _ProductUom   on  _Product.Product  = _ProductUom.Product
                                                                   and _Product.BaseUnit = _ProductUom.AlternativeUnit
  //association [0..1] to I_RO_SAFTGoodsService     as _GoodsService  on _Product.MaterialType = _GoodsService.MaterialType

  association [0..1] to I_RO_SAFTGoodsService     as _GoodsService on  _Product.ProductType = _GoodsService.MaterialType
{
  key _MaterialPlant.Material               as                                    Product,
  key _MaterialPlant.Plant                  as                                    Plant,
      //  cast( case when _Product.ProductType = 'DIEN'

      //               then 02

      //               else 01

      //      end  as mtart )         as MaterialType,//GoodsServicesID,

      _Product.ProductType                  as                                    MaterialType,
      _GoodsService.RO_SAFTGoodsService     as                                    RO_SAFTGoodsService,

      //  _Material.MaterialGroup     as ProductGroup,

      _Product.ProductGroup                 as                                    ProductGroup,
      _CommCode.CommodityCodeText           as                                    CommodityCodeText,
      _CommCode.RO_SAFTComCodeValidFromDate as                                    RO_SAFTComCodeValidFromDate,
      _CommCode.RO_SAFTComCodeValidToDate   as                                    RO_SAFTComCodeValidToDate,
      coalesce(_description.ProductName, coalesce(_descriptionE.ProductName, 'N.A.')) as ProductName,
      _Product.ProductStandardID            as                                    ProductStandardID,

      case when ( _Prodval.IsLIFOAndFIFORelevant is not initial and _Prodval.LIFOValuationPoolNumber is initial )
             then  'FIFO'
           when ( _Prodval.IsLIFOAndFIFORelevant is not initial and _Prodval.LIFOValuationPoolNumber is not initial )
             then 'LIFO'
           when ( _Prodval.IsLIFOAndFIFORelevant is initial and _Prodval.InventoryValuationProcedure is not initial )
             then _Prodval.InventoryValuationProcedure
          end                               as                                    ValuationClass, //ValuationMethod,


      _Product.BaseUnit                     as                                    BaseUnit,
      _Uom.SourceUnitOfMeasureFactor        as                                    SourceUnitOfMeasureFactor,
      _ProductUom.AlternativeUnit           as                                    AlternativeUnit,

      _ProductUom.QuantityNumerator         as                                    QuantityNumerator,
      _ProductUom.QuantityDenominator       as                                    QuantityDenominator,

      //case when ( _Uom.SourceUnitOfMeasureFactor = _ProductUom.AlternativeUnit )

      case when ( _Product.BaseUnit = _ProductUom.AlternativeUnit )
            then 1
           when ( _ProductUom.QuantityNumerator <> 0
              and _ProductUom.QuantityDenominator <> 0 )
      //then cast (_ProductUom.QuantityNumerator / _ProductUom.QuantityDenominator as int4)

      //then div( _ProductUom.QuantityNumerator, _ProductUom.QuantityDenominator )

            then division( _ProductUom.QuantityNumerator, _ProductUom.QuantityDenominator, 5 )
             else 0
      end                                   /*as abap.fltp preserving type )*/ as ConversionFactor
}