P_ARPromisesToPayOvw

DDL: P_ARPROMISESTOPAYOVW SQL: PARPROM2PAYOVW Type: view COMPOSITE

P_ARPromisesToPayOvw is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (P_PromiseToPay0, P_DaysSalesOutstandingCalMonth) and exposes 16 fields with key field case_guid.

Data Sources (2)

SourceAliasJoin Type
P_PromiseToPay0 _prom inner
P_DaysSalesOutstandingCalMonth CM from

Parameters (4)

NameTypeDefault
P_StartDate sydate
P_KeyDate sydate
P_DisplayCurrency vdm_v_display_currency
P_ExchangeRateType kurst_curr

Annotations (4)

NameValueLevelField
AbapCatalog.sqlViewName PARPROM2PAYOVW view
VDM.viewType #COMPOSITE view
VDM.private true view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (16)

KeyFieldSource TableSource FieldDescription
KEY case_guid case_guid
CompanyCode CompanyCode
Customer Customer
DisplayCurrency
DaysSinceCreation
trueasPromisedAmountInDspCrcy
trueasPaidAmountInDspCrcy
SourceCurrency SourceCurrency
Status Status
DueDate DueDate
CreationDate CreationDate
CalendarYear CalendarYear
CalendarMonth CalendarMonth
YearMonth YearMonth
FirstDayOfMonth FirstDayOfMonth
LastDayOfMonth LastDayOfMonth
@AbapCatalog.sqlViewName: 'PARPROM2PAYOVW'
@VDM.viewType: #COMPOSITE
@VDM.private:true
@AccessControl.authorizationCheck: #NOT_REQUIRED

define view P_ARPromisesToPayOvw
  with parameters
    P_StartDate        : sydate,
    P_KeyDate          : sydate,
    P_DisplayCurrency  : vdm_v_display_currency,
    P_ExchangeRateType : kurst_curr
  as select from P_DaysSalesOutstandingCalMonth as CM
    inner join   P_PromiseToPay0                as _prom on case_guid is null
                                                         or case_guid is not null
{
  key case_guid,
      CompanyCode,
      Customer,
      :P_DisplayCurrency                         as DisplayCurrency,

      DATS_DAYS_BETWEEN(CreationDate,:P_KeyDate) as DaysSinceCreation,
      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      currency_conversion(
           amount => PromisedAmount,
           source_currency => SourceCurrency,
           target_currency => :P_DisplayCurrency,
           exchange_rate_date => :P_KeyDate,
           exchange_rate_type => :P_ExchangeRateType,
           error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR,
           round => #CDSBoolean.true,
           decimal_shift => #CDSBoolean.true,
           decimal_shift_back => #CDSBoolean.true
       )                                         as PromisedAmountInDspCrcy,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      currency_conversion(
           amount => PaidAmount,
           source_currency => SourceCurrency,
           target_currency => :P_DisplayCurrency,
           exchange_rate_date => :P_KeyDate,
           exchange_rate_type => :P_ExchangeRateType,
           error_handling => #CNV_ERROR_HANDLING.FAIL_ON_ERROR,
           round => #CDSBoolean.true,
           decimal_shift => #CDSBoolean.true,
           decimal_shift_back => #CDSBoolean.true
       )                                         as PaidAmountInDspCrcy,
      SourceCurrency,
      Status,
      DueDate,
      CreationDate,
      CalendarYear,
      CalendarMonth,
      YearMonth,
      FirstDayOfMonth,
      LastDayOfMonth
}
where
      DueDate >= :P_StartDate
  and DueDate <= :P_KeyDate
  and DueDate <= LastDayOfMonth
  and DueDate >= FirstDayOfMonth
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_DAYSSALESOUTSTANDINGCALMONTH",
"P_PROMISETOPAY0"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/