I_SupProtTimeBucketChart

DDL: I_SUPPROTTIMEBUCKETCHART Type: view_entity TRANSACTIONAL

Supply Protection Time Bucket Chart

I_SupProtTimeBucketChart is a Transactional CDS View that provides data about "Supply Protection Time Bucket Chart" in SAP S/4HANA. It reads from 1 data source (I_SupplyProtectionTimeBucketTP) and exposes 7 fields with key field SupProtTimeBucketUUID. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_SupplyProtectionTimeBucketTP I_SupplyProtectionTimeBucketTP from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_SupProtTimeBucketSum _SupProtTimeBucketSum $projection.SupProtTimeBucketUUID = _SupProtTimeBucketSum.SupProtTimeBucketUUID

Annotations (7)

NameValueLevelField
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AccessControl.authorizationCheck #MANDATORY view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label Supply Protection Time Bucket Chart view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY SupProtTimeBucketUUID SupProtTimeBucketUUID
SupplyProtectionGroupUUID SupplyProtectionGroupUUID
StartDate
UnitOfMeasure I_SupplyProtectionTimeBucketTP UnitOfMeasure
SupProtProtectedQuantity SupProtProtectedQuantity
SupProtSumConsumedQuantity
_SupProtTimeBucketSum _SupProtTimeBucketSum
@VDM.viewType: #TRANSACTIONAL
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@AccessControl.authorizationCheck: #MANDATORY

@ObjectModel:   { usageType: { serviceQuality: #C,
                               sizeCategory:   #XL,
                               dataClass:      #MIXED }
}
@EndUserText.label: 'Supply Protection Time Bucket Chart'
@UI.chart: [{
  qualifier: 'TimeBucketsChart',
  title: 'Values for Time Buckets',
  chartType: #VERTICAL_BULLET,
  dimensions: ['StartDate'],
  measures: ['SupProtRemainingProtectedQty','SupProtSumConsumedQuantity','SupProtProtectedQuantity' ],
  measureAttributes: [
                      {measure: 'SupProtProtectedQuantity', role: #AXIS_1 },
                      {measure: 'SupProtSumConsumedQuantity', role: #AXIS_2 },
                      {measure: 'SupProtRemainingProtectedQty', role: #AXIS_3 }
                     ],
  dimensionAttributes: [ {dimension: 'StartDate', role: #SERIES} ] }]
define view entity I_SupProtTimeBucketChart
  as select from I_SupplyProtectionTimeBucketTP
  association [0..1] to I_SupProtTimeBucketSum as _SupProtTimeBucketSum on $projection.SupProtTimeBucketUUID = _SupProtTimeBucketSum.SupProtTimeBucketUUID
{
      @UI.hidden: true
  key SupProtTimeBucketUUID,

      @UI.hidden: true
      SupplyProtectionGroupUUID,

      //      cast(tstmp_to_dats( SupProtPeriodStartUTCDateTime, 'UTC', $session.client, 'NULL' ) as vdm_v_start_date preserving type )          as StartDate,

      cast(tstmp_to_dats( cast( SupProtPeriodStartUTCDateTime as abap.dec(15,0) ), 'UTC', $session.client, 'NULL' ) as vdm_v_start_date) as StartDate,

      @UI.hidden: true
      I_SupplyProtectionTimeBucketTP.UnitOfMeasure,

      @Aggregation.default: #SUM
      @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
      SupProtProtectedQuantity,

      @Aggregation.default: #SUM
      @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
      cast(_SupProtTimeBucketSum.SupProtConsumedQuantity  as  sup_consumed_quantity preserving type )                                    as SupProtSumConsumedQuantity,

      @Aggregation.default: #SUM
      @Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
      case
           when I_SupplyProtectionTimeBucketTP._SupplyProtectionTP.SupProtLifecycleStatus = '01'
           then cast(0 as sup_remaining_quantity )

           when      _SupProtTimeBucketSum.SupProtConsumedQuantity is null
                and  EndDate >= $session.system_date
           then cast(SupProtProtectedQuantity as sup_remaining_quantity )

           when      _SupProtTimeBucketSum.SupProtConsumedQuantity < SupProtProtectedQuantity
                and  EndDate >= $session.system_date
           then cast(SupProtProtectedQuantity - _SupProtTimeBucketSum.SupProtConsumedQuantity as sup_remaining_quantity )

           else cast(0 as sup_remaining_quantity )
      end                                                                                                                                as SupProtRemainingProtectedQty,

      /* Associations */
      _SupProtTimeBucketSum
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SUPPLYPROTECTIONTIMEBUCKETTP",
"I_SUPPLYPROTECTIONTP",
"I_SUPPROTTIMEBUCKETSUM"
],
"ASSOCIATED":
[
"I_SUPPROTTIMEBUCKETSUM"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/