P_SI4_TrainingData10

DDL: P_SI4_TRAININGDATA10 SQL: PSDSI4TD10 Type: view COMPOSITE Package: VDM_SD_SP

Sales Performance Prediction

P_SI4_TrainingData10 is a Composite CDS View that provides data about "Sales Performance Prediction" in SAP S/4HANA. It reads from 5 data sources (I_Customer, I_Product, P_SI4_Period, I_SalesOrganization, P_SI4_TrainingData09) and exposes 79 fields with key fields YearMonth, PartOfMonth, SoldToParty, SalesOrganization, DistributionChannel. Part of development package VDM_SD_SP.

Data Sources (5)

SourceAliasJoin Type
I_Customer C left_outer
I_Product P left_outer
P_SI4_Period Period left_outer
I_SalesOrganization SO left_outer
P_SI4_TrainingData09 TD9 from

Annotations (4)

NameValueLevelField
AbapCatalog.sqlViewName PSDSI4TD10 view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (79)

KeyFieldSource TableSource FieldDescription
KEY YearMonth YearMonth
KEY PartOfMonth PartOfMonth
KEY SoldToParty SoldToParty
KEY SalesOrganization P_SI4_TrainingData09 SalesOrganization
KEY DistributionChannel DistributionChannel
KEY Division P_SI4_TrainingData09 Division
KEY Material Material
MaterialGroup MaterialGroup
CustomerGroup CustomerGroup
CustomerName
CreatedByUser I_Customer CreatedByUser
CustomerClassification I_Customer CustomerClassification
CustomerAccountGroup I_Customer CustomerAccountGroup
IsOneTimeAccount I_Customer IsOneTimeAccount
IsBusinessPurposeCompleted I_Customer IsBusinessPurposeCompleted
Industry I_Customer Industry
Country I_Customer Country
CityName I_Customer CityName
ProductType I_Product ProductType
CompanyCode I_SalesOrganization CompanyCode
IntercompanyBillingCustomer I_SalesOrganization IntercompanyBillingCustomer
PartOfQuarter PartOfQuarter
CalendarYear CalendarYear
CalendarQuarter CalendarQuarter
CalendarMonth CalendarMonth
CalendarWeek CalendarWeek
TargetAmount TargetAmount
CountByPOM CntByPOM
SumAmtByPOM SumAmtByPOM
MaxAmtByPOM MaxAmtByPOM
MinAmtByPOM MinAmtByPOM
CountByPOQ CntByPOQ
SumAmtByPOQ SumAmtByPOQ
MaxAmtByPOQ MaxAmtByPOQ
MinAmtByPOQ MinAmtByPOQ
CountByPre1Month CntByPre1Month
SumAmtByPre1Month SumAmtByPre1Month
MaxAmtByPre1Month MaxAmtByPre1Month
MinAmtByPre1Month MinAmtByPre1Month
CountByPre1Quarter CntByPre1Quarter
SumAmtByPre1Quarter SumAmtByPre1Quarter
MaxAmtByPre1Quarter MaxAmtByPre1Quarter
MinAmtByPre1Quarter MinAmtByPre1Quarter
DiffCountByPOM
DiffSumAmtByPOM
DiffMaxAmtByPOM
DiffMinAmtByPOM
DiffCountByPOQ
DiffSumAmtByPOQ
DiffMaxAmtByPOQ
DiffMinAmtByPOQ
AvgCountByPOM
AvgCountByPOQ
SumAmtByPre2Month
SumAmtByPre3Month
SumAmtByPre4Month
SumAmtByPre5Month
SumAmtByPre6Month
DeltaAmtByMoM1
DeltaAmtByMoM2
DeltaAmtByMoM3
DeltaAmtByMoM4
DeltaAmtByMoM5
DeltaAmtByMoM6
DeltaAmtByYoY1
DeltaAmtByYoY2
DeltaAmtByYoY3
DeltaAmtByYoY4
DeltaAmtByYoY5
DeltaAmtByYoY6
AvgAmtByLast2Month
AvgAmtByLast3Month
SumAmtRatioByLast3Month1
SumAmtRatioByLast3Month2
SumAmtRatioByLast3Month3
DiffAmtByPOM1
DiffAmtByPOM2
CurrentYearMonth P_SI4_Period CurrentYearMonth
NextYearMonth P_SI4_Period NextYearMonth
@AbapCatalog.sqlViewName: 'PSDSI4TD10'
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.private: true
@VDM.viewType: #COMPOSITE

define view P_SI4_TrainingData10
as select from P_SI4_TrainingData09 as TD9
left outer join I_Customer as C
  on SoldToParty = C.Customer
left outer join I_Product as P
  on Material = P.Product
left outer join I_SalesOrganization as SO
  on TD9.SalesOrganization = SO.SalesOrganization
left outer join P_SI4_Period as Period
  on Period.CalendarDate = Period.CalendarDate
{
  key YearMonth,
  key PartOfMonth,
  key SoldToParty,
  key TD9.SalesOrganization,
  key DistributionChannel,
  key TD9.Division,
  key Material,
  
  MaterialGroup,
  CustomerGroup,

  cast( '' as md_customer_name ) as CustomerName,
  C.CreatedByUser,
  C.CustomerClassification,
  C.CustomerAccountGroup,
  C.IsOneTimeAccount,
  C.IsBusinessPurposeCompleted,
  C.Industry,
  C.Country,
  C.CityName,
  P.ProductType,
  SO.CompanyCode,
  SO.IntercompanyBillingCustomer,
  
  // YearQuarter,

  PartOfQuarter,
  
  CalendarYear,
  CalendarQuarter,
  CalendarMonth,
  CalendarWeek,
  
  TargetAmount,
  
  CntByPOM as CountByPOM,
  SumAmtByPOM,
  MaxAmtByPOM,
  MinAmtByPOM,
  cast(
    case
      when CntByPOM != 0 and CntByPOM is not null
        then DIV(SumAmtByPOM, CntByPOM)
      else 0
    end
  as netwr) as AvgAmtByPOM,

  CntByPOQ as CountByPOQ,
  SumAmtByPOQ,
  MaxAmtByPOQ,
  MinAmtByPOQ,
  cast(
    case
      when CntByPOQ != 0 and CntByPOQ is not null
        then DIV(SumAmtByPOQ, CntByPOQ)
      else 0
    end
  as netwr) as AvgAmtByPOQ,

  CntByPre1Month as CountByPre1Month,
  SumAmtByPre1Month,
  MaxAmtByPre1Month,
  MinAmtByPre1Month,
  cast(
    case
      when CntByPre1Month != 0 and CntByPre1Month is not null
        then DIV(SumAmtByPre1Month, CntByPre1Month)
      else 0
    end
  as netwr) as AvgAmtByPre1Month,

  CntByPre1Quarter as CountByPre1Quarter,
  SumAmtByPre1Quarter,
  MaxAmtByPre1Quarter,
  MinAmtByPre1Quarter,
  cast(
    case
      when CntByPre1Quarter != 0 and CntByPre1Quarter is not null
        then DIV(SumAmtByPre1Quarter, CntByPre1Quarter)
      else 0
    end
  as netwr) as AvgAmtByPre1Quarter,
  
  cast( CntByPOM - CntByPre1Month as int4) as DiffCountByPOM,
  cast( SumAmtByPOM - SumAmtByPre1Month as netwr) as DiffSumAmtByPOM,
  cast( MaxAmtByPOM - MaxAmtByPre1Month as netwr) as DiffMaxAmtByPOM,
  cast( MinAmtByPOM - MinAmtByPre1Month as netwr) as DiffMinAmtByPOM,
  
  cast( CntByPOQ - CntByPre1Quarter as int4) as DiffCountByPOQ,
  cast( SumAmtByPOQ - SumAmtByPre1Quarter as netwr) as DiffSumAmtByPOQ,
  cast( MaxAmtByPOQ - MaxAmtByPre1Quarter as netwr) as DiffMaxAmtByPOQ,
  cast( MinAmtByPOQ - MinAmtByPre1Quarter as netwr) as DiffMinAmtByPOQ,

  cast( 0 as netwr) as AvgCountByPOM,
  cast( 0 as netwr) as AvgCountByPOQ,
  
  cast( 0 as netwr) as SumAmtByPre2Month,
  cast( 0 as netwr) as SumAmtByPre3Month,
  cast( 0 as netwr) as SumAmtByPre4Month,
  cast( 0 as netwr) as SumAmtByPre5Month,
  cast( 0 as netwr) as SumAmtByPre6Month,

  cast( 0 as netwr) as DeltaAmtByMoM1,
  cast( 0 as netwr) as DeltaAmtByMoM2,
  cast( 0 as netwr) as DeltaAmtByMoM3,
  cast( 0 as netwr) as DeltaAmtByMoM4,
  cast( 0 as netwr) as DeltaAmtByMoM5,
  cast( 0 as netwr) as DeltaAmtByMoM6,
  
  cast( 0 as netwr) as DeltaAmtByYoY1,
  cast( 0 as netwr) as DeltaAmtByYoY2,
  cast( 0 as netwr) as DeltaAmtByYoY3,
  cast( 0 as netwr) as DeltaAmtByYoY4,
  cast( 0 as netwr) as DeltaAmtByYoY5,
  cast( 0 as netwr) as DeltaAmtByYoY6,

  cast( 0 as netwr) as AvgAmtByLast2Month,
  cast( 0 as netwr) as AvgAmtByLast3Month,
  
  cast( 0 as netwr) as SumAmtRatioByLast3Month1,
  cast( 0 as netwr) as SumAmtRatioByLast3Month2,
  cast( 0 as netwr) as SumAmtRatioByLast3Month3,

  cast( 0 as netwr) as DiffAmtByPOM1,
  cast( 0 as netwr) as DiffAmtByPOM2,
  
  Period.CurrentYearMonth,
  Period.NextYearMonth
}