P_LogcDocDeliveryItem

DDL: P_LOGCDOCDELIVERYITEM Type: view_entity CONSUMPTION

P_LogcDocDeliveryItem is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_DeliveryDocumentItem) and exposes 11 fields with key fields DeliveryDocument, DeliveryDocumentItem. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_DeliveryDocumentItem I_DeliveryDocumentItem from

Associations (2)

CardinalityTargetAliasCondition
[0..*] I_ProductText _ProductText $projection.Product = _ProductText.Product
[0..*] I_UnitOfMeasureText _QuantityUnitText $projection.OrderQuantityUnit = _QuantityUnitText.UnitOfMeasure

Annotations (4)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #CONSUMPTION view
Metadata.ignorePropagatedAnnotations true view

Fields (11)

KeyFieldSource TableSource FieldDescription
KEY DeliveryDocument DeliveryDocument
KEY DeliveryDocumentItem DeliveryDocumentItem
ProdCmplncLogsDocumentCategory
Product Product
OrderQuantity ActualDeliveryQuantity
OrderQuantityUnit DeliveryQuantityUnit
ClassifiedAsDangerousGood
ClassifiedAsDangerousGoodName
_ProductText _ProductText
_QuantityUnitText _QuantityUnitText
ShippingPoint _DeliveryDocument ShippingPoint
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM: {
  private: true,
  viewType: #CONSUMPTION
}

@Metadata.ignorePropagatedAnnotations: true
define view entity P_LogcDocDeliveryItem
  as select from I_DeliveryDocumentItem

  association [0..*] to I_ProductText       as _ProductText      on $projection.Product = _ProductText.Product
  // needed to redefine because of different cardinality between the union views

  association [0..*] to I_UnitOfMeasureText as _QuantityUnitText on $projection.OrderQuantityUnit = _QuantityUnitText.UnitOfMeasure

{
  key DeliveryDocument,
  key DeliveryDocumentItem,

      //SDDocumentCategory,

      // USE THE SAME LOGIC AS IN P_LogcDocDelivery

      cast ('LF' as ehfnd_log_doc_category)  as ProdCmplncLogsDocumentCategory,
      //      cast (

      //          case

      //            when PurchasingDocumentCategory = 'J'

      //              then 'LF' // Outbound Delivery (EHFND_LOG_DOC_CATEGORY)

      //          end as ehfnd_log_doc_category) as ProdCmplncLogsDocumentCategory


      @ObjectModel.text.association: '_ProductText'
      Product,

      // the actual quantity is the real quantity used for the delivery

      @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
      ActualDeliveryQuantity                 as OrderQuantity,
      //      OriginalDeliveryQuantity,


      // @Semantics.unitOfMeasure: true

      @ObjectModel.text.association: '_QuantityUnitText'
      DeliveryQuantityUnit                   as OrderQuantityUnit,

      cast ('' as classifiedasdangerousgood) as ClassifiedAsDangerousGood,
      cast( '' as val_text)                  as ClassifiedAsDangerousGoodName,

      // needed to mark the blocked logistic document items

      cast (
          case
            when DangerousGoodsStatus = 'F' // DOM_DGSTA_LE - Blocked – Transport Forbidden

              then 'X'
            when DangerousGoodsStatus = 'G' // DOM_DGSTA_LE - Blocked – Decision Pending

              then 'X'
          end as boole_d)                    as IsBlocked,


      // Associations

      _ProductText,
      _QuantityUnitText,

      //Needed for Authorization check

      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      _DeliveryDocument.ShippingPoint        as ShippingPoint

}
where
  // use only items where the Chemical Complinace Relevant Flag is true

    _Product.IsChemicalComplianceRelevant = 'Y'
  and(
    SDDocumentCategory                    = 'J'
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DELIVERYDOCUMENT",
"I_DELIVERYDOCUMENTITEM",
"I_PRODUCT"
],
"ASSOCIATED":
[
"I_PRODUCTTEXT",
"I_UNITOFMEASURETEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/