C_PriceVariance

DDL: C_PRICEVARIANCE SQL: CMMPRICEVAR Type: view CONSUMPTION

Supplier Evaluation by Price Variance

C_PriceVariance is a Consumption CDS View that provides data about "Supplier Evaluation by Price Variance" in SAP S/4HANA. It reads from 2 data sources (P_PriceVariance3, P_PriceVarianceUpdatedScore). It has 6 associations to related views. It is used in 8 Fiori applications: Supplier Evaluation by Quantity, Operational Supplier Evaluation, Supplier Evaluation by Price, ....

Data Sources (2)

SourceAliasJoin Type
P_PriceVariance3 P_PriceVariance3 from
P_PriceVarianceUpdatedScore UpdatedScore left_outer

Parameters (4)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_StartDate bedat
P_EndDate bedat
P_DateFunction datefunctionid

Associations (6)

CardinalityTargetAliasCondition
[1..1] C_MM_MaterialValueHelp _Material $projection.Material = _Material.Material and $projection.Plant = _Material.Plant
[1..1] C_MM_MaterialGroupValueHelp _MaterialGroup $projection.MaterialGroup = _MaterialGroup.MaterialGroup
[1..1] C_MM_SupplierValueHelp _Supplier $projection.Supplier = _Supplier.Supplier and $projection.CompanyCode = _Supplier.CompanyCode association[1..1] to I_PurchasingGroup as _PurchasingGroup on $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup
[1..1] I_PurchasingOrganization _PurchasingOrganization $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[1..1] I_CalendarDate _Calendar $projection.PurchaseOrderDate = _Calendar.CalendarDate

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName CMMPRICEVAR view
EndUserText.label Supplier Evaluation by Price Variance view
VDM.viewType #CONSUMPTION view
OData.publish true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
Metadata.allowExtensions true view

Fiori Apps (8)

App IDApp NameTypeDescription
F1661 Supplier Evaluation by Quantity Analytical With the Supplier Evaluation by Quantity app, you can determine the quantity variance, which is based on the variance between the ordered quantity and delivered quantity of items. Both the excess and less delivered quantities are considered.
F1662 Operational Supplier Evaluation Analytical This app determines the score of a supplier in an organization based on the weighted average of the quantity variance, price variance, and time variance. The score is calculated over a period of 365 days. The overall score is calculated from the variance available from the different criteria, price, time, quantity or soft score after applying the weightage. Both early and late deliveries of items are considered variance.
F1663 Supplier Evaluation by Price Analytical With the Supplier Evaluation by Price app, you can determine the score of a given supplier in an organization based on the variance in the price of ordered items and delivered items. The score is calculated over a period of one year and is based on the difference in the purchase order amount and invoice amount. Both the excess and less price are considered as variance.
F1664 Supplier Evaluation by Time Analytical ou can use this app to determine the score of a given supplier in an organization based on the difference in time between the ordered date of items and delivered date of items. The score is calculated over a period of 365 days. Both the late and earlier deliveries of items are considered as variance.
F2234 Supplier Evaluation by Questionnaire Analytical
F2234A Supplier Evaluation by Questionnaire (Version 2) Analytical
F2309 Supplier Evaluation by Quality Analytical With the Supplier Evaluation by Quality app, you can determine the scores for given suppliers based on the inspection lot.
F3295A Supplier Evaluation By Quality (for Quality Notification) (Version 2) Analytical

Supplier Evaluation by Quantity

Business Role: Strategic Buyer

With the Supplier Evaluation by Quantity app, you can determine the quantity variance, which is based on the variance between the ordered quantity and the delivered quantity of items. Both the excess and the lower delivered quantities are considered as variances. The score is determined over the previous year to date. 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: F_BKPF_BUK M_BEST_WRK M_BEST_EKG M_BEST_EKO The KPI is displayed in the following views: By Supplier By Purchasing Group By Purchasing Organization By Purchasing Category By Material Group By Plant Document Trend by Supplier Trend by Purchasing Category

Key Features: You can perform the following tasks: Apply filters to display views. You can set default values for these filters: Purchasing Organization, Material Group, Plant, and Purchasing Group. To do this, go to User Actions Menu Settings Default Values. For more information, see Maintaining Your Default User Values. Apply filter to display views. Display views as chart and in tabular format. Send the app link as email or export as an excel Personalize tiles: Filter views Click the arrow icon on the screen Choose the Save as Tile option Enter relevant details and saveThe newly created tile displays on the launchpad. Navigate to the following apps: Create Activity Manage Activities Manage Purchase Order Manage Purchasing Category Purchasing Category Factsheet My Purchasing Document Items Supplier Factsheet

Operational Supplier Evaluation

Business Role: Strategic Buyer

This app determines the score of a supplier in an organization based on the weighted average of the quantity variance, price variance, and time variance. The score is calculated over the previous year to date. The overall score is calculated from the variance available from the different criteria, and then the weighting is applied. For example, price is weighted more than quantity. 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: F_BKPF_BUK M_BEST_WRK M_BEST_EKG M_BEST_EKO The KPI is displayed in the following views: By Supplier By Purchasing Group By Purchasing Organization By Purchasing Category By Material Group By Plant Document Trend Trend by Supplier Trend by Purchasing Category By Top 10 Suppliers By Bottom 10 Suppliers

Key Features: Using this app, you can do the following: Apply filters to display views. You can set default values for these filters: Purchasing Organization, Material Group, Plant, and Purchasing Group. To do this, go to User Actions Menu Settings Default Values. For more information, see Maintaining Your Default User Values. Analyze data in the form of chart and in tabular format. Share the analysis results via an email or export as an excel. Save the analyzed filters for later reference as a new tile: Filter views Click the arrow icon on the screen Choose the Save as Tile option Enter relevant details and saveThe newly created tile displays on the launchpad. Navigate to the following apps: Manage Purchasing Category Purchasing Category Factsheet My Purchasing Document Items Supplier Factsheet The views are grouped according to the supplier, purchasing group, purchasing organization, purchasing category, material group, document, and trend.

Supplier Evaluation by Price

Business Role: Strategic Buyer

With the Supplier Evaluation by Price app, you can determine the score of a given supplier in an organization based on the variance in the price of ordered items and delivered items. The score is calculated over the previous year to date and is based on the difference in the purchase order amount and invoice amount. Both the excess price and the lower price are considered as variances. 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: F_BKPF_BUK M_BEST_WRK M_BEST_EKG M_BEST_EKO The KPI is displayed in the following views: By Supplier By Purchasing Group By Purchasing Organization By Purchasing Category By Material Group By Plant Document Trend by Supplier Trend by Purchasing Category

Key Features: You can perform the following tasks: Apply filters to display views. You can set default values for these filters: Purchasing Organization, Material Group, Plant, and Purchasing Group. To do this, go to User Actions Menu Settings Default Values. For more information, see Maintaining Your Default User Values. Apply filter to display views. Display every view as chart and in tabular format. Personalize tiles: Filter views Click the arrow icon on the screen Choose the Save as Tile option Enter relevant details and saveThe newly created tile displays on the launchpad. Navigate to the following apps: Create Activity Manage Activities Manage Purchase Order Manage Purchasing Category Purchasing Category Factsheet My Purchasing Document Items

Supplier Evaluation by Time

Business Role: Strategic Buyer

You can use this app to determine the score of a given supplier in an organization based on the difference in time between the ordered date of items and delivered date of items. The score is calculated over the previous year to date. Both the late and early deliveries of items are considered as variance. You can also see the time variance by delivery date. 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: F_BKPF_BUK M_BEST_WRK M_BEST_EKG M_BEST_EKO The KPI is displayed in the following views: By Supplier By Purchasing Group By Purchasing Organization By Purchasing Category By Material Group By Plant Document Trend by Supplier Trend by Purchasing Organization

Key Features: Using this app, you can do the following: Apply filters to display views. You can set default values for these filters: Purchasing Organization, Material Group, Plant, and Purchasing Group. To do this, go to User Actions Menu Settings Default Values. For more information, see Maintaining Your Default User Values. Apply filter to display views. Analyze data in the form of chart and in tabular format. Share the analysis results via an email or export as an excel. Personalize tiles: Filter views Click the arrow icon on the screen Choose the Save as Tile option Enter relevant details and saveThe newly created tile displays on the launchpad. Navigate to the following apps: Create Activity Manage Activities Manage Purchase Order Manage Purchasing Category Purchasing Category Factsheet My Purchasing Document Items Supplier Factsheet

Supplier Evaluation by Questionnaire

Business Role: Strategic Buyer

With the Supplier Evaluation by Questionnaire app, you can determine the evaluation scores for the given suppliers based on the questionnaires. You can also view the target score for the supplier to compare it with the actual calculated score. The score is determined over the previous year to date. 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 object must be maintained in SU22: /SRMSMC/BO The KPI is displayed in the following views: By Supplier By Purchasing Category Document

Key Features: You can perform the following tasks: Apply filter to display views. Display views as chart and in tabular format. Send the app link as email or export as an excel Personalize tiles: Filter views Click the arrow icon on the screen Choose the Save as Tile option Enter relevant details and saveThe newly created tile displays on the launchpad. Navigate to the following apps: Create Activity Manage Activity Display Scorecards Manage Purchasing Category Purchasing Category Factsheet My Purchasing Document Items Supplier Factsheet

@AbapCatalog.sqlViewName: 'CMMPRICEVAR'
@EndUserText.label: 'Supplier Evaluation by Price Variance'
@VDM.viewType: #CONSUMPTION
//Commented as analytical manager no longer supports AVG, COUNT, COUNT_DISTINCT     //2809288

//@Analytics.dataCategory: #CUBE

@OData.publish: true
@AccessControl.authorizationCheck : #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE //Inserted by VDM CDS Suite Plugin

@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality:  #D
@ObjectModel.usageType.sizeCategory: #XL
@Metadata.allowExtensions:true

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

    @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    P_PriceVariance3( P_DisplayCurrency : $parameters.P_DisplayCurrency,
                                      P_StartDate : $parameters.P_StartDate,
                                      P_EndDate : $parameters.P_EndDate )               as PriceVariance
  
          
   left outer join P_PriceVarianceUpdatedScore  as UpdatedScore     on  PriceVariance.PurchaseOrder     = UpdatedScore.PurchaseOrder
                                                                                 and PriceVariance.PurchaseOrderItem = UpdatedScore.PurchaseOrderItem
  association [1..1] to C_MM_MaterialValueHelp      as _Material               on  $projection.Material = _Material.Material
                                                                               and $projection.Plant    = _Material.Plant

  association [1..1] to C_MM_MaterialGroupValueHelp as _MaterialGroup          on $projection.MaterialGroup = _MaterialGroup.MaterialGroup
                                                        
  association [1..1] to C_MM_SupplierValueHelp   as _Supplier               on $projection.Supplier = _Supplier.Supplier
                                                                           and $projection.CompanyCode = _Supplier.CompanyCode
  
  association[1..1] to I_PurchasingGroup as _PurchasingGroup on $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup  
  
  association [1..1] to I_PurchasingOrganization as _PurchasingOrganization on $projection.PurchasingOrganization = _PurchasingOrganization.PurchasingOrganization
  
  association [1..1] to I_Plant                  as _Plant                  on $projection.Plant = _Plant.Plant
  
  association [1..1] to I_CalendarDate           as _Calendar               on $projection.PurchaseOrderDate = _Calendar.CalendarDate
  
{
      /* Keys */
  key cast( PriceVariance.PurchaseOrder as vdm_purchaseorder )                      as PurchaseOrder,
  key cast(PriceVariance.PurchaseOrderItem as vdm_purchaseorderitem)                as PurchaseOrderItem,
       @Consumption.hidden: true  
      @Environment.sql.passValue: true
  key PurgDocMigrtnIsCmpltdForAnlyts,
      
      @Environment.sql.passValue: true
  key SuplrEvalRelevantDocCategory,
  
      @Consumption.hidden: true
      PurchaseOrderDate,
      @Semantics.calendar.year: true
      _Calendar.CalendarYear,
      _Calendar.CalendarQuarter,
      _Calendar.CalendarMonth,
      _Calendar.CalendarWeek,

      /* Org Data */
      @Consumption.labelElement: 'PurchasingOrganizationName'
      @Consumption.valueHelpDefinition: [{ entity: { name : 'C_PurchasingOrgValueHelp', element : 'PurchasingOrganization' } }]
      PriceVariance.PurchasingOrganization,
      @Semantics.text: true
      _PurchasingOrganization.PurchasingOrganizationName,
      @Consumption.labelElement: 'PurchasingGroupName'
      @Consumption.valueHelpDefinition: [{ entity: { name : 'C_PurchasingGroupValueHelp', element : 'PurchasingGroup' } }]
      PurchasingGroup,
      @Semantics.text: true
      _PurchasingGroup.PurchasingGroupName,
      CompanyCode,

      /* Supplier */
      //@Consumption.labelElement: 'SupplierName'

      @ObjectModel.text.element: ['SupplierName']
      @Consumption.valueHelpDefinition: [{ entity: { name : 'C_MM_SmplSupplierValueHelp', element : 'Supplier' } }]
      Supplier,
      @Semantics.text: true
      _Supplier.SupplierName                                                       as  SupplierName,
      @Consumption.labelElement: 'CountryName'
      @Consumption.valueHelpDefinition: [{ entity: { name : 'C_MM_CountryValueHelp', element : 'SupplierCountry' } }]
      cast( _Supplier.Country as mm_a_supplier_country )                           as SupplierCountry,
      @Semantics.text: true
      _Supplier._CountryText[1: Language = $session.system_language].CountryName,

      /* Item Data */
      @Consumption.labelElement: 'PlantName'
      PriceVariance.Plant,
      @Semantics.text: true
      _Plant.PlantName,

      @Consumption.labelElement: 'MaterialName'
      @Consumption.valueHelpDefinition: [{ entity: { name : 'C_MM_MaterialValueHelp', element : 'Material' } }]
      Material,
      @Semantics.text: true
      _Material.MaterialName,

      @Consumption.labelElement: 'MaterialGroupName'
      PriceVariance.MaterialGroup,
      @Semantics.text: true
      _MaterialGroup.MaterialGroupName,

      @ObjectModel.text.element: ['PurgCatName']
      @Consumption.labelElement: 'PurgCatName'
      @Consumption.valueHelpDefinition: [{ entity: { name : 'I_PurchasingCategoryValueHelp', element : 'PurchasingCategory' } }]
      PriceVariance.PurchasingCategory                                            as PurchasingCategory,
      @Semantics.text: true
      PurgCatName                                                                 as PurgCatName,

      @Semantics.currencyCode: true
      Currency,
      @Semantics.unitOfMeasure: true
      PurchaseOrderQuantityUnit,
      
      @Semantics.currencyCode: true      
      DisplayCurrency,

      /* Measures */
      @DefaultAggregation: #AVG
      //cast(PriceVarianceInPct as mm_a_variance_pct) as PriceVarianceInPct,                  //2809288

      @EndUserText.label: 'Variance %'
      cast(PriceVarianceInPct as mm_ana_price_var_pct) as PriceVarianceInPct,                  

      @DefaultAggregation: #AVG
      //@Semantics.amount.currencyCode: 'Currency'

      @Semantics.amount.currencyCode: 'DisplayCurrency'
      @EndUserText.label: 'Price Variance Amount'
      cast(PriceVarianceAmount as abap.curr(13,3)) as PriceVarianceAmount,                  //2809288


      @DefaultAggregation: #AVG
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      @EndUserText.label: 'PO price per unit'
      cast(PurchaseOrderNetPriceAmount as abap.curr(13,3)) as PurchaseOrderNetPriceAmount,  //2809288

      
      @DefaultAggregation: #AVG
      @EndUserText.label: 'Invc price per unit'
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast(InvoicePrice as abap.curr(13,3)) as InvoicePrice,                                //2809288


      @DefaultAggregation: #SUM
      @Semantics.quantity.unitOfMeasure: 'PurchaseOrderQuantityUnit'
      @EndUserText.label: 'Delivered Quantity'
      DeliveredQuantity,
      
      @DefaultAggregation: #SUM
      @Semantics.quantity.unitOfMeasure: 'PurchaseOrderQuantityUnit'
      @EndUserText.label: 'Ordered Quantity'
      OrderedQuantity,

      @DefaultAggregation: #AVG
      cast( case when UpdatedScore.IsScoreChanged = 'X'
            then UpdatedScore.PriceVarianceScore
           else SupplierEvaluationScore 
      end as mm_a_variance_score ) as PriceVarianceScore,
      
      // @EndUserText.label: 'Purchase Order Count'

       @Aggregation.referenceElement: ['PurchaseOrder']
      @Aggregation.default: #COUNT_DISTINCT
       cast( 1 as mm_pur_ana_numbrofpurords ) as NumberOfPurchaseOrders,    
       
      //@EndUserText.label: 'Purchase Order Item Count'

        @DefaultAggregation: #SUM
       cast( 1 as mm_pur_ana_numbrofpurorditms ) as NumberOfPurchaseOrderItems  
            
} 
     
  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_MM_MATERIALGROUPVALUEHELP",
"C_MM_MATERIALVALUEHELP",
"C_MM_SUPPLIERVALUEHELP",
"I_CALENDARDATE",
"I_COUNTRYTEXT",
"I_PLANT",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION",
"P_PRICEVARIANCE3",
"P_PRICEVARIANCEUPDATEDSCORE"
],
"ASSOCIATED":
[
"C_MM_MATERIALGROUPVALUEHELP",
"C_MM_MATERIALVALUEHELP",
"C_MM_SUPPLIERVALUEHELP",
"I_CALENDARDATE",
"I_PLANT",
"I_PURCHASINGGROUP",
"I_PURCHASINGORGANIZATION"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/