Fiori 动态磁贴示例

1. 动态磁贴配置页面

2. 服务URL

2.1 服务URL示例(ODATA GetEntity (Read)方法)

 /sap/opu/odata/sap/ZODATA/GetEntity(par='XXX')
/sap/opu/odata/sap/YTEST_ODATA_SRV/DynamictileSet(type='1')

2.2 服务URL接口参数参考

{
                “d”: {
“icon”: “sap-icon://travel-expense”,
“info”: “Quarter Ends!”,
“infoState”: “Critical”,
“number”: 43.333,
“numberDigits”: 1
                               “numberFactor”: “k”,
“numberState”: “Positive”,
“numberUnit”: “EUR”,
“stateArrow”: “Up”,
“subtitle”: “Quarterly overview”,
“title”: “Travel Expenses”,
                     }
}

Parameter

Description

icon

Enter an sap-icon:// URL, for example sap-icon://cart.

You can look up the names of the available icons in tile configuration.

For more information, see Static App Launcher Tiles.

info

Text to be displayed at the bottom of the tile.

infoState

The color of the tile is adapted according to the value of this property. The precise color depends on the theme that you have selected in UI theme designer.

Allowed values: Negative, Neutral, Positive, Critical

number

Number to be displayed in the top right corner of the tile.

numberDigits

Number of digits to be displayed following the decimal separator (decimal point or decimal comma, depending on the language settings).

numberFactor

A factor for scaling numbers, for example, for displaying large numbers like 1.000.000 (-> number = 1 and numberFactor=”M”) or for percentages (number = 22.2 and numberFactor = “%”). The scaling is not done by the front end but has to be provided by the app developer.

numberState

The color of the number is adapted according to the value of this property. The precise color depends on the theme that you have selected in UI theme designer.

Allowed values: Negative, Neutral, Positive, Critical

numberUnit

Unit to be displayed below the number, for example, USD.

stateArrow

Displays an arrow indicating a trend.

Allowed values: None, Up, Down

subtitle

Subtitle to be displayed below the tile title.

targetParams

List of key-value-pairs separated by ampersands.

When the application is lauched (by clicking on it), these parameters are passed to the application as business parameters (if semantic object-based navigation is used) or as URL parameters (if URL-based navigation is used).

If any parameters have been entered in the Parametersfield in the tile configuration, the parameters passed by the OData service are appended to the list of parameters to be passed to the application.

title

Title to be displayed in the tile.

type	1	Edm.String
icon	0	Edm.String
info	0	Edm.String
infoState	0	Edm.String
number	0	Edm.String
numberDigits	0	Edm.String
numberFactor	0	Edm.String
numberState	0	Edm.String
numberUnit	0	Edm.String
stateArrow	0	Edm.String
subtitle	0	Edm.String
targetParams	0	Edm.String
title	0	Edm.String

2.3 服务URL接口代码示例

  METHOD xxx_get_entity.

    DATA: ls_entity_data TYPE xxxxxxodata_mpc=>ts_xxxxxx.
    DATA: ls_key     TYPE /iwbep/s_mgw_name_value_pair.

    TRY.
        ls_entity_data-icon         = 'sap-icon://Fiori2/F0003'.
        ls_entity_data-info         = 'Demo Info'.
        ls_entity_data-infostate    = 'Positive'."Negative, Neutral, Positive, Critical
        ls_entity_data-number       = 200.
        ls_entity_data-numberdigits = 0.
        ls_entity_data-numberfactor = ''.
        ls_entity_data-numberstate  = ''.
        ls_entity_data-numberunit   = 'USD'.
        ls_entity_data-statearrow   = 'Up'."None, Up, Down
        ls_entity_data-subtitle     = 'Sub title'.
        ls_entity_data-targetparams = ''.
        ls_entity_data-title        = 'Title'.

      CATCH /iwbep/cx_mgw_busi_exception .
      CATCH /iwbep/cx_mgw_tech_exception .
    ENDTRY.

    er_entity = ls_entity_data.

  ENDMETHOD.

3. 效果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值