SAP CRM Fiori应用如何启用Sales Office和Sales Group两个字段

简介: SAP CRM Fiori应用如何启用Sales Office和Sales Group两个字段

User story

In CRM WebUI, the sales area of a given opportunity consists of the following fields in assignment block “Organizational Data”.

Note the “Sales Office” and “Sales Group” marked with red:


image.png


However in Fiori these two fields are not available.


image.png


The series of this blog will introduce how to bring these two standard fields into Fiori and provide CRUD operations on them.


As the first step, we need to expose the read operation of these two fields via odata service, which means when we test the odata service read operation, we expect to see both in response stream. Below is the screenshot of response before extension – both fields are missing there.


image.png


(1) When the data for Sales area tab in Fiori is read from backend, we make investigation and find out the data for both fields are already returned by one order API and available in the context of standard odata service implementation.



image.png


Since there is a MOVE-CORRESPONDING fields to move the opportunity data from one order API result to result structure of odata service, for the read operation, we just need to create two new fields in the structure of ls_entityset with exactly the same name, SALES_OFFICE and SALES_GROUP, then the MOVE-CORRESPONDING will take effect.


image.png


(2) The DDIC structure of Opportunity header is enhanced as below:


image.png


Add these two fields in service builder as well, re-generate runtime objects and clear model cache in both gateway and backend system to ensure the new fields could be visible in the runtime.


image.png


(3) retest the odata service read operation, the sales office and sales group are now available in the read response.


image.png


第二部分

In previous blog, the two fields Sales Office and Sales Group have already been exposed via OData service read operation. In this part I will make the two fields visible in Fiori UI. The final UI would look like below:


image.png


Step1: find the available extension point in UI to hold the two fields

There is existing extension point in opportunity detail view:


image.png


As the first step, our aim is just to display the two fields in Fiori UI without considering format requirement. So we just directly bind the two fields to SalesOfficeCode and SalesGroupCode exposed by blog part1.


image.png


This step is quite easy to do. The UI after this step looks like below. We can notice that for the other three standard fields, always the format + ( + + ) is displayed in UI.


image.png


The format is defined in xml view as below:

image.png

and the simple format function:image.png

In next step, we will enable the same format function for the two new fields.


Step2: create another two new fields SalesGroupText and SalesOfficeText to hold the description

The steps are also exactly the same as how we create the two fields SalesGroupCode and SalesOfficeCode in blog1: add the fields in DDIC structure and related Odata Model node:


image.png



After we have these two fields to store description, we can write the logic to get description by code.

All READ-related methods need to be enhanced with this logic.

a. redefine method OPPORTUNITIES_GET_ENTITYSET and paste the following source code:

image.png

b. create a new private method FILL_SALES_TEXT with the following signature:

image.png

source code:

image.pngimage.pngimage.png

Once this step is done, you could test your enhanced Odata service read operation and ensure you could see both code and description of SalesGroup and SalesOffice in response.


image.png


Step3: change the binding of extension fields

Just change the binding path from code to the converted value formatted by the formatter.

image.png

The complete UI code could be found in github:https://github.com/i042416/testOpportunityExtension/ with commit id: 7489bd487cc40fff1a9dd3b9d3683036961a1061

The complete backend source code could be found from attachment.


相关文章
|
23天前
|
人工智能 搜索推荐 Serverless
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
52 7
使用金庸的著作,来测试阿里通义千问最新开放的长文档处理功能
|
1月前
|
中间件
什么是 SAP CRM 系统里的 Initial Download
什么是 SAP CRM 系统里的 Initial Download
23 0
|
19天前
|
存储
使用 ABAP 代码打印出 SAP CRM 系统里所有维护了 Sales Area 的 business partner id
使用 ABAP 代码打印出 SAP CRM 系统里所有维护了 Sales Area 的 business partner id
19 0
|
23天前
|
数据库
SAP CRM产品主数据无法根据产品描述字段进行搜索的原因
SAP CRM产品主数据无法根据产品描述字段进行搜索的原因
16 5
|
23天前
|
Web App开发 开发者 存储
介绍一个 webp 格式转 png 格式的软件:XNConvert
介绍一个 webp 格式转 png 格式的软件:XNConvert
25 6
介绍一个 webp 格式转 png 格式的软件:XNConvert
|
23天前
什么是 SAP ABAP 里的 Subscreen
什么是 SAP ABAP 里的 Subscreen
16 1
什么是 SAP ABAP 里的 Subscreen
|
1月前
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
15 0
|
1月前
|
UED
什么是 SAP Fiori 的 Technical Catalog 和 Business Catalog
什么是 SAP Fiori 的 Technical Catalog 和 Business Catalog
36 0
|
1月前
|
前端开发 UED
SAP Fiori 到底指什么
SAP Fiori 到底指什么
38 0
|
1月前
|
中间件
什么是 SAP CRM Initial Download
什么是 SAP CRM Initial Download
20 0