定义确定

ABAP RESTful 应用程序编程模型 › 开发 › 开发应用程序 › 开发托管事务应用 › 开发业务逻辑 › 开发确定 › 定义确定

确定在行为定义中定义。

如以下示例编码所示,将以下确定添加到行为定义中的相关实体。

展开以下代码示例以查看 /DMO/I_Travel_M 定义行为的源代码。

示例代码

define behavior for /DMO/I_Travel_M alias travel
implementation in class /DMO/BP_TRAVEL_M unique
...
{ ...
  internal action ReCalcTotalPrice;

  determination calculateTotalPrice on modify {create; field booking_fee, currency_code; }

}

define behavior for /DMO/I_Booking_M alias booking
implementation in class /DMO/BP_BOOKING_M unique
...
{...
  // determination for calculation of total flight price
  determination calculateTotalPrice on modify { create;  field flight_price, currency_code; }

}

define behavior for /DMO/I_BookSuppl_M alias booksuppl
implementation in class /DMO/BP_BOOKINGSUPPLEMENT_M unique
...
{...
  // determination for calculation of total suppl. price
  determination calculateTotalPrice on modify {create;  field price, currency_code; }

}

为所有三个实体定义的确定 calculateTotalPrice 处理一次差旅的总价计算。其中包括预订费、航班价格和预订补充价格。创建新实例或更新计算中包含的价格或更改货币时,确定将由 on modify 作为确定时间触发。换言之,所有确定的触发条件为 create,每个实体上相应的触发字段为。

来源:SAP Help Portal · 2025 FPS02 (Oct 2026) · 中文为 SAP 官方机器翻译

← 开发确定 · 实施确定 →