预测草稿业务对象行为

ABAP RESTful 应用程序编程模型 › 开发 › 开发 API › 预测草稿业务对象行为

对于具有草稿的托管场景,创建接口行为定义以公开要通过 API 提供的行为。

上下文和过程

为差旅业务对象创建接口行为定义。在 ADT 中,使用根接口映射视图的上下文菜单打开用于创建行为定义的向导。实施类型预填充为 Projection。

接口行为定义 /DMO/I_Travel_D

使用在接口投影的基础行为定义中定义的完整行为。(模板不包括所有内容,某些功能必须手动添加。)

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

示例代码

interface;
use draft;
define behavior for /DMO/I_Travel_D alias Travel
use etag
{
  use create;
  use update;
  use delete;

  use action acceptTravel;
  use action rejectTravel;
  use action deductDiscount;
  use function GetDefaultsFordeductDiscount;

  use action validateAgencyID;
  use action validateCustomerID;
  use action validateDateRange;
  use action validateBookingCharge;

  use action Edit;
  use action Activate;
  use action Discard;
  use action Prepare;
  use action Resume;

  use association _Booking { create; with draft; }

}

define behavior for /DMO/I_Booking_D alias Booking
use etag
{

  use update;
  use delete;

  use action validateFlightCosts;

  use association _BookingSupplement { create; with draft; }
  use association _Travel { with draft; }
}

define behavior for /DMO/I_BookingSupplement_D alias BookingSupplement
use etag
{
  use update;
  use delete;

  use action validateSupplementPrice;

  use association _Travel { with draft; }
  use association _Booking { with draft; }
}

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

← 投影草稿业务对象数据模型 · 开发 UI 特定 →