I_AugmentedPhysInvtryDocItem

DDL: I_AUGMENTEDPHYSINVTRYDOCITEM SQL: IAUPIDOCITEM Type: view COMPOSITE

Augmented Physical Inventory Doc Item

I_AugmentedPhysInvtryDocItem is a Composite CDS View that provides data about "Augmented Physical Inventory Doc Item" in SAP S/4HANA. It reads from 1 data source (I_PhysInvtryDocItem) and exposes 74 fields with key fields FiscalYear, PhysicalInventoryDocument, PhysicalInventoryDocumentItem. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_PhysInvtryDocItem I_PhysInvtryDocItem from

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_AdjmtPostingMovementType _AdjmtPostingMovementType $projection.PhysicalInventoryStockType = _AdjmtPostingMovementType.PhysicalInventoryStockType and $projection.InventorySpecialStockType = _AdjmtPostingMovementType.InventorySpecialStockType
[0..1] I_GoodsMovementType _GoodsMovementType $projection.GoodsMovementType = _GoodsMovementType.GoodsMovementType

Annotations (12)

NameValueLevelField
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName IAUPIDOCITEM view
EndUserText.label Augmented Physical Inventory Doc Item view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private false view
VDM.viewType #COMPOSITE view

Fields (74)

KeyFieldSource TableSource FieldDescription
KEY FiscalYear FiscalYear
KEY PhysicalInventoryDocument PhysicalInventoryDocument
KEY PhysicalInventoryDocumentItem PhysicalInventoryDocumentItem
Plant Plant
StorageLocation StorageLocation
Material Material
RealProductBatch RealProductBatch
Batch Batch
ValuationType ValuationType
InventorySpecialStockType InventorySpecialStockType
PhysicalInventoryStockType PhysicalInventoryStockType
SalesOrder SalesOrder
SalesOrderItem SalesOrderItem
ScheduleLine ScheduleLine
Supplier Supplier
Customer Customer
WBSElementInternalID WBSElementInternalID
PhysicalInventoryItemIsCounted PhysicalInventoryItemIsCounted
PhysInvtryDifferenceIsPosted PhysInvtryDifferenceIsPosted
PhysInvtryItemIsRecounted PhysInvtryItemIsRecounted
PhysInvtryItemIsDeleted PhysInvtryItemIsDeleted
CycleCountType CycleCountType
PhysicalInventoryLastCountDate PhysicalInventoryLastCountDate
PostingDate PostingDate
ReasonForPhysInvtryDifference ReasonForPhysInvtryDifference
LastChangeDate LastChangeDate
PhysInvtryDiffIsDistributed PhysInvtryDiffIsDistributed
Currency Currency
MaterialDocumentYear MaterialDocumentYear
MaterialDocument MaterialDocument
MaterialDocumentItem MaterialDocumentItem
PhysInvtryRecountDocument PhysInvtryRecountDocument
IsValueOnlyMaterial IsValueOnlyMaterial
IsHandledInAltvUnitOfMsr IsHandledInAltvUnitOfMsr
ProductCategory ProductCategory
CrossPlantConfigurableMaterial CrossPlantConfigurableMaterial
BookQtyBfrCountInMatlBaseUnit BookQtyBfrCountInMatlBaseUnit
PhysicalInventoryItemIsZero PhysicalInventoryItemIsZero
Quantity Quantity
MaterialBaseUnit MaterialBaseUnit
QuantityInUnitOfEntry QuantityInUnitOfEntry
DifferenceQuantityInBaseUnit
UnitOfEntry UnitOfEntry
EnteredSlsAmtInCoCodeCrcy EnteredSlsAmtInCoCodeCrcy
SlsPriceAmountInCoCodeCrcy SlsPriceAmountInCoCodeCrcy
PhysInvtryCtAmtInCoCodeCrcy PhysInvtryCtAmtInCoCodeCrcy
BookQtyAmountInCoCodeCrcy BookQtyAmountInCoCodeCrcy
MaxAbsDiffAmountInCoCodeCrcy
MinAbsDiffAmountInCoCodeCrcy
DiffSlsPrcAmtInCoCodeCrcy
NumberOfPhysInvtryItems
_WBSElement _WBSElement
_AdjmtPostingMovementType _AdjmtPostingMovementType
_Material _Material
_ProductPlant _ProductPlant
_ProductStorageLocation _ProductStorageLocation
_CrossPlantConfigurableMatl _CrossPlantConfigurableMatl
_MaterialBaseUnit _MaterialBaseUnit
_UnitOfEntry _UnitOfEntry
_Currency _Currency
_Supplier _Supplier
_Customer _Customer
_SalesOrder _SalesOrder
_SalesOrderItem _SalesOrderItem
_SalesOrderScheduleLine _SalesOrderScheduleLine
_Plant _Plant
_StorageLocation _StorageLocation
_PhysInvtryDocHeader _PhysInvtryDocHeader
_PhysicalInventoryStockType _PhysicalInventoryStockType
_InventorySpecialStockType _InventorySpecialStockType
_ProductCategory _ProductCategory
_GoodsMovementType _GoodsMovementType
_SupplierCompanyByPlant _SupplierCompanyByPlant
_CustomerCompanyByPlant _CustomerCompanyByPlant
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'IAUPIDOCITEM'
@EndUserText.label: 'Augmented Physical Inventory Doc Item'

@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass:#TRANSACTIONAL
@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.private: false
@VDM.viewType: #COMPOSITE

define view I_AugmentedPhysInvtryDocItem
  as select from           I_PhysInvtryDocItem

  association [0..1] to I_AdjmtPostingMovementType  as _AdjmtPostingMovementType    on  $projection.PhysicalInventoryStockType = _AdjmtPostingMovementType.PhysicalInventoryStockType
                                                                                    and $projection.InventorySpecialStockType  = _AdjmtPostingMovementType.InventorySpecialStockType

  association [0..1] to I_GoodsMovementType         as _GoodsMovementType           on  $projection.GoodsMovementType = _GoodsMovementType.GoodsMovementType
    
{
      //Key

      @Semantics.calendar.year: true
  key FiscalYear,
  key PhysicalInventoryDocument,
  key PhysicalInventoryDocumentItem,

      @ObjectModel.foreignKey.association: '_Plant'
      Plant,
      @ObjectModel.foreignKey.association: '_StorageLocation'
      StorageLocation,
      @ObjectModel.foreignKey.association: '_Material'
      Material,           
      RealProductBatch, 
      Batch,
      ValuationType,
      @ObjectModel.foreignKey.association: '_InventorySpecialStockType'
      InventorySpecialStockType,
      @ObjectModel.foreignKey.association: '_PhysicalInventoryStockType'
      PhysicalInventoryStockType,
      @ObjectModel.foreignKey.association: '_SalesOrder'
      SalesOrder,
      @ObjectModel.foreignKey.association: '_SalesOrderItem'
      SalesOrderItem,
      @ObjectModel.foreignKey.association: '_SalesOrderScheduleLine'
      ScheduleLine,
      @ObjectModel.foreignKey.association: '_Supplier'
      Supplier,
      @ObjectModel.foreignKey.association: '_Customer'
      Customer,
      WBSElementInternalID,
      
      //Status

      PhysicalInventoryItemIsCounted,
      PhysInvtryDifferenceIsPosted,
      PhysInvtryItemIsRecounted,
      PhysInvtryItemIsDeleted,
      
      // Process Types

      CycleCountType,
      @ObjectModel.foreignKey.association: '_GoodsMovementType'
      cast((case when Quantity > BookQtyBfrCountInMatlBaseUnit and PhysicalInventoryItemIsCounted = 'X'
         then  _AdjmtPostingMovementType.PhysInvtryIncreasingQtyMvtType
         else case when Quantity < BookQtyBfrCountInMatlBaseUnit and PhysicalInventoryItemIsCounted = 'X' 
              then  _AdjmtPostingMovementType.PhysInvtryDecreasingQtyMvtType
              else ''
              end    
      end) as pi_bwart preserving type)                          as GoodsMovementType,
      
      // Processing Data

      PhysicalInventoryLastCountDate,
      PostingDate,
      ReasonForPhysInvtryDifference,
      LastChangeDate,
      PhysInvtryDiffIsDistributed,

      @Semantics.currencyCode: true
      Currency,

      // References

      case when PhysInventoryReferenceNumber = '' 
        then 
          _PhysInvtryDocHeader.PhysInventoryReferenceNumber 
        else 
          PhysInventoryReferenceNumber
        end                                                      as PhysInventoryReferenceNumber,      
      MaterialDocumentYear,
      MaterialDocument,
      MaterialDocumentItem,
      PhysInvtryRecountDocument,

      // Material Types

      IsValueOnlyMaterial,
      IsHandledInAltvUnitOfMsr,
      @ObjectModel.foreignKey.association: '_ProductCategory'
      ProductCategory,
      @ObjectModel.foreignKey.association: '_CrossPlantConfigurableMatl'
      CrossPlantConfigurableMaterial,                         

      //Quantities

      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      @DefaultAggregation: #NONE
      BookQtyBfrCountInMatlBaseUnit,
      PhysicalInventoryItemIsZero,
      @Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
      @DefaultAggregation: #NONE
      Quantity,
      @Semantics.unitOfMeasure: true
      @ObjectModel.foreignKey.association: '_MaterialBaseUnit'
      MaterialBaseUnit,
      @Semantics.quantity.unitOfMeasure: 'UnitOfEntry'
      @DefaultAggregation: #NONE
      QuantityInUnitOfEntry,
      cast ((Quantity - BookQtyBfrCountInMatlBaseUnit) as pi_item_diff_qty_i_base_unit preserving type ) as DifferenceQuantityInBaseUnit,
      @Semantics.unitOfMeasure: true
      @ObjectModel.foreignKey.association: '_UnitOfEntry'
      UnitOfEntry,
          
      //Amounts

      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #NONE
      EnteredSlsAmtInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #NONE
      SlsPriceAmountInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #NONE
      PhysInvtryCtAmtInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #NONE
      BookQtyAmountInCoCodeCrcy,        
      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #NONE
      cast(( case when IsValueOnlyMaterial = ''
                  then case when Quantity < BookQtyBfrCountInMatlBaseUnit
                            then -DifferenceAmountInCoCodeCrcy
                            else DifferenceAmountInCoCodeCrcy
                       end
                   else case when EnteredSlsAmtInCoCodeCrcy < SlsPriceAmountInCoCodeCrcy
                             then -DifferenceAmountInCoCodeCrcy
                             else DifferenceAmountInCoCodeCrcy
                        end
              end)     as        pi_item_diff_value preserving type )                               as DifferenceAmountInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #MAX
      cast(DifferenceAmountInCoCodeCrcy as pi_item_max_diff_value preserving type )                 as MaxAbsDiffAmountInCoCodeCrcy,
      @Semantics.amount.currencyCode: 'Currency'
      @DefaultAggregation: #MIN
      cast(DifferenceAmountInCoCodeCrcy as pi_item_min_diff_value preserving type )                 as MinAbsDiffAmountInCoCodeCrcy,
      
      @Semantics.amount.currencyCode: 'Currency'
      cast((EnteredSlsAmtInCoCodeCrcy - SlsPriceAmountInCoCodeCrcy) as pi_item_diff_sls_prc_co_cry2 preserving type ) as DiffSlsPrcAmtInCoCodeCrcy,


      @DefaultAggregation: #SUM
      cast( 1 as pi_number_of_items)                                                                as NumberOfPhysInvtryItems,

      _WBSElement,
      _AdjmtPostingMovementType,
      _Material,
      _ProductPlant,
      _ProductStorageLocation,
      _CrossPlantConfigurableMatl,
      _MaterialBaseUnit,
      _UnitOfEntry,
      _Currency,
      _Supplier,
      _Customer,
      _SalesOrder,
      _SalesOrderItem,
      _SalesOrderScheduleLine,
      _Plant,
      _StorageLocation,
      _PhysInvtryDocHeader,
      _PhysicalInventoryStockType,
      _InventorySpecialStockType,
      _ProductCategory,
      _GoodsMovementType,
      
      @Consumption.hidden: true
      _SupplierCompanyByPlant,
      @Consumption.hidden: true
      _CustomerCompanyByPlant

}