R_SalesOrderPricingElementTP

DDL: R_SALESORDERPRICINGELEMENTTP Type: view_entity TRANSACTIONAL Package: RAP_SD_SLS_SO

Sales Order Pricing Element - TP

R_SalesOrderPricingElementTP is a Transactional CDS View that provides data about "Sales Order Pricing Element - TP" in SAP S/4HANA. It reads from 1 data source (I_SalesOrderPricingElement) and exposes 45 fields with key fields SalesOrder, PricingProcedureStep, PricingProcedureCounter. Part of development package RAP_SD_SLS_SO.

Data Sources (1)

SourceAliasJoin Type
I_SalesOrderPricingElement SalesOrderPricingElement from

Annotations (8)

NameValueLevelField
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
VDM.viewType #TRANSACTIONAL view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
Metadata.ignorePropagatedAnnotations true view
EndUserText.label Sales Order Pricing Element - TP view

Fields (45)

KeyFieldSource TableSource FieldDescription
KEY SalesOrder I_SalesOrderPricingElement SalesOrder
KEY PricingProcedureStep I_SalesOrderPricingElement PricingProcedureStep
KEY PricingProcedureCounter I_SalesOrderPricingElement PricingProcedureCounter
ConditionApplication I_SalesOrderPricingElement ConditionApplication
ConditionType I_SalesOrderPricingElement ConditionType
ConditionTypeName
PriceElementDescription
ConditionCalculationType I_SalesOrderPricingElement ConditionCalculationType
PriceConditionDeterminationDte I_SalesOrderPricingElement PriceConditionDeterminationDte
ConditionRateAmount I_SalesOrderPricingElement ConditionRateAmount
ConditionRateRatio I_SalesOrderPricingElement ConditionRateRatio
ConditionBaseAmount I_SalesOrderPricingElement ConditionBaseAmount
ConditionBaseQuantity I_SalesOrderPricingElement ConditionBaseQuantity
ConditionQuantity I_SalesOrderPricingElement ConditionQuantity
ConditionAmount I_SalesOrderPricingElement ConditionAmount
ConditionCurrency I_SalesOrderPricingElement ConditionCurrency
TransactionCurrency I_SalesOrderPricingElement TransactionCurrency
ConditionQuantityUnit I_SalesOrderPricingElement ConditionQuantityUnit
ConditionRateRatioUnit I_SalesOrderPricingElement ConditionRateRatioUnit
ConditionIsForStatistics I_SalesOrderPricingElement ConditionIsForStatistics
ConditionIsManuallyChanged I_SalesOrderPricingElement ConditionIsManuallyChanged
ConditionInactiveReason I_SalesOrderPricingElement ConditionInactiveReason
ConditionClass I_SalesOrderPricingElement ConditionClass
ConditionOrigin I_SalesOrderPricingElement ConditionOrigin
ConditionControl I_SalesOrderPricingElement ConditionControl
CndnRoundingOffDiffAmount I_SalesOrderPricingElement CndnRoundingOffDiffAmount
TaxCode I_SalesOrderPricingElement TaxCode
VariantCondition I_SalesOrderPricingElement VariantCondition
IsGroupCondition I_SalesOrderPricingElement IsGroupCondition_2
SalesOrderType _SalesOrder SalesOrderType
SalesOrganization _SalesOrder SalesOrganization
DistributionChannel _SalesOrder DistributionChannel
OrganizationDivision _SalesOrder OrganizationDivision
_SalesOrder _SalesOrder
_ConditionApplication I_SalesOrderPricingElement _ConditionApplication
_PricingConditionType I_SalesOrderPricingElement _PricingConditionType
_ConditionCalculationType I_SalesOrderPricingElement _ConditionCalculationType
_ConditionCurrency I_SalesOrderPricingElement _ConditionCurrency
_TransactionCurrency I_SalesOrderPricingElement _Currency
_ConditionQuantityUnit I_SalesOrderPricingElement _ConditionQuantityUnit
_ConditionInactiveReason I_SalesOrderPricingElement _ConditionInactiveReason
_ConditionClass I_SalesOrderPricingElement _ConditionClass
_ConditionOrigin I_SalesOrderPricingElement _ConditionOrigin
_ConditionControl I_SalesOrderPricingElement _ConditionControl
_ConditionRateRatioUnit I_SalesOrderPricingElement _ConditionRateRatioUnit
@VDM: {
  lifecycle.contract.type: #SAP_INTERNAL_API,
  viewType: #TRANSACTIONAL
}

@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #('TRANSACTIONAL_DATA')
}

@ObjectModel: {
    usageType: {
        dataClass: #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #XL
    }
}

@ObjectModel.semanticKey: ['SalesOrder', 'PricingProcedureStep', 'PricingProcedureCounter']

@Metadata.ignorePropagatedAnnotations: true

@EndUserText.label: 'Sales Order Pricing Element - TP'
define view entity R_SalesOrderPricingElementTP
  as select from I_SalesOrderPricingElement as SalesOrderPricingElement

  association to parent R_SalesOrderTP as _SalesOrder on $projection.SalesOrder = _SalesOrder.SalesOrder
{

  key SalesOrderPricingElement.SalesOrder,

  key SalesOrderPricingElement.PricingProcedureStep,

  key SalesOrderPricingElement.PricingProcedureCounter,

      @ObjectModel.foreignKey.association: '_ConditionApplication'
      SalesOrderPricingElement.ConditionApplication,

      @ObjectModel.foreignKey.association: '_PricingConditionType'
      SalesOrderPricingElement.ConditionType,

      //    needed as condition type name is filled without any condition type key for subtotal lines

      SalesOrderPricingElement._PricingConditionType._Text_2[1: Language=$session.system_language].ConditionTypeName as ConditionTypeName,
      
      cast(SalesOrderPricingElement._PricingConditionType._Text_2[1: Language=$session.system_language].ConditionTypeName as priceelementdescription) as PriceElementDescription,

      @ObjectModel.foreignKey.association: '_ConditionCalculationType'
      SalesOrderPricingElement.ConditionCalculationType,
      
      SalesOrderPricingElement.PriceConditionDeterminationDte,

      @Semantics.amount.currencyCode: 'ConditionCurrency'
      SalesOrderPricingElement.ConditionRateAmount,

      @Semantics.quantity.unitOfMeasure: 'ConditionRateRatioUnit'
      SalesOrderPricingElement.ConditionRateRatio,

      @Semantics.amount.currencyCode: 'TransactionCurrency'
      SalesOrderPricingElement.ConditionBaseAmount,

      @Semantics.quantity.unitOfMeasure: 'ConditionQuantityUnit'
      SalesOrderPricingElement.ConditionBaseQuantity,

      @Semantics.quantity.unitOfMeasure: 'ConditionQuantityUnit'
      SalesOrderPricingElement.ConditionQuantity,

      @Semantics.amount.currencyCode: 'TransactionCurrency'
      SalesOrderPricingElement.ConditionAmount,

      @ObjectModel.foreignKey.association: '_ConditionCurrency'
      SalesOrderPricingElement.ConditionCurrency,

      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      SalesOrderPricingElement.TransactionCurrency,

      @ObjectModel.foreignKey.association: '_ConditionQuantityUnit'
      SalesOrderPricingElement.ConditionQuantityUnit,

      @ObjectModel.foreignKey.association: '_ConditionRateRatioUnit'
      SalesOrderPricingElement.ConditionRateRatioUnit,

      SalesOrderPricingElement.ConditionIsForStatistics,

      SalesOrderPricingElement.ConditionIsManuallyChanged,

      @ObjectModel.foreignKey.association: '_ConditionInactiveReason'
      SalesOrderPricingElement.ConditionInactiveReason,
      
      @ObjectModel.foreignKey.association: '_ConditionClass'
      SalesOrderPricingElement.ConditionClass,  
      
      @ObjectModel.foreignKey.association: '_ConditionOrigin'
      SalesOrderPricingElement.ConditionOrigin,
            
      @ObjectModel.foreignKey.association: '_ConditionControl'
      SalesOrderPricingElement.ConditionControl,
      
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      SalesOrderPricingElement.CndnRoundingOffDiffAmount,
                   
      SalesOrderPricingElement.TaxCode,
      
      SalesOrderPricingElement.VariantCondition,
      
      SalesOrderPricingElement.IsGroupCondition_2 as IsGroupCondition,
      
      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionRateRatioUnit = ''
          then 'X'
        else ''
      end as boole_d )                                                                                               as ConditionRateValueIsAmount,

      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionRateRatioUnit = ''
          then ''
        else 'X'
      end as boole_d )                                                                                               as ConditionRateValueIsRatio,

      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionCalculationType = 'A'
            or ConditionCalculationType = 'B'
            or ConditionCalculationType = 'H'
            or ConditionCalculationType = 'I'
            or ConditionCalculationType = 'J'
            or ConditionCalculationType = 'K'
            or ConditionCalculationType = 'W'
          then ''
        else 'X'
      end as boole_d )                                                                                               as ConditionBaseValueIsQuantity,

      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionCalculationType = 'A'
            or ConditionCalculationType = 'B'
            or ConditionCalculationType = 'H'
            or ConditionCalculationType = 'I'
            or ConditionCalculationType = 'J'
            or ConditionCalculationType = 'K'
            or ConditionCalculationType = 'W'
          then 'X'
        else ''
      end as boole_d )                                                                                               as ConditionBaseValueIsAmount,
      
      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionRateAmount is initial 
           and ConditionRateRatio  is initial
           then 'X'
          else ''
       end as boole_d )                                                                                              as ConditionRateValueIsNull,
       
      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionQuantity is initial
           then 'X'
          else ''
       end as boole_d )                                                                                              as ConditionQuantityIsNull,
       
      @Semantics.booleanIndicator: true
      cast(
        case
          when ConditionAmount is initial
           then 'X'
          else ''
       end as boole_d )                                                                                              as ConditionAmountIsNull,              
      
      //for DCL

      @Consumption.hidden: true
      _SalesOrder.SalesOrderType,
      @Consumption.hidden: true
      _SalesOrder.SalesOrganization,
      @Consumption.hidden: true
      _SalesOrder.DistributionChannel,
      @Consumption.hidden: true
      _SalesOrder.OrganizationDivision,

      //Associations

      _SalesOrder,
      SalesOrderPricingElement._ConditionApplication,
      SalesOrderPricingElement._PricingConditionType,
      SalesOrderPricingElement._ConditionCalculationType,
      SalesOrderPricingElement._ConditionCurrency,
      SalesOrderPricingElement._Currency                                                                             as _TransactionCurrency,
      SalesOrderPricingElement._ConditionQuantityUnit,
      SalesOrderPricingElement._ConditionInactiveReason,
      SalesOrderPricingElement._ConditionClass,
      SalesOrderPricingElement._ConditionOrigin,
      SalesOrderPricingElement._ConditionControl,
      SalesOrderPricingElement._ConditionRateRatioUnit
}