Adding Field in Standard Fiori Apps

Download as pdf or txt
Download as pdf or txt
You are on page 1of 68

Mickael QUESNOT © https://s4hclub.

com/

ADDING FIELD IN STANDARD FIORI APPS OF @SAP S/4HANA


WITH CUSTOM FIELDS AND LOGIC
1.1. PURPOSE OF THIS GUIDE

This guide is about how to add a field in standard Fiori apps and other objects by using “Custom
Fields” menu in Key User Extensibility Tools “Custom Fields and Logic”. It also intends to explain
how internal objects are enhanced internally when adding a field with Custom Fields and Logic,
e.g. how a field is added to a table. The tool is not only for new fields, but it can add the fields
already in the source table to objects like standard Fiori apps.

Custom Fields and Logic has 3 functions, Custom Fields, Data Source Extensions and Custom
Logic, but this blog focuses only on Custom Fields.

Highlight of this guide:

• Introduction of Extensibility Registry to find the target object.


• Explain how a field is added in the relevant objects (table, CDS view, etc..) internally.

1.2. WHY IS THE TOOL “CUSTOM FIELDS” VERY IMPORTANT?

This tool is so important for S/4HANA implementation as it is typical requirement to add fields to
standard apps and objects, and this tool help reducing the efforts to add fields drastically by automate
the tasks needed to add fields.
In ECC, for adding a field in a screen, firstly it has to be added in the source table using append structure
with the transaction SE11, and secondary, they also have to be added in the Dynpro screen with the
transaction SE51, and finally, the ABAP logics have to be added to send/receive the values of the added
fields between screen and the tables using User/Customer Exit (Transaction SMOD/CMOD) or BADI
(Transaction SE18/19).

However, thanks to “Custom Fields”, those tasks are automated! It takes only about several minutes to
add fields to the apps and objects. In other words, when fields have to be added in S/4HANA
implementation, it is expected to review if this tool could be used. It is also the case even when the
screen is SAPGUI Dynpro. It is against best practice to ignore this tool and add the fields manually as it
had done in ECC. Therefore, more than technical or Fiori experts, functional experts are expected to
understand this tool. Don’t worry, it is not difficult. You can enjoy reducing the efforts with this magic!

In addition, this tool should contribute to making more standard Fiori apps available by adding the
important custom fields in the standard Fiori apps. One of the main reasons why a standard Fiori apps
cannot be used by business users is important custom Fields for them are missed in the standard Fiori
apps. Thanks to Custom Fields, it could be overcome!

1.3. BACKGROUND INFO: S/4HANA EXTENSIBILITY AND KEY USER EXTENSIBILITY TOOLS

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 1 de 68
Mickael QUESNOT © https://s4hclub.com/

Key User Extensibility tools are the tools to create or enhance the objects without custom coding, and
Custom Fields and Logic (CFL) is one of the main tools in Key User Extensibility Tools. Custom Field is a
menu in this tool.

In S/4HANA context, S/4HANA Extensibility means creation and enhancement of the apps and objects
(note: it does not mean only enhancement). It consists of In-App Extensibility and Side-by-Side
Extensibility. In-App Extensibility means creation of the object IN S/4HANA and Side-by-Side Extensibility
means development or enhancement OUTSIDE OF S/4HANA, mainly with SAP Cloud Platform. In-App
Extensibility consists of Key User Extensibility and Classic Extensibility. Classic Extensibility means
traditional custom development like custom program and Function Module. In S/4HANA, the way to
create custom object with tools are provided in addition to classical ways, which is called Key User
Extensibility tools. In S/4HANA Cloud (SaaS), Classic Extensibility is not available and Key User
Extensibility is the only way for In-App Extensibility.

Please note that Key User tools are not only the tools for extensibility, but there are some other tools in
S/4HANA like “Manage Date Function”, I personally want to call it Key User tools. There are some other
“In-App tools”. See the blog regarding “In-App tools” for analytics. In addition, conceptually,
enhancement of S/4HANA using other SAP or third party tools can be included in Side-by-Side
Extensibility, e.g. create analytical apps with SAP BusinessObjects or Microsoft Power BI.

1.4. TECHNICAL OVERVIEW

1.4.1.Custom Fields in CFL

You can use Custom Fields and Logic by assigning the role in which technical catalog SAP_BASIS_TCR_T
is included.

Custom Fields and Logic has 3 menus (Functions),


Custom Field: Create custom fields to the table and add it to applications and objects, or add fields
already been in the source table to applications and objects.
Data Source Extension: Add fields to a data source from the source view or the CDS View already
associated to the source.
Custom Logic: Add logics to fill/display the value of the custom fields.
See SAP Help in detail.
Focus of this blog is on Custom Fields.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 2 de 68
Mickael QUESNOT © https://s4hclub.com/

1.4.2.Business Context and the target objects

In Custom Fields in CFL, a field is added to “Business Context”. “Business Context” is a business object
in S/4HANA like Material, Business Partner, Product or Billing Document, Journal Entry Item. After that,
the fields in the Business Context is added to Fiori apps which uses this business context, e.g. a field is
created in the Business Context PRODUCT can be added to Manage Product Master Data (F1602).

There are 2 ways to find the Business Context and the target objects: 1) Extensibility Registry and 2)
Detail of each Business Context in Custom Field in CFL (Transaction SCFD_EUI). See the blog in detail.

1.4.2.1. Extensibility Registry

You can find which Business Contexts are in S/4HANA and which objects can be enhanced in Extensibility
Registry (Transaction SCFD_REGISTRY). If you want to add a field to business object or apps in S/4HANA,
it is expected to check if it is possible with CFL in Extensibility Registry before adding it manually. In other
word, if the objects you want to add a field are not in Extensibility Registry, there are no other ways but
to add it manually. In case something is not available here, a customer can request it
via https://www.sap.com/about/customer-involvement/influence-adopt.html.

Business Context tab:

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 3 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 4 de 68
Mickael QUESNOT © https://s4hclub.com/

Click a entry (SD_SALESDOCITEM) and the detail info is displayed.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 5 de 68
Mickael QUESNOT © https://s4hclub.com/

Relevant for structural enhancement: The business context is relevant for field extensibility.
Relevant for logic enhancement: The business context is relevant for BADI registration
Persistence Include: This “ddic include” is a part of the database tables that are extended by the Custom
Field. It must also be used in the structures that transport the field contents in the ABAP. The
“persistence include” is extended by an append, when a new custom field is published.

Transient include: This include is part of the binding structure of an OData service. It contains additional
fields (e.g. for descriptions and field control) that are not persisted.

Change indicator include: This include is extended when the application uses change flags to indicate
that field content should be transferred (e.g. in a BAPI).

Field Suffix: To prevent name conflict, the custom fields get business context dependent name suffixes.

Quota definition: Here the application defines how many fields with how many bytes a customer may
define in this business context.

Relationships between the Business Context and the source tables might be explained in some SAP
Notes like SAP Note 2590603. This Note is about the relationship between MARC and PRODUCT_PLANT.
Or, you could find it with the SELECT statement like below.

SELECT a.business_context, a.persistence_include, b.tabname


FROM cfd_w_bus_ctxt AS a
JOIN dd03l AS b
ON a.persistence_include = b.precfield
JOIN dd02l as c
ON b.tabname = c.tabname
WHERE b.precfield LIKE '%_EEW_%'
AND c.tabclass = 'TRANSP'

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 6 de 68
Mickael QUESNOT © https://s4hclub.com/

AND c.APPLCLASS <> ''


ORDER BY 1, 2, 3

(This SELECT Statement was proposed by an expert (Daniel) who advised in the comment.

You can run the SELECT statement with transaction DBACOCKPIT > Diagnostics > SQL Editor.
Extensible CDS View tab:

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 7 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 8 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 9 de 68
Mickael QUESNOT © https://s4hclub.com/

Detail of A_SALESORDERITEM

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 10 de 68
Mickael QUESNOT © https://s4hclub.com/

Extensible OData Model tab:

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 11 de 68
Mickael QUESNOT © https://s4hclub.com/

API_SALES_ORDER_MDL 0001

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 12 de 68
Mickael QUESNOT © https://s4hclub.com/

Support of Custom Fields tab:


Impl. Type: The implementation type shows how the OData service is implemented ( RDS: Referenced
Data Source, SADL: Mapped via SADL, ‘ ‘: Manual implementation ).
Basic Search support: Shows if the OData service supports basic search for custom fields.
Filtering supported: Shows if the OData service supports filtering for custom fields.
CDS View Name: Must be filled for SADL and RDS implemented OData services. If you extend the OData
service then the CDS view is extended automatically.

Function Module (BAPI) tab:


The FM for the business context :

BAPI_SALESORDER_CHANGE Change Sales Order X SD_SALESDOC,


SD_SALESDOCITEM

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 13 de 68
Mickael QUESNOT © https://s4hclub.com/

Some of the BAPIs are used as the source of Migration Object in Migration Cockpit. Below are the BAPIs
used in Migration Object on S/4HANA1909.

Migration Template Function Module Wrapper Function Module


SIF_SALES_ORDER BAPI_SALESORDER_CREATEFROMDAT2
SIF_MAT_CONSUMP BAPI_MATERIAL_SAVEREPLICA

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 14 de 68
Mickael QUESNOT © https://s4hclub.com/

SIF_GL_BALANCES BAPI_ACC_DOCUMENT_CHECK DMC_MIG_ACC_DOCUMENT_POST

BAPI_ACC_DOCUMENT_POST
SIF_SD_CONTRACT BAPI_CONTRACT_CREATEFROMDATA

Other than above, the following target objects can be checked in Extensibility Registry.
BADI tab: The listed BADIs are used in Custom Logic.
Data Transfer tab: Data transfers define the transport of the content of a custom field from a source
business context to a target business context. The application has to call method
cl_cfd_data_transfer_factory=>get_data_transfer_runtime( )->transfer_data in addition to the
registration. (the sample source is in Extensibility Registry)
Business Scenario tab: A business scenario is a collection of data transfers. Every involved business
context must be connected to the other business contexts via a data transfer. No gaps are allowed.
SAP GUI Context
SOAP Service
IDoc
Association Target

The relationship of the tabs between Extensibility Registry and “Custom Field” tool is Not 1:1.

BADI is not in “Custom Fields” (but in “Custom Logic”), and Association Target is the selection list of the
association to business object when selecting “association to business object”.

1.4.2.2. 2. Detail of each Business Context in Custom Field of CFL

The target objects for a Business Context can be checked in each tab of “Custom Fields”.

Target objects for Business Context ”Sales: Sales Document”:


UIs and Reports tab:
In UIs and Reports tab, Data Source includes
• CDS View (starting with C_ or I_ ) ,
• OData created with transaction SEGW (ending with _SRV in normal),
• Description of the OData, which is the Entity Types included in the OData, not the description
of the OData itself.
• SAPGUI screen

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 15 de 68
Mickael QUESNOT © https://s4hclub.com/

Email Templates:
Email Templates are only implicitly listed in the Extensibility Registry. Only the CDS Views on which the
Templates are based on, can be found.

Form Templates:
Form are only implicitly listed in the Extensibility Registry. Only they CDS Views on which the Templates
are based on, can be found

Business Scenarios:

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 16 de 68
Mickael QUESNOT © https://s4hclub.com/

OData API:

SOAP API:

BAPI:

1.5. PREPARATION FOR CUSTOM FIELDS AND LOGIC

For using Key User tools including CFL, it is necessary to activate Key User Extensibility. See the SAP
Note 2283716 and 2807979 (for on-Premise).

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 17 de 68
Mickael QUESNOT © https://s4hclub.com/

Next, create the role in which the Fiori Catalog “SAP_BASIS_BC_EXT” is included in the menu with the
transaction PFCG (in S/4HANA on-Premise). In this catalog, some Key User tools like Custom Fields and
Logic are included.

Make the statuses of all authorization objects green in the authorization profile generated in
Authorizations tab, and assign the role to your user.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 18 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 19 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 20 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 21 de 68
Mickael QUESNOT © https://s4hclub.com/

After Logging in Fiori launchpad, you can find the catalog “Extensibility” is added. In the menu “App
Finder”, add CFL in “Extensibility” catalog to “My Home”.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 22 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 23 de 68
Mickael QUESNOT © https://s4hclub.com/

Now you can launch this tool from Fiori launchpad “My home” group.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 24 de 68
Mickael QUESNOT © https://s4hclub.com/

1.6. ADD A FIELD TO BUSINESS CONTEXT AND APPS


1.6.1.Add a field to a Business Context
1.6.1.1. Steps to add a field to a Business Context
Launching CFL in Fiori launchpad.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 25 de 68
Mickael QUESNOT © https://s4hclub.com/

Select a Business Context and enter the info for the field to be added.

Push “Create” icon in top-right.

In the following case, enter as below and push “Create and Edit” in bottom-right.

Business Context: Master Data: Sales Document Item

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 26 de 68
Mickael QUESNOT © https://s4hclub.com/

Label: Augmentation

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 27 de 68
Mickael QUESNOT © https://s4hclub.com/

Identifier: ZZ1_Augmentation

Tooltip: Augmentation

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 28 de 68
Mickael QUESNOT © https://s4hclub.com/

Type: Association with code List

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 29 de 68
Mickael QUESNOT © https://s4hclub.com/

Length : 3

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 30 de 68
Mickael QUESNOT © https://s4hclub.com/

List Values

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 31 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 32 de 68
Mickael QUESNOT © https://s4hclub.com/

When selection Code list, Code list can be created, and internally the CDS View for the value help is
generated and associated to the field.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 33 de 68
Mickael QUESNOT © https://s4hclub.com/

General Information tab

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 34 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 35 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 36 de 68
Mickael QUESNOT © https://s4hclub.com/

BAPIs tab (the BAPI is enabled when the field is added).

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 37 de 68
Mickael QUESNOT © https://s4hclub.com/

• In the screen above, the column Data Source is added with the personalization button (top-
right).

Push “Publish” in the bottom-right of the screen.

Status is changed to “Publishing”.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 38 de 68
Mickael QUESNOT © https://s4hclub.com/

Several minutes later, it is changed to “Published”.

Internally, the field is added to the source table(s) with persistent structure.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 39 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 40 de 68
Mickael QUESNOT © https://s4hclub.com/

(if the table of the selected business context is Compatibility View, e, the field is added to relevant CDS
Views used as the Compatibility View with Extend View, e.g. business context product plant and
Compatibility View MARC).

Fields to be added to the table:

The fields can be added in the table of the initial screen of CFL with Personalization button (top-right).

Associated Business Objects, Origin (whether created with CFL or already in the table), Created By,
Created On, Changed On and Original Language are added below.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 41 de 68
Mickael QUESNOT © https://s4hclub.com/

Custom Fields and Logic can be launched from Runtime Adaptation of the corresponding UI. This way
the correct Business Context and Target Object are already pre-selected.

1.6.1.2. How is a field added technically?

In the table VBAP, the field is added via the persistent structure of this business context
SDSALESDOCITEM_INCL_EEW_PS.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 42 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 43 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 44 de 68
Mickael QUESNOT © https://s4hclub.com/

Function Module: The field ZZ1_AUGMENTATION is added in the following Function Modules

BAPI_CUSTOMERCONTRACT_CHANGE

BAPI_CUSTOMERINQUIRY_CHANGE

BAPI_SALESORDER_CHANGE

BAPI_CUSTOMERQUOTATION_CHANGE

BAPI_CONTRACT_CREATEFROMDATA

BAPI_INQUIRY_CREATEFROMDATA2

BAPI_SALESORDER_CREATEFROMDAT2

BAPI_QUOTATION_CREATEFROMDATA2

How is the field added to the BAPIs:

BAPI_SALESORDER_CHANGE

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 45 de 68
Mickael QUESNOT © https://s4hclub.com/

BAPE_SDSALESDOCITEM is BAPI Ext structure for EXTENSIONIN in the FM

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 46 de 68
Mickael QUESNOT © https://s4hclub.com/

BAPI_SALESORDER_CHANGE. SDSALESDOCITEM_INCL_EEW_PS is the persistent structure for the


business context SD_SALESDOCITEM (Sales Document). This structure has the field
ZZ1_AUGMENTATION is added.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 47 de 68
Mickael QUESNOT © https://s4hclub.com/

Extensibility Registry (Transaction SCFD_REGISTRY)

Open FM BAPI_SALESORDER_CHANGE and double click BAPI Ext structure BAPE_SDSALESDOCITEM.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 48 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 49 de 68
Mickael QUESNOT © https://s4hclub.com/

Double click the structure SDSALESDOCITEM_INCL_EEW_PS.

The field ZZ1_AUGMENTATION is there.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 50 de 68
Mickael QUESNOT © https://s4hclub.com/

See the SAP help to understand how to use EXTENSIONIN to enhance BAPI.
EXTENSIONIN in FM BAPI_SALESORDER_CHANGE.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 51 de 68
Mickael QUESNOT © https://s4hclub.com/

Click Associated Type BAPIPAREX.

BAPIAREX

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 52 de 68
Mickael QUESNOT © https://s4hclub.com/

When you use the BAPIPAREX structure, the field values have to be converted to a special format via
the methods of class CL_CFD_BAPI_MAPPING, e.g. the case for Condition Contract.

1.6.1.3. How to add the field to the FMs which are not in the Extensibility Registry
It depends on the FM how to add the field to the FMs which is not in the Extensibility Registry.

Examples:
• Field added in MARA to BAPI_MATERIAL_SAVEDATA
Add the field to BAPI_TE_MARA and BAPI_TE_MARAX and use it in Extensionin of
BAPI_MATERIAL_SAVEDATA.

• Field added in PO tables (EKKO/EKPO, etc) to BAPI_PO_CREATE1.


It is possible to map the new fields in principle in the BAPI using the BAdI ME_BAPI_PO_CUST->
EXTENSIONIN.

MEPOHEADER and MEPOITEM are in the signature of that method so it is possible to map the fields.

1.6.2.Add a field to apps

1.6.2.1. Steps to add a field to the relevant objects

Firstly, the custom field has to be added to the data sources. After that, it can be added by manual
operation, or added automatically. For using the custom field in KPI app in the views by default, new KPI
app has to be created by coping original one. “Adapt UI” is used to add in Object Page. In Fiori Design
Studio, the field is added automatically.

The fields can be added to the data sources in UIs and Reports tab.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 53 de 68
Mickael QUESNOT © https://s4hclub.com/

In UIs and Reports tab under Custom Fields tab, set to display Data Source column from Personalization
icon.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 54 de 68
Mickael QUESNOT © https://s4hclub.com/

Data sources are displayed.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 55 de 68
Mickael QUESNOT © https://s4hclub.com/

Push “Enable Usage” for the following data sources in this case.
SD_SALES_ORDER_IMPORT

C_SALESORDERITEMMANAGE

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 56 de 68
Mickael QUESNOT © https://s4hclub.com/

SD_MCC_SO_MASS_UPDATE_SRV

SD_SALESDOCITEM_GUI Create, Change, or Display Sales Docum

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 57 de 68
Mickael QUESNOT © https://s4hclub.com/

After Saving, push “Publish” in bottom bottom-right.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 58 de 68
Mickael QUESNOT © https://s4hclub.com/

• The data source starting with I_ or C_ are VDM (CDS View), and others (most of which end with
_SRV ++++) are OData created with Gateway Service Builder (Transaction SEGW).

The “Publishing” is started and will be finished several seconds later. (the status is changed to
“Published”.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 59 de 68
Mickael QUESNOT © https://s4hclub.com/

1.6.2.2. How is a field added technically

How to add fields in the UI depends on Fiori app type.

For KPI app, the new app must be created (copy) to add the fields in the initial screen, but if you do not
have to add in the initial screen but it is enough to make it possible to add the field manually after
launching the app, you do not have to copy and create new one.

For Fiori Design Studio app or Webdynpro Grid, the field is added automatically.

For Fiori Elements Object page, you can use “Adapt UI” in Fiori launchpad.

For other Fiori Elements app or Freestyle app, if the source is CDS View, you may be able to add with UI
annotations by using it with Metadata Extension(for the CDS Views in which metadata extension is set
to be allowed with “Metadata.allowExtensions”. But in some other cases, e.g. the source is OData
Project (T-cd SEGW), it might be more complex.

In the Manage Sales orders, the field added with CFL is included. Launch this app from Fiori launchpad.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 60 de 68
Mickael QUESNOT © https://s4hclub.com/

The application is launched, and the records are retrieved by pushing Go. Click one record and go detail.

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 61 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 62 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 63 de 68
Mickael QUESNOT © https://s4hclub.com/

Delete

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 64 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 65 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 66 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 67 de 68
Mickael QUESNOT © https://s4hclub.com/

© MICKAEL QUESNOT🎯🇪🇺
https://www.linkedin.com/in/mickaelquesnot/
Page 68 de 68

You might also like