P_RASchedItemSub

DDL: P_RASCHEDITEMSUB SQL: PRASCHEDITEMSUB Type: view COMPOSITE

P_RASchedItemSub is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_RASchedAllocatedAmtPerPerd) and exposes 28 fields with key fields PerformanceObligation, FiscalYear, FiscalPeriod, RevenueAccountingContract.

Data Sources (1)

SourceAliasJoin Type
P_RASchedAllocatedAmtPerPerd RevAcctgAllocatedAmtPerPerd from

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PRASCHEDITEMSUB view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (28)

KeyFieldSource TableSource FieldDescription
KEY PerformanceObligation P_RASchedAllocatedAmtPerPerd PerformanceObligation
KEY FiscalYear P_RASchedAllocatedAmtPerPerd FiscalYear
KEY FiscalPeriod P_RASchedAllocatedAmtPerPerd FiscalPeriod
KEY RevenueAccountingContract P_RASchedAllocatedAmtPerPerd RevenueAccountingContract
RAPerfOblgnDistinctType P_RASchedAllocatedAmtPerPerd RAPerfOblgnDistinctType
FiscalYearPeriod
RatioUnit
AllocatedPriceInSalesDocCrcy P_RASchedAllocatedAmtPerPerd TotalEffectiveAmtInSlsDocCrcy
ContractualPrcInSlsDocCrcy P_RASchedAllocatedAmtPerPerd TotalDocAmtContractual
PerfOblgnFaceAmtInSlsDocCrcy
RATotalCostInSlsDocCrcy
TolRecognizedCostPerPerd P_RASchedAllocatedAmtPerPerd TolRecognizedCostPerPerd
PerPerdInvoicedAmtInSlsDocCrcy
DeltaRecognizedAmtInSlsDocCrcy
RecgdCatchUpAmtInSlsDocCrcy
PostedRevnInSlsDocCrcy
PostponedRevnAmtInSlsDocCrcy
RADeltaRecgdCostInSlsDocCrcy
RAPostedCostInSlsDocCrcy
PostponedCostAmtInSlsDocCrcy RAPerfOblgnPostpnPostPerPerd PostpnDeltaCostInSlsDocCrcy
PerfOblgnEffectiveQuantity
PerfOblgnDeltaInvoicedQuantity
RevnAcctgSenderComponent
RevnAcctgOperationalDocument
RAOperationalDocumentItem
RANumberOfOperationalDocument
UpToCurPeriodRecognizedRevenue P_RASchedAllocatedAmtPerPerd TolRecognizedAmtPerPerd
TotRecgdCatchUpAmtInSlsDocCrcy P_RASchedAllocatedAmtPerPerd TolRecgdAmtCatchupPerPerd
@AbapCatalog.sqlViewName: 'PRASCHEDITEMSUB'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private: true
//@EndUserText.label: 'Distinct and Non-distinct POB'

define view P_RASchedItemSub
as select from P_RASchedAllocatedAmtPerPerd as RevAcctgAllocatedAmtPerPerd

//Delta Invoiced & Recognized & Catch Up Amount

left outer to one join P_RASchedPerfOblgnAmtPerd as RAPerfOblgnTotalAmtPerPeriod
  on RevAcctgAllocatedAmtPerPerd.PerformanceObligation = RAPerfOblgnTotalAmtPerPeriod.PerformanceObligation
  and RevAcctgAllocatedAmtPerPerd.FiscalYear = RAPerfOblgnTotalAmtPerPeriod.FiscalYear
  and RevAcctgAllocatedAmtPerPerd.FiscalPeriod = RAPerfOblgnTotalAmtPerPeriod.FiscalPeriod
  and RevAcctgAllocatedAmtPerPerd.RevenueAccountingContract = RAPerfOblgnTotalAmtPerPeriod.RevenueAccountingContract

//Delta Posting Amount

left outer to one join P_RASchedPerfOblgnPostdAmtPerd as RAPerfOblgnPostedRevnPerPerd  //Posted Revenue

  on RevAcctgAllocatedAmtPerPerd.PerformanceObligation = RAPerfOblgnPostedRevnPerPerd.PerformanceObligation
  and RevAcctgAllocatedAmtPerPerd.FiscalYear = RAPerfOblgnPostedRevnPerPerd.FiscalYear   
  and RevAcctgAllocatedAmtPerPerd.FiscalPeriod = RAPerfOblgnPostedRevnPerPerd.FiscalPeriod
  and RevAcctgAllocatedAmtPerPerd.RevenueAccountingContract = RAPerfOblgnPostedRevnPerPerd.RevenueAccountingContract   
  
left outer to one join P_RAPerfOblgnPostpnPostAmtPerd as RAPerfOblgnPostpnPostPerPerd  //Postpone Posting Revneue

  on RevAcctgAllocatedAmtPerPerd.PerformanceObligation = RAPerfOblgnPostpnPostPerPerd.PerformanceObligation
  and RevAcctgAllocatedAmtPerPerd.FiscalYear = RAPerfOblgnPostpnPostPerPerd.FiscalYear   
  and RevAcctgAllocatedAmtPerPerd.FiscalPeriod = RAPerfOblgnPostpnPostPerPerd.FiscalPeriod
  and RevAcctgAllocatedAmtPerPerd.RevenueAccountingContract = RAPerfOblgnPostpnPostPerPerd.RevenueAccountingContract 

/*****************Effective Quantity****************************/
left outer to one join P_RASchedCumltvEffctQtyPerPerd as RAEffectQtyPerPerd
  on RevAcctgAllocatedAmtPerPerd.PerformanceObligation = RAEffectQtyPerPerd.PerformanceObligation
  and RevAcctgAllocatedAmtPerPerd.FiscalYear = RAEffectQtyPerPerd.FiscalYear
  and RevAcctgAllocatedAmtPerPerd.FiscalPeriod = RAEffectQtyPerPerd.FiscalPeriod
  and RevAcctgAllocatedAmtPerPerd.RevenueAccountingContract = RAEffectQtyPerPerd.RevenueAccountingContract

/*****************Invoice Quantity****************************/ 
left outer to one join P_RASchedDeltaInvcQtyPerPerd as RAInvcAndFulfilledQtyPerPerd
  on RAInvcAndFulfilledQtyPerPerd.PerformanceObligation = RevAcctgAllocatedAmtPerPerd.PerformanceObligation
  and RAInvcAndFulfilledQtyPerPerd.FiscalYear = RevAcctgAllocatedAmtPerPerd.FiscalYear  
  and RAInvcAndFulfilledQtyPerPerd.FiscalPeriod = RevAcctgAllocatedAmtPerPerd.FiscalPeriod  
  and RAInvcAndFulfilledQtyPerPerd.RevenueAccountingContract = RevAcctgAllocatedAmtPerPerd.RevenueAccountingContract
  
 association to I_RAPerfOblgnWithoutAcctAssgmt as PerformanceObligation 
  on $projection.PerformanceObligation = PerformanceObligation.PerformanceObligation 
  and $projection.RevenueAccountingContract = PerformanceObligation.RevenueAccountingContract
  
{
/*======Key===============================================*/  
  key RevAcctgAllocatedAmtPerPerd.PerformanceObligation,
  key RevAcctgAllocatedAmtPerPerd.FiscalYear,
  key RevAcctgAllocatedAmtPerPerd.FiscalPeriod,
  key RevAcctgAllocatedAmtPerPerd.RevenueAccountingContract,  
  
  RevAcctgAllocatedAmtPerPerd.RAPerfOblgnDistinctType,
  
  //Acquistion cost POB and time-based POB starts very early(start period earlier than the creation period in chang type table, internal incident 2180404877) 

  //have no corresponding change type entry, so the RAHigherLevelPerfOblgn is null. Here use the value in POB table. This is actually not accrute for 

  //time-based POB starts very early since the distinct type maybe changed. The accrute solution is to get the high leverl POB id of creation change type entry.

  //However, since this case will normally not happen in production system, just leave it to avoid complexity. 

  case 
    when RevAcctgAllocatedAmtPerPerd.RAHigherLevelPerfOblgn is not initial then RevAcctgAllocatedAmtPerPerd.RAHigherLevelPerfOblgn
    else
      case PerformanceObligation.RAPerfOblgnDistinctType
        when 'N' then PerformanceObligation.RAHigherLevelPerfOblgn
        else PerformanceObligation.PerformanceObligation
      end
  end as RAHigherLevelPerfOblgn,
  
  cast(concat(RevAcctgAllocatedAmtPerPerd.FiscalYear,RevAcctgAllocatedAmtPerPerd.FiscalPeriod) as fis_jahrper_conv) as FiscalYearPeriod,
  cast(
    concat(RevAcctgAllocatedAmtPerPerd.FiscalPeriod,concat('.',RevAcctgAllocatedAmtPerPerd.FiscalYear)) 
    as fis_fiscalyearperiod_c) as FiscalYearPeriodCompoundText,
  

  @Semantics.unitOfMeasure: true      
  cast('%' as farr_quantity_unit ) as RatioUnit,   
  
/*======Cumulative Amount==========================================*/  
  //RelatedChgTypeItem.AllocatedPriceInSalesDocCrcy,

  RevAcctgAllocatedAmtPerPerd.TotalEffectiveAmtInSlsDocCrcy as AllocatedPriceInSalesDocCrcy,
  
  //RelatedChgTypeItem.ContractualPrcInSlsDocCrcy,

  RevAcctgAllocatedAmtPerPerd.TotalDocAmtContractual as ContractualPrcInSlsDocCrcy,
  
  RevAcctgAllocatedAmtPerPerd.TotalDocAmtContractual + RevAcctgAllocatedAmtPerPerd.TotalFreeFaceValue as PerfOblgnFaceAmtInSlsDocCrcy,

  cast(RevAcctgAllocatedAmtPerPerd.TolEffectiveCostPerPerd as farr_cost_total preserving type ) as RATotalCostInSlsDocCrcy,
  
  RevAcctgAllocatedAmtPerPerd.TolRecognizedCostPerPerd,
   
  cast(RevAcctgAllocatedAmtPerPerd.TotalEffectiveAmtInSlsDocCrcy
    - RevAcctgAllocatedAmtPerPerd.TolRecgdAmtCatchupPerPerd 
    - RevAcctgAllocatedAmtPerPerd.TolRecognizedAmtPerPerd 
    as farr_open_revenue) as RAOpenRevnInSlsDocCrcy,  
  
  //Open Cost

  cast(RevAcctgAllocatedAmtPerPerd.TolEffectiveCostPerPerd 
    - RevAcctgAllocatedAmtPerPerd.TolRecognizedCostPerPerd 
    as farr_open_cost) as RAOpenCostInSlsDocCrcy,  
  
/*======Delta Amount==========================================*/  
  //Delta Invoiced Amount

  cast(RAPerfOblgnTotalAmtPerPeriod.DeltaInvoicedAmtPerPerd as farr_cds_invoiced_amount preserving type) as PerPerdInvoicedAmtInSlsDocCrcy,
  //Delta Recognized Amount

  cast(RAPerfOblgnTotalAmtPerPeriod.DeltaRecognizedAmtPerPerd + RAPerfOblgnTotalAmtPerPeriod.DeltaRecgdAmtCatchupPerPerd as farr_recog_amt) as DeltaRecognizedAmtInSlsDocCrcy,
  //Delta Catch Up Amount

  cast(RAPerfOblgnTotalAmtPerPeriod.DeltaRecgdAmtCatchupPerPerd as farr_cds_rev_catchup_amt preserving type) as RecgdCatchUpAmtInSlsDocCrcy,
  //Delta Posted Amount. Must use coalesce( ) to convert null to 0, otherwise it will have unexpected result when get the status icon in view I_RARevenueScheduleItem

  cast(coalesce(RAPerfOblgnPostedRevnPerPerd.TotalPostgAmtInSlsDocCrcy*-1, 0) as farr_post_price) as PostedRevnInSlsDocCrcy,
  
  RAPerfOblgnPostpnPostPerPerd.PostpnDeltaRevnInSlsDocCrcy + RAPerfOblgnPostpnPostPerPerd.PostpnCatchupInSlsDocCrcy as PostponedRevnAmtInSlsDocCrcy,
  
  //Delta Recognized Cost

  cast(RAPerfOblgnTotalAmtPerPeriod.DeltaRecognizedCostPerPerd as farr_recog_cost) as RADeltaRecgdCostInSlsDocCrcy,
  //Delta Posted Cost. Must use coalesce( ) to convert null to 0, otherwise it will have unexpected result when get the status icon in view I_RARevenueScheduleItem

  cast(coalesce(RAPerfOblgnPostedRevnPerPerd.TotalPostgCostInSlsDocCrcy, 0) as farr_post_cost) as RAPostedCostInSlsDocCrcy,
  
  RAPerfOblgnPostpnPostPerPerd.PostpnDeltaCostInSlsDocCrcy as PostponedCostAmtInSlsDocCrcy,

/*======Cumulative Quantity==========================================*/      
  cast(RAEffectQtyPerPerd.PerfOblgnCumltvEffectiveQty as farr_cds_effective_quantity) as PerfOblgnEffectiveQuantity,
    

/*======Delta Quantity==========================================*/
  //Delta Invoiced Quantity

  //@Semantics.quantity.unitOfMeasure: 'PerfOblgnContractualQtyUnit'

  cast(RAInvcAndFulfilledQtyPerPerd.PerfOblgnDeltaInvoicedQuantity  as farr_cds_invoiced_quantity) as PerfOblgnDeltaInvoicedQuantity,
  
/*======DPC Fields==========================================*/  
  cast('' as farr_cds_rai_srcco) as RevnAcctgSenderComponent,
  cast('' as farr_operational_doc) as RevnAcctgOperationalDocument,
  cast('' as farr_item_id) as RAOperationalDocumentItem,
  cast(0 as farr_num_of_oprational_doc) as RANumberOfOperationalDocument,
  
/*======Additional Fields for Consumer==========================================*/  
//  RevAcctgAllocatedAmtPerPerd.TotalEffectiveAmtInSlsDocCrcy as TotalEffectiveAmtInSlsDocCrcy,

  RevAcctgAllocatedAmtPerPerd.TolRecognizedAmtPerPerd as UpToCurPeriodRecognizedRevenue,
  RevAcctgAllocatedAmtPerPerd.TolRecgdAmtCatchupPerPerd as TotRecgdCatchUpAmtInSlsDocCrcy
  
/*======Associated View=====================================*/  
//  RAPerformanceObligation._RevenueAccountingContract, 

//  RAPerformanceObligation._PerfOblgnStartDateType,

//  RAPerformanceObligation._PerfObligationEventType,

//  RAPerformanceObligation._FulfillmentType,

//  RAPerformanceObligation._PerfOblgnDistinctType,

//  RAPerformanceObligation._Currency,  

//  RAPerformanceObligation._PerfOblgnContractualQtyUnit,

//  RAPerformanceObligation._PerfOblgnEffectiveQtyUnit

}

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_RAPERFOBLGNWITHOUTACCTASSGMT",
"P_RAPERFOBLGNPOSTPNPOSTAMTPERD",
"P_RASCHEDALLOCATEDAMTPERPERD",
"P_RASCHEDCUMLTVEFFCTQTYPERPERD",
"P_RASCHEDDELTAINVCQTYPERPERD",
"P_RASCHEDPERFOBLGNAMTPERD",
"P_RASCHEDPERFOBLGNPOSTDAMTPERD"
],
"ASSOCIATED":
[
"I_RAPERFOBLGNWITHOUTACCTASSGMT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/