P_MatDocHavingRetOrCancel

DDL: P_MATDOCHAVINGRETORCANCEL SQL: PMATDOCRETCANCL Type: view CONSUMPTION

Material document returned or cancelled

P_MatDocHavingRetOrCancel is a Consumption CDS View that provides data about "Material document returned or cancelled" in SAP S/4HANA. It reads from 2 data sources (I_MaterialDocumentRecord, I_GoodsMovementType) and exposes 12 fields with key fields MaterialDocument, MaterialDocumentItem, MaterialDocumentYear.

Data Sources (2)

SourceAliasJoin Type
I_MaterialDocumentRecord _MatDoc from
I_GoodsMovementType GoodsMovement inner

Parameters (2)

NameTypeDefault
P_StartDate bedat
P_EndDate bedat

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PMATDOCRETCANCL view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
EndUserText.label Material document returned or cancelled view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
VDM.private true view
AccessControl.personalData.blocking #NOT_REQUIRED view

Fields (12)

KeyFieldSource TableSource FieldDescription
KEY MaterialDocument I_MaterialDocumentRecord MaterialDocument
KEY MaterialDocumentItem I_MaterialDocumentRecord MaterialDocumentItem
KEY MaterialDocumentYear I_MaterialDocumentRecord MaterialDocumentYear
PurchaseOrder I_MaterialDocumentRecord PurchaseOrder
PurchaseOrderItem I_MaterialDocumentRecord PurchaseOrderItem
QuantityInBaseUnit I_MaterialDocumentRecord QuantityInBaseUnit
GoodsReceiptQtyInOrderUnit I_MaterialDocumentRecord GoodsReceiptQtyInOrderUnit
PostingDate I_MaterialDocumentRecord PostingDate
DebitCreditCode I_MaterialDocumentRecord DebitCreditCode
IsReversalMovementType I_MaterialDocumentRecord IsReversalMovementType
InvtryMgmtReferenceDocument I_MaterialDocumentRecord InvtryMgmtReferenceDocument
InvtryMgmtRefDocumentItem I_MaterialDocumentRecord InvtryMgmtRefDocumentItem
@AbapCatalog.sqlViewName: 'PMATDOCRETCANCL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true 
@EndUserText.label: 'Material document returned or cancelled'

@ClientHandling.algorithm: #SESSION_VARIABLE   
@VDM.viewType : #CONSUMPTION
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@VDM.private : true 
@AccessControl.personalData.blocking: #NOT_REQUIRED

define view P_MatDocHavingRetOrCancel 
with parameters 
    P_StartDate : bedat,
    P_EndDate   : bedat
    
    as select from I_MaterialDocumentRecord as _MatDoc 
    inner join   I_GoodsMovementType as GoodsMovement on         BasicMovementTypeReference ='101' and GoodsMovement.DebitCreditCode = 'H' and 
                                                                 //GoodsMovement.IsReversalMovementType is initial and 

                                                                 GoodsMovement.GoodsMovementType = _MatDoc.GoodsMovementType  { 
         
    key  _MatDoc.MaterialDocument ,
    key  _MatDoc.MaterialDocumentItem  , 
    key _MatDoc.MaterialDocumentYear,
    _MatDoc.PurchaseOrder,
    _MatDoc.PurchaseOrderItem,   
     _MatDoc.QuantityInBaseUnit ,
     _MatDoc.GoodsReceiptQtyInOrderUnit,
    _MatDoc.PostingDate ,
    _MatDoc.DebitCreditCode,
    _MatDoc.IsReversalMovementType,
        _MatDoc.InvtryMgmtReferenceDocument,
    _MatDoc.InvtryMgmtRefDocumentItem  /*,
    _MatDoc.GoodsMovementType,
    _MatDoc.GoodsMovementCancellationType,
    _MatDoc.GoodsMovementIsCancelled*/
    
}
 where  _MatDoc.PostingDate >= $parameters.P_StartDate
  and _MatDoc.PostingDate <= $parameters.P_EndDate
and _MatDoc.DebitCreditCode = 'H'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_GOODSMOVEMENTTYPE",
"I_MATERIALDOCUMENTRECORD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/