C_RDPGoodsMovementDocumentDEX

DDL: C_RDPGOODSMOVEMENTDOCUMENTDEX Type: view CONSUMPTION

Goods Movement Extractor for RDP

C_RDPGoodsMovementDocumentDEX is a Consumption CDS View (Fact) that provides data about "Goods Movement Extractor for RDP" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 55 fields with key fields MaterialDocumentKey1, MaterialDocumentKey2, MaterialDocumentKey3, MaterialDocumentKey4, MaterialDocumentKey5. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_MaterialDocumentRecord MaterialDocumentRecord from

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..1] I_Plant _IssuingOrReceivingPlant $projection.IssuingOrReceivingPlant = _IssuingOrReceivingPlant.Plant
[0..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[0..1] I_Product _Product $projection.Material = _Product.Product

Annotations (17)

NameValueLevelField
EndUserText.label Goods Movement Extractor for RDP view
AbapCatalog.sqlViewName CRDPGDSMVTDDEX view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.sapObjectNodeType.name MaterialDocument view
ObjectModel.modelingPattern #NONE view
VDM.viewType #CONSUMPTION view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
Analytics.dataCategory #FACT view
Analytics.internalName #LOCAL view
Analytics.dataExtraction.enabled true view
Metadata.ignorePropagatedAnnotations true view

Fields (55)

KeyFieldSource TableSource FieldDescription
KEY MaterialDocumentKey1 I_MaterialDocumentRecord MaterialDocumentKey1
KEY MaterialDocumentKey2 I_MaterialDocumentRecord MaterialDocumentKey2
KEY MaterialDocumentKey3 I_MaterialDocumentRecord MaterialDocumentKey3
KEY MaterialDocumentKey4 I_MaterialDocumentRecord MaterialDocumentKey4
KEY MaterialDocumentKey5 I_MaterialDocumentRecord MaterialDocumentKey5
KEY MaterialDocumentKey6 I_MaterialDocumentRecord MaterialDocumentKey6
StockIdentifyingMaterial I_MaterialDocumentRecord StockIdentifyingMaterial
Plant I_MaterialDocumentRecord Plant
InventorySpecialStockType I_MaterialDocumentRecord InventorySpecialStockType
CompanyCode I_MaterialDocumentRecord CompanyCode
MaterialBaseUnit I_MaterialDocumentRecord MaterialBaseUnit
QuantityInBaseUnit I_MaterialDocumentRecord QuantityInBaseUnit
MatlStkChangeQtyInBaseUnit I_MaterialDocumentRecord MatlStkChangeQtyInBaseUnit
EntryUnit I_MaterialDocumentRecord EntryUnit
QuantityInEntryUnit I_MaterialDocumentRecord QuantityInEntryUnit
PostingDate I_MaterialDocumentRecord PostingDate
CreationDate I_MaterialDocumentRecord CreationDate
CreationTime I_MaterialDocumentRecord CreationTime
CalendarQuarter I_MaterialDocumentRecord CalendarQuarter
CalendarMonth I_MaterialDocumentRecord CalendarMonth
CalendarWeek I_MaterialDocumentRecord CalendarWeek
CalendarDayOfYear I_MaterialDocumentRecord CalendarDay
ManufactureDate I_MaterialDocumentRecord ManufactureDate
MaterialDocument I_MaterialDocumentRecord MaterialDocument
MaterialDocumentYear I_MaterialDocumentRecord MaterialDocumentYear
MaterialDocumentItem I_MaterialDocumentRecord MaterialDocumentItem
MaterialDocumentLine I_MaterialDocumentRecord MaterialDocumentLine
SalesOrder I_MaterialDocumentRecord SalesOrder
PurchaseOrder I_MaterialDocumentRecord PurchaseOrder
InvtryMgmtReferenceDocument I_MaterialDocumentRecord InvtryMgmtReferenceDocument
ManufacturingOrder I_MaterialDocumentRecord ManufacturingOrder
AccountingDocExternalReference I_MaterialDocumentRecord ReferenceDocument
DeliveryDocument I_MaterialDocumentRecord DeliveryDocument
GoodsMovementIsCancelled I_MaterialDocumentRecord GoodsMovementIsCancelled
IsReversalMovementType I_MaterialDocumentRecord IsReversalMovementType
GoodsMovementType I_MaterialDocumentRecord GoodsMovementType
Material I_MaterialDocumentRecord Material
Batch I_MaterialDocumentRecord Batch
Supplier I_MaterialDocumentRecord Supplier
Customer I_MaterialDocumentRecord Customer
GoodsRecipientName I_MaterialDocumentRecord GoodsRecipientName
IssgOrRcvgMaterial I_MaterialDocumentRecord IssgOrRcvgMaterial
IssgOrRcvgBatch I_MaterialDocumentRecord IssgOrRcvgBatch
GoodsMovementRefDocType I_MaterialDocumentRecord GoodsMovementRefDocType
IssuingOrReceivingPlant I_MaterialDocumentRecord IssuingOrReceivingPlant
AccountingDocumentType I_MaterialDocumentRecord AccountingDocumentType
InventoryTransactionType I_MaterialDocumentRecord InventoryTransactionType
PlantAddressID _Plant AddressID
IssgOrRcvgPlantAddressID _IssuingOrReceivingPlant AddressID
PlantCountry
IssuingOrReceivingPlantCountry
SupplierCountry _Supplier Country
CustomerCountry _Customer Country
MaterialType _Product ProductType
MaterialCategory _Product ProductCategory
@EndUserText.label: 'Goods Movement Extractor for RDP'

@AbapCatalog: {
    sqlViewName: 'CRDPGDSMVTDDEX',
    compiler.compareFilter: true
}
@AccessControl: {
     authorizationCheck:    #PRIVILEGED_ONLY,
     personalData.blocking: #NOT_REQUIRED
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel: {
      usageType: {
         sizeCategory:   #XXL,
         serviceQuality: #D,
         dataClass:      #MIXED
      },
      sapObjectNodeType.name: 'MaterialDocument',
      supportedCapabilities: [#EXTRACTION_DATA_SOURCE],
      modelingPattern: #NONE
}
@VDM: {
      viewType: #CONSUMPTION,
      lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@Analytics: {
        dataCategory: #FACT,
        internalName: #LOCAL,
        dataExtraction: {
          enabled: true,
          delta.changeDataCapture:
            { mapping:
              [
                { role: #MAIN, table: 'MATDOC', tableElement: ['key1', 'key2', 'key3', 'key4', 'key5', 'key6'], viewElement: ['MaterialDocumentKey1', 'MaterialDocumentKey2', 'MaterialDocumentKey3', 'MaterialDocumentKey4', 'MaterialDocumentKey5', 'MaterialDocumentKey6'] },
                { role: #LEFT_OUTER_TO_ONE_JOIN, table: 'lfa1',   tableElement: ['lifnr'],      viewElement: ['Supplier'] },
                { role: #LEFT_OUTER_TO_ONE_JOIN, table: 'kna1',   tableElement: ['kunnr'],      viewElement: ['Customer'] },
                { role: #LEFT_OUTER_TO_ONE_JOIN, table: 'mara',   tableElement: ['matnr'],      viewElement: ['Material'] },
                { role: #LEFT_OUTER_TO_ONE_JOIN, table: 'adrc',   tableElement: ['addrnumber'], viewElement: ['PlantAddressID'] },
                { role: #LEFT_OUTER_TO_ONE_JOIN, table: 'adrc',   tableElement: ['addrnumber'], viewElement: ['IssgOrRcvgPlantAddressID'] }
              ]
            }
        }
}
@Metadata: {
        ignorePropagatedAnnotations: true
}

define view C_RDPGoodsMovementDocumentDEX
  as select from I_MaterialDocumentRecord as MaterialDocumentRecord

  association [0..1] to I_Plant    as _Plant                   on $projection.Plant = _Plant.Plant
  association [0..1] to I_Plant    as _IssuingOrReceivingPlant on $projection.IssuingOrReceivingPlant = _IssuingOrReceivingPlant.Plant
  association [0..1] to I_Supplier as _Supplier                on $projection.Supplier = _Supplier.Supplier
  association [0..1] to I_Customer as _Customer                on $projection.Customer = _Customer.Customer
  association [0..1] to I_Product  as _Product                 on $projection.Material = _Product.Product

{
  key MaterialDocumentRecord.MaterialDocumentKey1,
  key MaterialDocumentRecord.MaterialDocumentKey2,
  key MaterialDocumentRecord.MaterialDocumentKey3,
  key MaterialDocumentRecord.MaterialDocumentKey4,
  key MaterialDocumentRecord.MaterialDocumentKey5,
  key MaterialDocumentRecord.MaterialDocumentKey6,

      MaterialDocumentRecord.StockIdentifyingMaterial,
      MaterialDocumentRecord.Plant,
      MaterialDocumentRecord.InventorySpecialStockType,
      MaterialDocumentRecord.CompanyCode,

      @Semantics.unitOfMeasure: true
      MaterialDocumentRecord.MaterialBaseUnit,

      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      MaterialDocumentRecord.QuantityInBaseUnit,

      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      MaterialDocumentRecord.MatlStkChangeQtyInBaseUnit,

      @Semantics.unitOfMeasure: true
      MaterialDocumentRecord.EntryUnit,

      @Semantics.quantity.unitOfMeasure: 'EntryUnit'
      MaterialDocumentRecord.QuantityInEntryUnit,

      @Semantics.businessDate.at: true
      MaterialDocumentRecord.PostingDate,

      MaterialDocumentRecord.CreationDate,
      MaterialDocumentRecord.CreationTime,

      @Semantics.calendar.quarter: true
      MaterialDocumentRecord.CalendarQuarter,

      @Semantics.calendar.month: true
      MaterialDocumentRecord.CalendarMonth,

      @Semantics.calendar.week: true
      MaterialDocumentRecord.CalendarWeek,

      @Semantics.calendar.dayOfYear: true
      MaterialDocumentRecord.CalendarDay                 as CalendarDayOfYear, // The GFN used by the underlying basic view is wrong, and this would raise Prio 2 ATC issues on consumption-level due to a type-mismatch to the default data element


      MaterialDocumentRecord.ManufactureDate,
      MaterialDocumentRecord.MaterialDocument,

      @Semantics.calendar.year: true
      MaterialDocumentRecord.MaterialDocumentYear,

      MaterialDocumentRecord.MaterialDocumentItem,
      MaterialDocumentRecord.MaterialDocumentLine,
      MaterialDocumentRecord.SalesOrder,
      MaterialDocumentRecord.PurchaseOrder,
      MaterialDocumentRecord.InvtryMgmtReferenceDocument,
      MaterialDocumentRecord.ManufacturingOrder,
      MaterialDocumentRecord.ReferenceDocument           as AccountingDocExternalReference, // This is a FIN-specific field, and the GFN used by the underlying basic view does not reflect that. Hence changing the GFN to comply to the VDM, and avoid Prio 2 ATC issues.

      MaterialDocumentRecord.DeliveryDocument,
      MaterialDocumentRecord.GoodsMovementIsCancelled,
      MaterialDocumentRecord.IsReversalMovementType,
      MaterialDocumentRecord.GoodsMovementType,
      MaterialDocumentRecord.Material,
      MaterialDocumentRecord.Batch,
      MaterialDocumentRecord.Supplier,
      MaterialDocumentRecord.Customer,
      MaterialDocumentRecord.GoodsRecipientName,
      MaterialDocumentRecord.IssgOrRcvgMaterial,
      MaterialDocumentRecord.IssgOrRcvgBatch,
      MaterialDocumentRecord.GoodsMovementRefDocType,
      MaterialDocumentRecord.IssuingOrReceivingPlant,
      MaterialDocumentRecord.AccountingDocumentType,
      MaterialDocumentRecord.InventoryTransactionType,

      // Note: To be consistent with the extractors C_SustPlantAddressDEX, I_Supplier and I_Customer, the "Country" information are either retrieved via the

      // associated Address (for Plant), or the direct field at the entity (for Supplier and Customer), even though both would be available for each entity.

      @Analytics.hidden: true
      _Plant.AddressID                                   as PlantAddressID, // needed for CDC-based delta


      @Analytics.hidden: true
      _IssuingOrReceivingPlant.AddressID                 as IssgOrRcvgPlantAddressID, // needed for CDC-based delta


      _Plant._Address.Country                            as PlantCountry,
      _IssuingOrReceivingPlant._Address.Country          as IssuingOrReceivingPlantCountry,
      _Supplier.Country                                  as SupplierCountry,
      _Customer.Country                                  as CustomerCountry,

      _Product.ProductType                               as MaterialType,
      _Product.ProductCategory                           as MaterialCategory,
      
      // Calculated Fields

      cast(case when MatlStkChangeQtyInBaseUnit > 0 and IsReversalMovementType = '' or MatlStkChangeQtyInBaseUnit < 0 and IsReversalMovementType = 'X'
            then 'GR'
        else case
           when MatlStkChangeQtyInBaseUnit < 0 and IsReversalMovementType = '' or MatlStkChangeQtyInBaseUnit > 0 and IsReversalMovementType = 'X'
             then 'GI'
           else '' end
      end as nsdm_stock_change_category preserving type) as StockChangeCategory,

      cast(case when IssuingOrReceivingPlant <> '' and IssuingOrReceivingPlant <> Plant
        then 'X'
        else ''
      end as nsdm_cross_plant_transfer preserving type)  as IsCrossPlantTransfer,
      
      case when _PurchaseOrderItem.IncotermsClassification <> '' then _PurchaseOrderItem.IncotermsClassification
        else _PurchaseOrder.IncotermsClassification end  as IncotermsClassification

}
// the following where-condition is a copy of I_GoodsMovementDocumentDEX (PO decision)

where
     MaterialDocumentRecordType = 'MDOC'
  or MaterialDocumentRecordType = 'MDOC_CP'
  or MaterialDocumentRecordType = 'MDOC340'
  or MaterialDocumentRecordType = 'CORR'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ADDRESS",
"I_CUSTOMER",
"I_MATERIALDOCUMENTRECORD",
"I_PLANT",
"I_PRODUCT",
"I_PURCHASEORDER",
"I_PURCHASEORDERITEM",
"I_SUPPLIER"
],
"ASSOCIATED":
[
"I_CUSTOMER",
"I_PLANT",
"I_PRODUCT",
"I_SUPPLIER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/