P_LogcDocPurchase

DDL: P_LOGCDOCPURCHASE Type: view_entity CONSUMPTION

P_LogcDocPurchase is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_PurchasingDocument) and exposes 8 fields with key field PurchasingDocument.

Data Sources (1)

SourceAliasJoin Type
I_PurchasingDocument I_PurchasingDocument from

Annotations (3)

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

Fields (8)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument PurchasingDocument
ProdCmplncLogsDocumentCategory
PurchasingDocumentType PurchasingDocumentType
PurchasingOrganization PurchasingOrganization
PurchasingGroup PurchasingGroup
IsEndOfPurposeBlocked IsEndOfPurposeBlocked
PurchasingDocumentCategory PurchasingDocumentCategory
PurchasingDocumentOrigin PurchasingDocumentOrigin
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM: {
  private: true,
  viewType: #CONSUMPTION
}
define view entity P_LogcDocPurchase
  as select from I_PurchasingDocument
  
//  association [1..1] to ekko as _ekko on  $projection.PurchasingDocument = _ekko.ebeln


{
  key PurchasingDocument,

      // map to the defined logistic document categories of pc if_ehfnd_logistic_comn_c

      cast ('PO' as ehfnd_log_doc_category) as ProdCmplncLogsDocumentCategory, // Purchase Order (EHFND_LOG_DOC_CATEGORY)

      //      cast (

      //          case

      //            when PurchasingDocumentCategory = 'F'

      //              then 'PO' // Purchase Order (EHFND_LOG_DOC_CATEGORY)

      //          end as ehfnd_log_doc_category) as ProdCmplncLogsDocumentCategory,

      
      
      //Needed for Authorization check

      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      PurchasingDocumentType,
      
      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      PurchasingOrganization,
      
      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      PurchasingGroup,
      
      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      IsEndOfPurposeBlocked,
      
      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      PurchasingDocumentCategory,
      
      @ObjectModel.readOnly:true
      @Consumption.hidden: true
      PurchasingDocumentOrigin

}
where
  PurchasingDocumentCategory = 'F' // if_ehfnd_pur_integration_c=>gc_bstyp-F_Purchase_order

  
  // filter blocked logistic document

//  and(

//    _ekko.total_status_dg <> 'D' // mmpur_pc_total_status_dg - Blocked – Dangerous Goods Transport Forbidden

//    and _ekko.total_status_dg <> 'C' // mmpur_pc_total_status_dg - Partially Blocked – Dangerous Goods Transport Forbidden

//  )

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASINGDOCUMENT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/