C_PurRequisitionItemTypes

DDL: C_PURREQUISITIONITEMTYPES SQL: CMMPRITEMTYPES Type: view CONSUMPTION

Purchase Requisition Item Types

C_PurRequisitionItemTypes is a Consumption CDS View (Cube) that provides data about "Purchase Requisition Item Types" in SAP S/4HANA. It reads from 1 data source (I_Purchaserequisitionitem).

Data Sources (1)

SourceAliasJoin Type
I_Purchaserequisitionitem RequisitionItem from

Parameters (4)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_DateFunction datefunctionid
P_StartDate badat
P_EndDate badat

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CMMPRITEMTYPES view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Purchase Requisition Item Types view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
Analytics.dataCategory #CUBE view
Metadata.allowExtensions true view
VDM.viewType #CONSUMPTION view
AccessControl.personalData.blocking #NOT_REQUIRED view
@AbapCatalog.sqlViewName: 'CMMPRITEMTYPES'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Purchase Requisition Item Types'
@ClientHandling.algorithm: #SESSION_VARIABLE 
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #L  
@Analytics.dataCategory: #CUBE
@Metadata.allowExtensions:true
@VDM.viewType: #CONSUMPTION
@AccessControl.personalData.blocking: #NOT_REQUIRED

define view C_PurRequisitionItemTypes

with parameters 
    @Consumption.valueHelpDefinition: [{
      entity: {
        name:'I_Currency',
        element:'Currency'
      }
    }]
    P_DisplayCurrency           : displaycurrency,
 
    @Consumption.valueHelpDefinition: [{
      entity: {
        name:'C_GregorianCalDateFuncVH',
        element:'DateFunction'
      }
    }]
    P_DateFunction : datefunctionid,
    
    @Consumption.derivation: { lookupEntity: 'C_SglGregorianCalDateFunction', 
    resultElement: 'DateFunctionStartDate', binding: [ {
      targetParameter: 'P_DateFunction', type: #PARAMETER, value : 'P_DateFunction' },
       { targetParameter : 'P_Language' , type : #SYSTEM_FIELD, value : '#SYSTEM_LANGUAGE'  } ] 
    } 
    @Consumption.hidden: true
    P_StartDate: badat,
    
    @Consumption.derivation: { lookupEntity: 'C_SglGregorianCalDateFunction', 
    resultElement: 'DateFunctionEndDate', binding: [ {
      targetParameter: 'P_DateFunction', type: #PARAMETER, value : 'P_DateFunction' },
       { targetParameter : 'P_Language' , type : #SYSTEM_FIELD, value : '#SYSTEM_LANGUAGE'  } ] 
    } 
    @Consumption.hidden: true
    P_EndDate: badat
    
  as select from    I_Purchaserequisitionitem     as RequisitionItem

{

  key RequisitionItem.PurchaseRequisition,
  key RequisitionItem.PurchaseRequisitionItem,
  
      cast(RequisitionItem.FixedSupplier as flief )                      as  FixedSupplier,

      PurchaseRequisitionItemText,
      
      /*Added for DCL*/
      PurchaseRequisitionType,
      PurchasingGroup,
      PurchasingOrganization,
      Plant,

      @Semantics.currencyCode:true
      cast( :P_DisplayCurrency as displaycurrency )                                                      as DisplayCurrency,
      
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      @DefaultAggregation: #SUM
      case
        when PurReqnItemCurrency is not null  and PurReqnItemCurrency != '' and PurReqCreationDate != '00000000' 
            and PurReqCreationDate is not null and PurReqnPriceQuantity > 0 and PurchaseRequisitionPrice > 0

            then cast(DIVISION(cast(currency_conversion(
                                                         amount             => PurchaseRequisitionPrice ,
                                                         source_currency    => PurReqnItemCurrency,
                                                         target_currency    =>  :P_DisplayCurrency,
                                                         exchange_rate_date => PurReqCreationDate,
                                                         exchange_rate_type => 'M'

                              ) as mm_pur_requisition_price ),
                      PurReqnPriceQuantity,5) as mm_pur_requisition_price ) 
        
        else cast ( 0 as mm_pur_requisition_price)
        end                                                                                                  as PurchaseRequisitionPrice ,
      
      cast (case
              when PurReqnOrigin = 'S' and PurReqnSSPCatalog = '' and Material = '' //Free-text Item

                  then '02'
              when PurReqnOrigin = 'S' and Material != '' and PurReqnSSPCatalog =''//Material Item

                  then '03'
              when PurReqnSSPCatalog != '' //Catalog Item

                  then '01'
              when  PurReqnOrigin = 'R' and Material != '' //Material Item (GUI)

                  then '05'
              when PurReqnOrigin = 'R' and Material = '' //Free-text Item (GUI)

                  then '04'
      end as mm_a_pur_reqn_item_classfctn ) as PurReqnItemClassification 
}
where 
//ReleaseIsNotCompleted = '' and 

    (    PurReqnOrigin = 'R'
      or PurReqnOrigin = 'S'  )
  and  CreationDate <= $parameters.P_EndDate
  and  CreationDate >= $parameters.P_StartDate  
  and not(
          Material                   = ''
          and IsOutline              = 'X'
  )          
  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASEREQUISITIONITEM"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/