Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Masaaki
Product and Topic Expert
Product and Topic Expert
58,763

Purpose of this blog


This blog explains how to add fields which have already been in the source table of standard apps and objects by using Key User Extensibility Tools “Custom Fields and Logic” (CFL) in S/4HANA. It is possible with the transaction SCFD_EUI.

In S/4HANA implementation, it is typical requirement to add fields to standard Fiori apps and other objects, and it is especially the case for conversion customers that the fields have already been in the source table and they want to use them in standard Fiori apps. CFL can be used for adding fields to apps and object, and it is not only for new field, but also for the fields which have already been in the source table.

Note: this blog focuses on S/4HANA Any Premise (On premise) 1511~ customers.

For understanding Custom Fields and Logic, see the blog.

 

Topics


Overview


How to add the field already in the table to Business Context and Fiori app


Add to Business Context


Add to the data source and Fiori app



 


Overview


With the transaction SCFD_EUI, it is possible to add the fields already in the source table to the Business Contexts in “Custom Field” of CFL, so which can be added to the relevant data sources and other objects for the Business Context as the same way as the fields created with CFL.

In transaction SCFD_EUI, the manual steps would be guided to add the fields to the Business Context. The steps are different depending on the Business Context. For example, in the Business Context “Master Data: Product Plant” (Table: MARC), the field in the custom append structure has to be moved to persistent structure.

See the SAP help in detail.

 


How to add the field already in the table to Business Context and Fiori app




Add to Business Context


In the following case, a field ZZMATGRP01 has been added using Coding Block in ACDOCA. It can be added to Business Context “Accounting: Coding Block” (FINS_CODING_BLOCK).

Table ACDOCA (Transaction SE11)



Transaction SCFD_EUI



The field is found. The Field Status is “Preparation Required”. Select this entry and the overview of the steps is displayed in the bottom. Push “Prepare” to find the steps. In the following case, so many entries are there, but it does not mean manual operations are needed for all entries. As just the same steps are guided for the same Business Context, once you have completed the steps for one entry (entry for ACDOCA in the following case), the steps for many others are completed as well.



Message is displayed. Click the detail icon, and the guide is displayed.



It says as below.



Open the CDS View “NSDM_E_MSEG” (Proxy View for MSEG) (SAP Note 2865970), and you can find Extend View is created for this view (case c).



 

Extend View for NSDM_E_MSEG in which ZZMATGRP01 is added.



Delete this Extend View.



Go back to transaction SCFD_EUI in SAPGUI. After running Refresh, “Field status” of many entries are changed to “Can be Enabled”.



After clicking a entry (ACDOCA in the following screen), push “Enable”.



Pop-up screen appears. Details of the Custom Field are defined here.

In the following case, “Enable Field as New Custom Field” is selected, and “LIST” is selected as Semantic Type (options: EMAIL/LIST/PHONE/TEXT/URL for the CHAR field, but the available options for Semantic Type depend on the DDIC type). For semantic type “LIST”, value help view is needed to add the value help for the field. The source code is proposed by pushing “Generate” icon.

 

Source codes of the value help CDS View are proposed. The source for Code View and Text View are proposed.





 

Using the proposals, the following CDS Views are created with ADT.

Code View:








@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: 'ZI_MATGRPVH'

@AbapCatalog.sqlViewName: 'ZIMATGRPVH'

@Search.searchable

@ObjectModel.compositionRoot: true

@ObjectModel.usageType.serviceQuality: #A

@ObjectModel.usageType.sizeCategory: #S

@ObjectModel.usageType.dataClass: #CUSTOMIZING

@Analytics.dataCategory: #DIMENSION

@ObjectModel.representativeKey: 'Code'

 

define view ZI_MATGRPVH

as select from t023

association [0..*] to ZI_MATGRPVHT as _Text

on $projection.Code = _Text.Code

{

@ObjectModel.text.association: '_Text'

@Search.defaultSearchElement: true

key cast( matkl as zzmatgrp01 ) as Code,

@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]

_Text

}

 

 

Text View:








@AccessControl.authorizationCheck: #NOT_REQUIRED

@EndUserText.label: '<End User Label>'

@AbapCatalog.sqlViewName: 'ZIMATGRPVHT'

@Search.searchable

@ObjectModel.usageType.serviceQuality: #A

@ObjectModel.usageType.sizeCategory: #S

@ObjectModel.usageType.dataClass: #CUSTOMIZING

@ObjectModel.dataCategory: #TEXT

@ObjectModel.representativeKey: 'Code'

 

define view ZI_MATGRPVHT

as select from t023t

association [0..*] to ZI_MATGRPVH as _Code

on $projection.Code = _Code.Code

association [0..1] to I_Language as _Language

on $projection.Language = _Language.Language

{

@Search.defaultSearchElement: true

key cast( matkl as zzmatgrp01 ) as Code,

@Semantics.language: true

@ObjectModel.foreignKey.association: '_Language'

//Use this for language-dependent descriptions:

key spras as Language,

//Use this for language-independent descriptions:

//key $session.system_language as Language,

@Search.defaultSearchElement: true

@Semantics.text: true

wgbez as Description,

@ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT]

_Code,

_Language

}

 

Standard VDM for master data, e.g. I_CompanyCode cannot be used in general as the syntax check is strict, e.g. the alias of the field must be “Code” and associated text view must be named “_Text”. (We SAP hope to improve this in the future.)

 

Set the created Code View as Value Help View, push “Create Field”.



 

The field is added to the Business Context.



 

The field statuses for the entries of Business Context Accounting Coding Block are changed to “Enabled”.



 


Add to the data source and Fiori app


Launch CFL in FLP.



 

In Custom Fields tab in CFL, the custom field “ZZ1_MATGRP01 has been created for Business Context “Accounting: Coding Block”, and Origin of this custom field is “ABAP Development”, as is created with transaction SCFD_EUI.



In the following case, the field is added to C_GLLINEITEMSQ0001. When enabling the field for this source, it is also enabled to I_GLACCOUNTLINEITEMCUBE automatically as is the source of C_GLLINEITEMSQ0001.



 

After save and publish, the field is added to those CDS Views.

Extend View for I_GLACCOUNTLINEITEMCUBE. The value help view ZI_MATGRPVH is associated.



Extend View for C_GLLINEITEMSQ0001.

As C_GLLINEITEMSQ0001 is analytic query, only the field has to be added.



C_GLLINEITEMSQ0001(2CCFIGLLITMQ0001) is the source of Journal Entry Analyzer (F0956A). Launch the app in FLP.



The custom field is added in the app. As the app type is Fiori Design Studio, the field is added automatically in the app.



 

I believe you can enjoy more and more standard Fiori apps by adding the fields already been in the table in the way explained in this blog!

 
34 Comments
former_member183915
Active Contributor
0 Kudos

Hi masaaki.arai

I have a requirement to add SAP standard field BUT000-BPEXT in  business context(BP_CUSTVEND1)  so that it can be enabled in “Business partner master data” fiori app as this field does not shown up in this standard business context.

Based on your blog,when i search for this field using SCFD_EUI to add it to business context , it does not show me this field.Please let me know if  this means I cannot enable this field for use with “Custom Fields and Logic” app?

Looking forward to your response.

 

https://answers.sap.com/questions/13037329/sap-standard-field-not-visible-in-scfd-eui-tcode-f.html

 

Regards,
Navya

Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi,

I have shared the request to developers.

if you use the field for read only app, you should be able to add the field with Extend View.

https://blogs.sap.com/2018/08/22/sample-custom-cds-view-using-predefined-virtual-data-model-and-exte...

Thanks, Masa
jaket
Explorer
0 Kudos

Hello,

 

I need to add the new field in UI Fiori based on an existing field in table KNVV.

When running the t-code SCFD_EUI I cannot find the field to be used as a custom field.

 

Looking forward to your response.

 

Best Regards,

Patrick_vN
Active Contributor
0 Kudos
Thanks for the interesting blog. Just a question, after adding fields to the coding block, one needs the extension on NSDM_E_MSEG containing those fields, or you get dumps when selecting from MSEG (or even opening MSEG in SE16n).

So after deleting the extension and creating the new view(s), are you able to use MSEG (in both SQL statements & SE16n)?
shwetanargachhe
Active Participant
0 Kudos
Hi Patrick ,

You may need to implement sap note 2686694. It solved error while we implemented extension.

 

Regards,

Shweta
daouda_pouye28
Explorer
0 Kudos
Hi Masaaki,

I am working on the Manage Product Master Data (Version 1809) in Draft-based. I have created some new fields by extending the standard CDS view.

But the values of news fields are not saved in backend when creating a new Product.

By debugging the "COPY_DRAFT_TO_ACTIVE_ENTITY", the values of the added fields are in in the structure but not saving in the Backend.



Can you please suggest me how I can do it?

Thank you in advance
Jigang_Zhang张吉刚
Active Contributor
0 Kudos
Thanks for sharing this.

Already add this to Favorites 😄
Suman_Pandit
Explorer
0 Kudos
Hi Masaaki,

This is a Nice blog and thanks for sharing the steps in detail.

We are doing a Upgrade from 1809 to 2020 and we found an issue with the custom fields enabled though the Custom field and logic app. Same custom field in different persistent structure creating DDIC activation issue.

I have shared the details in following link -

https://answers.sap.com/questions/13406733/same-custom-field-used-in-different-persistent-str.html

 

It will be very helpful if you provide some suggestion.

 

Thanks
Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Suman,

Sorry, I think it is better to ask SAP supprt via Incident for such a case.

regards, Masa
Suman_Pandit
Explorer
0 Kudos
Thank you.
patriciachacon
Explorer
0 Kudos
Hi @Masaaki Arai  : when adding a date type field it gives an error, it doesn't let it activate, any suggestions?
Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Chacon,

sorry, pls create cusotmer incident.

regards, Masa
0 Kudos
hi Masaaki

thankyou for the detailed blog

I see that the custom fields created this way are stored in package ZAR10 (same package as where the DB fields are created) so can you please tell if the package ZAR10 has been registered for extensibility using the Configure Software Packages app.

If not what steps were done before enabling the usage and pusblishing
angrasi
Newcomer
0 Kudos
Hi, Arai.

Your post gave me a direction, but in the environment (SAP S/4HANA 2020 on premise) where I'm working this not worked.

The transaction SCFD_EUI show me a lot of messages complaining that was missing Language or Code annotations. So I've dicided to join the two views in one and it worked.

 

Exemple Code:

@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: '<CDS View Lable>'
@AbapCatalog.sqlViewName: '<CDS View DDIC Name>'
@Search.searchable
@ObjectModel.compositionRoot: true
@ObjectModel.usageType.serviceQuality: #A
@ObjectModel.usageType.sizeCategory: #S
@ObjectModel.resultSet.sizeCategory: #XS
@ObjectModel.usageType.dataClass: #CUSTOMIZING
@Analytics.dataCategory: #DIMENSION
@ObjectModel.dataCategory: #TEXT
@ObjectModel.representativeKey: 'Code'

define view <CDS View Name>
as select from <Code Table>
inner join <Text Table>
on <Code Table>.<Code Field> = <Text Table>.<Code Field>
association [0..*] to <CDS View Name> as _Code
on $projection.Code = _Code.Code
association [0..1] to I_Language as _Language
on $projection.<Text Table Langage Field> = _Language.Language
association [0..1] to <CDS View Name> as _Text
on $projection.Code = _Text.Code
{
@ObjectModel.text.association: '_Text'
@Search.DefaultSearchElement: true
key cast( <Code Table>.<Code Field> as <Code Alias> ) as Code,
@Semantics.language: true
@ObjectModel.foreignKey.association: '_Language'
key <Text Table Langage Field> as Language,
@Search.DefaultSearchElement: true
@Semantics.text: true
<Text Table Text Field> as Description,
@ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT]
_Code,
_Language,
_Text
}
XiaoLi
Discoverer
0 Kudos

Hi masaaki.arai

 

I have added the field with OXK3 into table ACDOCA, but when I try to enable the field with SCFD_EUI, it shows Cannot Be Enhanced as below, do you have an hints?

 

Regards,

Lee

Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Lee,

Sorry, but in my internal system, the field in CI_COBL are added to CFL.

Regards, Masa
pvannest
Participant
Hi Masa,

 

any news on that? is this transaction still only be suitable for custom fields?

 

thanks
0 Kudos
Hi masaaki.arai

Is it possible to add field like code+description with SCFD_EUI tcode (as standard working with fields like customer)?
I tryed to do it with the help of your guide, but it doesn't work. May be I miss smth?

Regards, Artem
Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi,

in my understanding, only the fields in DB can be added with SCFD_EUI.

Thanks, Masa
MarkSargent
Explorer
0 Kudos
Hi masaaki.arai

I have the same question posted by Laimonas: ACDOCP. adding LIFNR (vendor) | SAP Community

We would like to extend ACDOCP with LIFNR, however I cannot find any resources which detail how to add 'standard' fields rather than custom fields. We found this note - 2453614 - FAQ: Universal Journal Extensibility - SAP ONE Support Launchpad - regarding extending the universal journal, however it equally only talks about custom fields.

Any thoughts from your side?

Thanks for your time!

Cheers,
Mark

 
saumya_das
Explorer
0 Kudos
Does adding the custom field via CFL adds it at GUI screen level also?
Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Saumya,

Depends on the context. in some context, it is possible.

regards, Masa
kawatra02
Explorer
0 Kudos
HI masaaki.arai,

 

I have created one custom field 10 CHAR and everything is working fine.
But I got the requirement to reduce the field length from 10 CHAR to 5 CHAR.

In the backend, I had done the change in the data type and adjust all the tables.

But the FIORI UI5 App field is still showing 10 char fields.

Can you please guide me on what I need to do?

 

Cheers,

Himanshu Kawatra
Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Himanshu,

Sorry, Pls create the incident.

Regards, Masa
shashikumar_bs
Advisor
Advisor
0 Kudos
Hello masaaki.arai,

I want to add a field from Material master basic data on to Maintain bill of material app in SAP S/4 HANA on-premise... the field i add on to Bill of material header is for information only. Currently I do not see any business scenario matching this relationship in custom fields app. Is it possible to achieve this requirement with the approach given in this blog ?

Thanks in advance for taking time to respond to this...

 

Best regards,

 

Shashikumar
ekta_bharti
Associate
Associate
0 Kudos

Do we support custom field with namespace /BAY0/xxxxx (abap table level) in fiori UI with F4 help ?

Currently custom fields with Z and Y namespaces are working perfectly fine in fiori apps but in case of custom field with other name spaces , just field is coming .It's associated F4 help is not getting picked from the backend table. How do we support this ?

abapdanny
Explorer
0 Kudos
Hi makoon

thank you really much for the blog! That helped us a lot, after consultants told us, it wouldnt be possible to add existing Customer-Fields to a standard Fiori App.

I have a short question. Is it possible to add the search help (so we need to switch the semantic type from TEXT to LIST) after we already created everything for that field (the field is already existing in the fiori app)?

Thank you in advance and best regards

Daniel
Masaaki
Product and Topic Expert
Product and Topic Expert
Hi Daniel.

it is possible to add value help for the field to be added using Business Object, Code List and CDS View (2021~), but afaik, it is now possible to add it to the field which has already been added.

regards, Masa

 
abapdanny
Explorer
0 Kudos
Hi makoon

thank you for your blog! Do you know by any chance if it is possible, to show the custom field as a dropdown? I already added the Annotation  @ObjectModel.resultSet.sizeCategory: #XS into the Text- and the Code-View but unfortunately that doesn't work.

Thank you in advance and best regards

Daniel
Masaaki
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Daniel,

I think when the annotation is added to the associated master view, it should work. if it doesnt work, I have no idea why it would not work..

regards, Masa
alexanderst
Explorer
Hi masaaki.arai

thank you very much for this very detailed and highly helpful post.

Maybe you can support me in my situation.

I added a new field "XYZ" in the cost center master data using the business context "Cost Center Master Data". I can see this field "XYZ" in the master data field of the cost center for e.g. in the app "manage cost centers". For reporting purposes: e.g.: Trial Balance, I need to analyze not only by the cost center but also by this specific cost center master data field "XYZ".

 

Can you be so kind to advise how to make it possible? Maybe I used the wrong business context? For example when i create a field "XYZ2" with the use of the business context "Accounting: Journal Entry Item", then I can see this field in the Trial Balance, but not in the master data of the cost center.

 

I highly appreciate your response!

 

Thanks and kind regards,

Alexander
ozlem_phl
Discoverer
0 Kudos

Hi,

First of all thank you for this great article. 

I have faced an issue. Maybe you may help me with this problem

I have added custom field with type "amount with currency" and used FI_DOCUMENT_CHANGE and BADI_FINS_ACDOC_POSTING_EVENTS to fill this Z* field.

ACDOCA has been updated with correct amount. But this Z* field in FI document item has been populated in IFIGLBALCUBE cds view for each reporting period(FISCALPERIODDATE). Thus amount is not coming with correct value in Trial Balance app. Instead of 6.000 TRY, it comes with amount 84.000 TRY as a total of all item. 

How can we solve this issue?

Br,

IFIGLBALCUBE

Özlem

rogcoimbra
Participant
0 Kudos
Great.

Thanks.
wiseman86
Discoverer
0 Kudos
HI Alexander,

Did you find the solution to your question? I am experiencing the same problem.

All the best,

 

Andrew