C_InvcExcdGRPurgDocItm

DDL: C_INVCEXCDGRPURGDOCITM SQL: CGRCINVEXGRPDI Type: view CONSUMPTION

Overpaid GR in Purchasing Document Item

C_InvcExcdGRPurgDocItm is a Consumption CDS View that provides data about "Overpaid GR in Purchasing Document Item" in SAP S/4HANA. It reads from 1 data source (I_PurchasingDocumentItem) and exposes 21 fields with key fields PurchasingDocument, PurchasingDocumentItem. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_PurchasingDocumentItem I_PurchasingDocumentItem from

Associations (2)

CardinalityTargetAliasCondition
[1..1] P_GRAmtPerPurgDocumentItem _GRAmtPerPurgDocumentItem $projection.PurchasingDocument = _GRAmtPerPurgDocumentItem.PurchasingDocument and $projection.PurchasingDocumentItem = _GRAmtPerPurgDocumentItem.PurchasingDocumentItem
[1..1] P_InvcAmtPerPurgDocItem _InvcAmtPerPurgDocItem $projection.PurchasingDocument = _InvcAmtPerPurgDocItem.PurchasingDocument and $projection.PurchasingDocumentItem = _InvcAmtPerPurgDocItem.PurchasingDocumentItem

Annotations (15)

NameValueLevelField
AbapCatalog.sqlViewName CGRCINVEXGRPDI view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Overpaid GR in Purchasing Document Item view
VDM.viewType #CONSUMPTION view
OData.publish true view
AbapCatalog.buffering.status #NOT_ALLOWED view
AccessControl.personalData.blocking #REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument PurchasingDocument
KEY PurchasingDocumentItem PurchasingDocumentItem
PurchasingDocumentCategory PurchasingDocumentCategory
PurchasingDocumentType _PurchasingDocument PurchasingDocumentType
CompanyCode CompanyCode
PurchasingOrganization _PurchasingDocument PurchasingOrganization
CalculatedDiffAmount
PurchasingDocumentCreationDate _PurchasingDocument CreationDate
CreatedByUser _PurchasingDocument CreatedByUser
DocumentCurrency _PurchasingDocument DocumentCurrency
GrossAmount GrossAmount
PurchasingGroup _PurchasingDocument PurchasingGroup
LastChangeDateTime _PurchasingDocument LastChangeDateTime
Supplier _PurchasingDocument Supplier
SupplierFullName
SupplierAccountGroup
GoodsReceiptAmount _GRAmtPerPurgDocumentItem GoodsReceiptAmount
InvoicedAmount _InvcAmtPerPurgDocItem InvoicedAmount
Plant Plant
_PurchasingDocument _PurchasingDocument
_CompanyCode _CompanyCode
@AbapCatalog.sqlViewName: 'CGRCINVEXGRPDI'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Overpaid GR in Purchasing Document Item'
@VDM.viewType: #CONSUMPTION
@OData.publish: true
@AbapCatalog.buffering.status: #NOT_ALLOWED
@AccessControl.personalData.blocking: #REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata: { ignorePropagatedAnnotations: true,
             allowExtensions: true }
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.dataClass: #MIXED
define view C_InvcExcdGRPurgDocItm 
  as select from I_PurchasingDocumentItem
  association [1..1] to P_GRAmtPerPurgDocumentItem as _GRAmtPerPurgDocumentItem on  $projection.PurchasingDocument     = _GRAmtPerPurgDocumentItem.PurchasingDocument
                                                                                and $projection.PurchasingDocumentItem = _GRAmtPerPurgDocumentItem.PurchasingDocumentItem

  association [1..1] to P_InvcAmtPerPurgDocItem as _InvcAmtPerPurgDocItem on  $projection.PurchasingDocument     = _InvcAmtPerPurgDocItem.PurchasingDocument
                                                                          and $projection.PurchasingDocumentItem = _InvcAmtPerPurgDocItem.PurchasingDocumentItem
{

  key PurchasingDocument,
  key PurchasingDocumentItem,
  
        PurchasingDocumentCategory,
        _PurchasingDocument.PurchasingDocumentType,
        @ObjectModel.foreignKey.association: '_CompanyCode'
        CompanyCode,
        
        _PurchasingDocument.PurchasingOrganization,
         @Semantics.amount.currencyCode: 'DocumentCurrency'
        _InvcAmtPerPurgDocItem.InvoicedAmount - _GRAmtPerPurgDocumentItem.GoodsReceiptAmount as CalculatedDiffAmount,
        _PurchasingDocument.CreationDate                                                      as PurchasingDocumentCreationDate,
        _PurchasingDocument.CreatedByUser,
        _PurchasingDocument.DocumentCurrency,

        @Semantics: { amount : {currencyCode:'DocumentCurrency'} }
        GrossAmount,
        _PurchasingDocument.PurchasingGroup,
        
        @Consumption.filter: { selectionType: #SINGLE, multipleSelections: true, mandatory: false }

        _PurchasingDocument.LastChangeDateTime,

        _PurchasingDocument.Supplier,

        @Consumption.filter: { selectionType: #SINGLE, multipleSelections: true, mandatory: false }
        @Semantics.text: true
        _PurchasingDocument._Supplier.SupplierFullName                                        as SupplierFullName,

        @Consumption.filter: { selectionType: #SINGLE, multipleSelections: true, mandatory: false }
        _PurchasingDocument._Supplier.SupplierAccountGroup                                    as SupplierAccountGroup,


        
      @Semantics.amount.currencyCode: 'DocumentCurrency'
      _GRAmtPerPurgDocumentItem.GoodsReceiptAmount,
        
      @Semantics.amount.currencyCode: 'DocumentCurrency'  
      _InvcAmtPerPurgDocItem.InvoicedAmount,
 
  
      Plant,

        _PurchasingDocument,
        _CompanyCode

}

where
     _InvcAmtPerPurgDocItem.InvoicedAmount > _GRAmtPerPurgDocumentItem.GoodsReceiptAmount
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASINGDOCUMENT",
"I_PURCHASINGDOCUMENTITEM",
"I_SUPPLIER",
"P_GRAMTPERPURGDOCUMENTITEM",
"P_INVCAMTPERPURGDOCITEM"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_PURCHASINGDOCUMENT",
"P_GRAMTPERPURGDOCUMENTITEM",
"P_INVCAMTPERPURGDOCITEM"
],
"BASE":
[
"I_PURCHASINGDOCUMENTITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/