C_PurgSpendOffContract

DDL: C_PURGSPENDOFFCONTRACT SQL: CMMSPNDCNTRCT Type: view CONSUMPTION Package: ODATA_MM_ANALYTICS

Off Contract Spend

C_PurgSpendOffContract is a Consumption CDS View that provides data about "Off Contract Spend" in SAP S/4HANA. It reads from 1 data source (C_PurgSpendOffContract2). It is used in 4 Fiori applications: Purchase Order Value and Scheduling Agreement Value, Procurement Overview Page, Quantity Contract Consumption, .... Part of development package ODATA_MM_ANALYTICS.

Data Sources (1)

SourceAliasJoin Type
C_PurgSpendOffContract2 C_PurgSpendOffContract2 from

Parameters (5)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_Language sylangu
P_StartDate bedat
P_EndDate bedat
P_DateFunction datefunctionid

Annotations (13)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
AbapCatalog.sqlViewName CMMSPNDCNTRCT view
VDM.viewType #CONSUMPTION view
Analytics.query true view
OData.publish true view
EndUserText.label Off Contract Spend view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view
AccessControl.personalData.blocking #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.modelingPattern #ANALYTICAL_QUERY view

Fiori Apps (4)

App IDApp NameTypeDescription
F1378 Purchase Order Value and Scheduling Agreement Value Analytical You can use this app to retrieve the order value for all the purchase orders over time. The app also helps to determine the KPI value of the purchase orders for a given set of filter criteria such as the materials, supplier, and plant. The business value of the app is that you can determine all the current value of all purchase orders in the system.
F1990 Procurement Overview Page Transactional, Analytical The Procurement Overview Page enables business users to perform their daily tasks quickly and effectively without the need to open many different reports and transactions. All the relevant information is shown on a single page - visualized on cards for multiple types of content in an attractive and efficient way. The user-friendly experience makes viewing data, filtering data and acting upon it simple, faster and smarter.
F2012 Quantity Contract Consumption Analytical
F2013 Value Contract Consumption Analytical

Purchase Order Value and Scheduling Agreement Value

Business Role: Strategic Buyer

You can use this app to retrieve the order value for all the purchase orders within a stipulated time. The app also helps to determine the KPI value of the purchase orders for a given set of filter criteria such as the materials, supplier, and plant. The business value of the app is that you can determine all the current value of all purchase orders in the system. The role Strategic Buyer (SAP_BR_BUYER) is required to access the app. This KPI is displayed in the following views: •By Supplier•By Purchasing Category•By Material Group•By Purchasing Group•By Plant•By WBS Element•Document•Trend

Procurement Overview Page

Business Role: Purchaser

The Procurement Overview Page enables business users to perform their daily tasks quickly and effectively without the need to open many different reports and transactions. Information is displayed on set of actionable cards. Users can therefore focus on the most important tasks, enabling faster decisions and immediate action.

Quantity Contract Consumption

Business Role: Strategic Buyer

You can use this app to identify the consumption percentage of quantity type contracts in the last 365 days, from the current date. You can also find the target and released quantity of the contracts.The catalog role Materials Management - Purchasing Strategy (SAP_BCR_MM_PUR_STRATEGY) is required to access the app. Note that this catalog role is included in the business role Strategic Buyer (SAP_BR_BUYER).The following authorization objects must be maintained in SU22:•M_BEST_EKG•M_BEST_EKO•M_BEST_WRK•M_RAHM_EKG•M_RAHM_EKO•M_RAHM_WRK•F_BKPF_BUK•S_RS_COMP•S_RS_COMP1The KPI is displayed in the following views:•By Supplier•By Purchasing Group•By Purchasing Organization•By Purchasing Category•By Material Group•By Cost Center•Document•Trend

Value Contract Consumption

Business Role: Strategic Buyer

You can use this app to identify the consumption percentage of value type contracts over the last 365 days from the current date. You can also find the target and released amount of the contracts.The role Materials Management - Purchasing Strategy (SAP_BCR_MM_PUR_STRATEGY) is required to access the app. The following authorization objects must be maintained in SU22:•M_BEST_EKG•M_BEST_EKO•S_RS_COMP•S_RS_COMP1The KPI is displayed in the following views:•By Supplier•By Purchasing Group•By Purchasing Organization•Document•Trend

@ClientHandling.algorithm: #SESSION_VARIABLE //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality:  #D
@ObjectModel.usageType.sizeCategory: #L
@AbapCatalog.sqlViewName: 'CMMSPNDCNTRCT'
//Commented by VDM CDS Suite Plugin:@ClientDependent: true

@VDM.viewType: #CONSUMPTION
@Analytics.query: true
@OData.publish: true
@EndUserText.label: 'Off Contract Spend'
@AccessControl.authorizationCheck: #PRIVILEGED_ONLY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations:true 
@ObjectModel.supportedCapabilities: [#ANALYTICAL_QUERY]
@ObjectModel.modelingPattern: #ANALYTICAL_QUERY
define view C_PurgSpendOffContract

  with parameters
    @Consumption.defaultValue: 'EUR' 
    @Consumption.valueHelpDefinition: [{
      entity: {
        name:'I_Currency',
        element:'Currency'
      }
    }]
    P_DisplayCurrency           : displaycurrency,

    @Consumption.hidden : true
    @Environment.systemField : #SYSTEM_LANGUAGE
    P_Language                  : sylangu,

    @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: bedat,
    
    @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: bedat,
    @Consumption.defaultValue: 'PREVIOUSYEARTODATE'
    @Consumption.valueHelpDefinition: [{
      entity: {
        name:'C_GregorianCalDateFuncVH',
        element:'DateFunction'
      }
    }]
    P_DateFunction              : datefunctionid 
    
  as select from C_PurgSpendOffContract2(
                 P_DisplayCurrency : $parameters.P_DisplayCurrency,
                 P_StartDate  : $parameters.P_StartDate,
                 P_EndDate   : $parameters.P_EndDate )

{
      /* keys */
  key PurchaseOrder,
  key PurchaseOrderItem,
  key AccountAssignmentNumber,
  
  
  
  @Consumption: {
                  filter: {                    -- Usage of derviation.lookupEntity requires a filter definition too!
                            mandatory: false,
                            hidden: true,
                            selectionType: #SINGLE,
                            multipleSelections: false
                          },                  
                  derivation: {
                                lookupEntity: 'F_ProcmtAnalyticsDataSelMeth',
                                resultElement: 'PurgDocMigrtnIsCmpltdForAnlyts'
                              }
                }
 
  @Consumption.hidden : true
  PurgDocMigrtnIsCmpltdForAnlyts,
      /* Supplier */

      Supplier,
      _Supplier.SupplierName,
      
      SupplierCountry,
      @Semantics.text: true
      _Country._Text[1: Language = $parameters.P_Language].CountryName,

      /* Order Date */
      @EndUserText.label: 'Purchase Order Date'
      PurchaseOrderDate,
      CalendarYear,
      CalendarMonth,
      CalendarQuarter,
      CalendarWeek,

      CreatedByUser,

      /* Header */
      PurchasingOrganization,
      _PurchasingOrganization.PurchasingOrganizationName,
      PurchasingGroup,
      _PurchasingGroup.PurchasingGroupName,
    
      @EndUserText.label: 'Receiving Plant Company Code'
      @EndUserText.quickInfo: 'Receiving Plant Company Code'           
      CompanyCode,  
      @EndUserText.label: 'Receiving Plant Company Code Name'
      @EndUserText.quickInfo: 'Receiving Plant Company Code Name'                                         
      @Semantics.text: true                                 
      _CompanyCode.CompanyCodeName as ReceivingCompanyCode,                         
      
      @EndUserText.label: 'Company Code'  
      @EndUserText.quickInfo: 'Company Code'            
      PurgDocHdrCompanyCode,                                          
      @Semantics.text: true  
      @EndUserText.label: 'Company Code Name'  
      @EndUserText.quickInfo: 'Company Code Name'                               
      _CompanyCode.CompanyCodeName, 
      
      @EndUserText.label: 'Document Type'
      PurchaseOrderType,
      @Semantics.text: true
      _PurchasingDocumentType._Text[1: Language = $session.system_language].PurchasingDocumentTypeName as PurchasingDocumentTypeName,
      
      @EndUserText.label: 'Item Category'
      PurchaseOrderItemCategory,
      @Semantics.text: true
      _PurgDocumentItemCategory._Text[1: Language = $session.system_language].PurgDocItemCategoryName, 
      

      /* Line Item Data */
            
      //@ObjectModel.text.element: ['MaterialName'] //Inserted by VDM CDS Suite Plugin


      //Commented by VDM CDS Suite Plugin:@Consumption.labelElement: 'MaterialName'

      //Commented by VDM CDS Suite Plugin:

      Material,
      @Semantics.text: true
      _Material._Text[1: Language = $session.system_language].MaterialName,

//      @ObjectModel.text.element: ['MaterialGroupName'] //Inserted by VDM CDS Suite Plugin


      //Commented by VDM CDS Suite Plugin:@Consumption.labelElement: 'MaterialGroupName'

      //Commented by VDM CDS Suite Plugin:

      MaterialGroup,
      @Semantics.text: true
      _MaterialGroup._Text[1: Language = $session.system_language].MaterialGroupName as MaterialGroupName,

 //     @ObjectModel.text.element: ['PlantName'] //Inserted by VDM CDS Suite Plugin


      //Commented by VDM CDS Suite Plugin:@Consumption.labelElement: 'PlantName'

      //Commented by VDM CDS Suite Plugin:

      Plant,
      @Semantics.text: true
      _Plant.PlantName,

      @ObjectModel.text.element: ['PurgCatName']
      @Consumption.labelElement: 'PurgCatName'
      PurchasingCategory,
      @Semantics.text: true
      PurgCatName,

      CostCenter,
      WBSElementInternalID,

      @Semantics.currencyCode: true
      DisplayCurrency,

      /* Measures */
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      PurchaseOrderAmount,

      @Semantics.amount.currencyCode: 'DisplayCurrency'
      AmtWithContractRefInDspCrcy,

      @Semantics.amount.currencyCode: 'DisplayCurrency'
      AmtWithoutContractRefInDspCrcy,
      
//      Below annotation has been commented out since the field representation term is 'Ratio' and annotation mismatches.      

//      @Semantics.amount.currencyCode: 'DisplayCurrency'

      @DefaultAggregation: #FORMULA
      @AnalyticsDetails.query.formula: 'CASE WHEN $projection.PurchaseOrderAmount > 0 THEN  $projection.AmtWithoutContractRefInDspCrcy / $projection.PurchaseOrderAmount ELSE 0 END'
      @EndUserText.label: 'Off Contract Spend %'
      1                                                                            as NonContractPurchaseRatio,
      
      @AnalyticsDetails.query.decimals: 0
//      Below annotation has been commented out since the field representation term is 'Rate' and annotation mismatches.

//      @Semantics.amount.currencyCode: 'DisplayCurrency'

      @DefaultAggregation: #FORMULA
      @AnalyticsDetails.query.formula:  '$projection.NonContractPurchaseRatio * 100 '
      @EndUserText.label: 'Off Contract Spend In Percentage'
      1                                                                            as NonContractPurchaseRateInPct

}