Show TOC

Person Responsible and Reference PeriodLocate this document in the navigation structure

Get information about how to use data points to display references to persons responsible and to reference periods on SAP Fiori UIs.

You can add the following properties to the UI annotation @UI.dataPoint:
  • referencePeriod
  • responsibleName
You can define both properties either in the UI annotation directly, or in another element and reference from the UI annotation to this element.
Example In the following example, the data point has a static reference period and a static person responsible. The value of the gross amount is formatted with the valueFormat property. The value is thus scaled with factor 1000 and is displayed with one decimal place, this is the value 34500 EUR would be displayed as 34.5 kEUR.
Figure 1: Example of visualization of person responsible, reference period, and value format
Sample Code
...
define view ZExample_SalesOrdersByCustomer as select from ... as so {  
  key so.buyer_guid as BuyerGuid,

  @Semantics.currencyCode: true
  so.currency_code as CurrencyCode, 
  
  @UI.dataPoint: {
    title: 'Gross Amount',
    description: 'Gross Amount per Customer',
    longDescription: 'The gross amount per customer ...',
    valueFormat: {
      scaleFactor: 1000,
      numberOfFractionalDigits: 1
    },
    referencePeriod: { description: '2015 Q3' },
    responsibleName: 'John Doe'
  }  
  @Semantics.amount.currencyCode: 'CurrencyCode'
  so.actual_amount as ActualAmount
}
Example In the following example, a dynamic reference period is used that is supplied by the following parameters:
  • start
  • end

These parameters have to be aliased in the element list before they can be used in the @UI.dataPoint annotation. The responsible property must refer to a to-one-association. The target entity of this association should contain the contact data of the person responsible.

Sample Code
...
define view ZExample_SalesOrdersByCust 
with parameters p_StartDate : abap.dats,
                p_EndDate   : abap.dats 
as select from ... as so 
association [0..1] to Employees as _PersonResponsible
  on _PersonResponsible.EmployeeId = $projection.PersonResponsible
{  
  ...

  $parameters.p_StartDate as StartDate,	-- Alias is required for annotation
  $parameters.p_EndDate as EndDate,		-- Alias is required for annotation
  so.person_responsible as PersonResponsible,

  @Semantics.currencyCode: true
  so.currency_code as CurrencyCode, 
  
  @UI.dataPoint: {
    title: 'Gross Amount',
    referencePeriod: {
      start: 'StartDate',				-- Reference to element
      end: 'EndDate'				-- Reference to element
    },
    responsible: '_PersonResponsible'		-- Reference to association
  }  
  @Semantics.amount.currencyCode: 'CurrencyCode'
  @DefaultAggregation: #SUM
  so.actual_amount as ActualAmount,

  _PersonResponsible
} 
where so.validity_date >= $parameters.p_StartDate 
and   so.validity_date <= $parameters.p_EndDate

For a definition of element list, see section Glossary linked below.