sap-fiori-app-development
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSAP Fiori App Development Guidelines (CAP & Standalone Projects)
SAP Fiori应用开发指南(CAP与独立项目)
General Guidelines (Applicable to CAP and Standalone Fiori Projects)
通用指南(适用于CAP和独立Fiori项目)
- Always ask the user whether they want to create a Fiori app for CAP (Cloud Application Programming) or a standalone Fiori project connected to an external OData service before proceeding with implementation, unless the technology stack is explicitly specified in the user's request.
- Use the Fiori MCP tools to create the Fiori UI using SAP Fiori Elements.
- After the Fiori MCP Server tools execute successfully, inform the user of completion. Do not verify or double-check - treat successful tool execution as confirmation.
- The data model should be suitable for SAP Fiori elements: at minimum one entity type that serves as the main entity for the application. Navigation properties to related entities are optional but enable richer UI patterns.
- Each property of an entity must have a proper datatype.
- Before modifying the code directly - first check whether Fiori MCP server provides a suitable function or tool, or if a specialized skill exists (e.g.).
sap-fiori-analytical-chart
- 在开始实施之前,务必询问用户是要为CAP(Cloud Application Programming,云应用编程)创建Fiori应用,还是创建连接到外部OData服务的独立Fiori项目,除非用户的请求中明确指定了技术栈。
- 使用Fiori MCP工具,基于SAP Fiori Elements创建Fiori UI。
- Fiori MCP Server工具执行成功后,告知用户已完成。无需验证或复核——将工具执行成功视为完成确认。
- 数据模型需适配SAP Fiori Elements:至少包含一个作为应用主实体的实体类型。关联实体的导航属性为可选,但可实现更丰富的UI模式。
- 实体的每个属性必须具备合适的数据类型。
- 在直接修改代码之前——首先检查Fiori MCP server是否提供合适的功能或工具,或者是否存在专用技能(例如)。
sap-fiori-analytical-chart
Available Application Templates (Both CAP and Standalone Projects)
可用应用模板(CAP与独立项目通用)
The Fiori MCP can create the following application templates for both CAP and standalone project backends:
- FE_LROP - List Report Object Page (most common, OData V2/V4)
- FE_ALP - Analytical List Page (OData V2/V4)
- FE_OVP - Overview Page (OData V2/V4)
- FE_WORKLIST - Worklist (OData V2/V4)
- FE_FEOP - Form Entry Object Page (OData V4 only)
- FE_FPM - Flexible Programming Model / Custom Page (OData V4 only)
- FF_SIMPLE - Basic SAPUI5 Freestyle template (can work without a data source)
Fiori MCP可为CAP和独立项目后端创建以下应用模板:
- FE_LROP - 列表报告对象页面(最常用,OData V2/V4)
- FE_ALP - 分析列表页面(OData V2/V4)
- FE_OVP - 概览页面(OData V2/V4)
- FE_WORKLIST - 工作列表(OData V2/V4)
- FE_FEOP - 表单录入对象页面(仅支持OData V4)
- FE_FPM - 灵活编程模型/自定义页面(仅支持OData V4)
- FF_SIMPLE - 基础SAPUI5自由风格模板(可在无数据源情况下运行)
Available Page Types
可用页面类型
The Fiori MCP can add the following page types to existing applications:
- ListReport - Table view with filtering and search
- ObjectPage - Detail page for viewing/editing records
- CustomPage - Fully custom page with your own views
Fiori MCP可为现有应用添加以下页面类型:
- ListReport - 带筛选和搜索功能的表格视图
- ObjectPage - 用于查看/编辑记录的详情页面
- CustomPage - 可自定义视图的完全自定义页面
Application Structure
应用结构
- When asked to create a SAP Fiori elements app, check whether the user input can be interpreted as an application organized into one or more pages containing table data or forms.
- Applications typically start with a List Report page showing data in a table, but other templates are available (see above).
- Details of a specific table row are shown in an Object Page based on the base entity.
- An Object Page can contain sections based on navigation properties (both to-one (0..1) and to-many associations) of its entity type.
- Details of a table section row (for to-many associations) can be shown in another Object Page based on the association's target entity.
- 当被要求创建SAP Fiori Elements应用时,检查用户输入是否可解读为包含一个或多个表格数据或表单页面的应用。
- 应用通常以显示表格数据的List Report页面起步,但也可使用上述其他模板。
- 特定表格行的详情将基于基础实体在Object Page中展示。
- Object Page可包含基于其实体类型导航属性(一对一(0..1)和一对多关联)的章节。
- 表格章节行(针对一对多关联)的详情可基于关联目标实体在另一个Object Page中展示。
Application Preview Guidelines
应用预览指南
- Use the most specific script for the app in .
package.json - For CAP: Use watch scripts (e.g., )
npm run watch-manage-travel - For standalone Fiori projects: Use (live backend) or
npm start(mock data)npm run start-mock
- 使用中最适合该应用的脚本。
package.json - 对于CAP:使用watch脚本(例如)
npm run watch-manage-travel - 对于独立Fiori项目:使用(实时后端)或
npm start(模拟数据)npm run start-mock
CAP-Specific Guidelines
CAP专属指南
- The fiori app must be created in the folder under the CAP application root folder created before with
appoperation. This root folder is always a subfolder directly under working directory.cds init - When creating UI applications following a CAP application summary, make sure to use UI application names as described in the project structure of the summary, unless user explicitly requested otherwise.
- On any follow-up request to change or modify the UI of the full stack CAP application, always try first to make the change in the fiori app unless really required in service.
- Provide primary keys of type UUID for all entities.
- When creating sample data in CSV files, all primary keys and foreign keys MUST be in UUID format (e.g., ).
550e8400-e29b-41d4-a716-446655440001
- Fiori应用必须创建在之前通过操作创建的CAP应用根目录下的
cds init文件夹中。该根目录始终是工作目录下的直接子文件夹。app - 在根据CAP应用概要创建UI应用时,务必使用概要项目结构中描述的UI应用名称,除非用户明确要求其他名称。
- 在对全栈CAP应用的UI进行后续修改请求时,除非确实需要在服务端修改,否则应优先尝试在Fiori应用中进行更改。
- 为所有实体提供UUID类型的主键。
- 在CSV文件中创建示例数据时,所有主键和外键必须采用UUID格式(例如)。
550e8400-e29b-41d4-a716-446655440001
Standalone Fiori Project Guidelines
独立Fiori项目指南
- For standalone Fiori projects based on external services, the application is created at the root level by Fiori MCP tools.
- Destination or SAP System Name: If the user doesn't provide a destination name or SAP system name, use the Fiori MCP Server to retrieve and present available destinations/systems for user selection.
- Fetching OData Service Metadata: Refer to the tools instructions for downloading odata service metatdata. If Service Center MCP is available use that, otherwise use the Fiori MCP Server to download the metadata file.
- Annotations should primarily be maintained in the backend service, and only app-specific UI customizations or overrides should be placed in local (frontend) annotations.
- Use frontend annotations only for app-specific UI tweaks (e.g., ) referenced in
/webapp/annotations/annotation.xmlwith matchingmanifest.jsonandurivalues:localUrijson"annotation": { "type": "ODataAnnotation", "uri": "annotations/annotation.xml", "settings": { "localUri": "annotations/annotation.xml" } } - Standalone Fiori projects connect to remote OData V2 or V4 services (defined in dataSources).
manifest.json - OData Service Metadata is Read-Only: The service metadata file () referenced in
/webapp/localService/mainService/metadata.xmlmust not be edited locally. Any changes to entity definitions, properties, or service structure must be made at the backend source:manifest.jsonjson"dataSources": { "mainService": { "uri": "/path/to/odata/service/", "type": "OData", "settings": { "annotations": ["annotation"], "localUri": "localService/mainService/metadata.xml", "odataVersion": "4.0" } } }
- 基于外部服务的独立Fiori项目,应用由Fiori MCP工具在根目录创建。
- 目标或SAP系统名称:如果用户未提供目标名称或SAP系统名称,使用Fiori MCP Server检索并展示可用的目标/系统供用户选择。
- 获取OData服务元数据:参考工具说明下载OData服务元数据。如果Service Center MCP可用则使用该工具,否则使用Fiori MCP Server下载元数据文件。
- 注释应主要在后端服务中维护,仅应用特定的UI自定义或覆盖内容应放在本地(前端)注释中。
- 仅将前端注释用于应用特定的UI调整(例如),并在
/webapp/annotations/annotation.xml中用匹配的manifest.json和uri值引用:localUrijson"annotation": { "type": "ODataAnnotation", "uri": "annotations/annotation.xml", "settings": { "localUri": "annotations/annotation.xml" } } - 独立Fiori项目连接到远程OData V2或V4服务(在的dataSources中定义)。
manifest.json - OData服务元数据为只读:中引用的服务元数据文件(
manifest.json)不得在本地编辑。对实体定义、属性或服务结构的任何更改必须在后端源进行:/webapp/localService/mainService/metadata.xmljson"dataSources": { "mainService": { "uri": "/path/to/odata/service/", "type": "OData", "settings": { "annotations": ["annotation"], "localUri": "localService/mainService/metadata.xml", "odataVersion": "4.0" } } }