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: 
georg_wilhelm
Product and Topic Expert
Product and Topic Expert
5,492

Do you want to know how you can enhance the usability of a key  user custom field of type “Value Help based on CDS View” by utilizing the new feature “Value Help Binding”?

If your answer is yes, then this blog post is just  for you.

With this document, we’ll explain the following topic:

    • How to configure your custom field of type “Value Help based on CDS View” in a way that its value help is context-dependent by additional filter values supplied by instance data



Let’s assume we already created a key user custom field “Approver(Demo)” of type “Value Help based on CDS View” on the “Procurement: Purchasing Document” business context and we already made it visible in the purchase order header section of the “Manage Purchase Orders” Fiori app. How to develop such a custom field using the power of Embedded Steampunk can be taken from the blog “SAP S/4HANA Key User Extensibility powered by Embedded Steampunk: Custom Field with ABAP implemented Value Help“ blogpost .

Let‘s also assume that we created another custom field of type “Association to Business Object”on the “Procurement: Purchasing Document” business context associating the “Company Code” business object. The value of this field will later on act as context for the value help of the custom field “Approver(Demo)”.

Note that the standard field “Company Code” already exists, and that the  standard field “Approver” in the purchase order business object already exists. Let’s assume that we handle our approval process a bit differently than usual and therefore introduce these two custom fields. To be able to distinguish the standard field from the custom fields, we add “(Demo)” at the end of the label of the approver custom field and “(demo duplicate)” at the end of the company code custom field.  Their labels are now “Approver(Demo)” and “Company Code( demo duplicate)”.

We start the task of making the value help of the “Approver(Demo)” custom field context-dependent by logging in to  client 100 and opening the app “Manage Purchase Orders”. There, we select one of the purchase orders listed to navigate to the purchase order details screen.

Here, we see the two custom fields on the purchase order detail screen (see screenshot below):

    1. the “Approver(Demo)” field with its attached read-only description field “Approver (Demo) (Desc.)”

 

    1. the “Company Code( demo duplicate)” field




When we click on the value help icon of the “Approver(Demo)” field, we get the following value help popup:


Please note that the company code filter field is empty and has not been prefilled so far with the current value of the company code field, which is “1710”.
In order to get this filter field prefilled in the value help, we have to define additional bindings for the value help of the custom field “Approver(Demo)”. To do so, we have to edit the custom field within the “Custom Fields” app. The fastest way to navigate to this app is

    1. to switch into the UI adaptation mode by clicking on our avatar on the right upper corner of the screen. Then, select the “Adapt UI” option.

 

    1. Right-click on the custom field “Approver(Demo)” or any other field in that section, and within the menu that is now popping up, select “Add: Field” (see screenshot below).




A dialog is popping up showing the list of available fields. In this dialog, there is a “+” button on the top right corner that you can use to create new custom fields, or maintain already existing custom fields. Since we want to maintain already existing custom fields,  we click on this button. It directly navigates us to the “Custom Fields” application and opens the “Custom Fields” tab. We‘re now searching for our already existing custom field “Approver (demo)” and by clicking on its entry on the list, we navigate to the details of this custom field.

There, we open the “UIs and reports” tab and we navigate to the list entry “Manage Purchase Order”, which is the entry that represents the exposure of the custom field to our UI “Maintain Purchase Orders”. Within this list entry, we see an active button with a pencil icon that has the tooltip “Maintain Value Help Bindings”, which is what we want to do. Selecting the pencil icon,  the following popup is displayed (see screenshot below):


On this popup, we can now define the binding of the company code value help filter field via a drop-down list. We do so by selecting the company code custom field as data source field, and then we click “OK” and save our changes. In the end, we can publish the custom field.

Restarting the UI, we can open the value help for our “Approver (demo)” again. The company code filter field is no longer empty but has been prefilled with the current value of the company code field which is “1710”. Also, all offered value help entries are automatically filtered by this value.


Now you are done! Congratulations!

For further information refer to the official documentation.

This blog focuses on SAP S/4HANA Cloud. We have some good news: this doesn’t only work in SAP S/4HANA Cloud starting with release 2208, but it also works in your SAP S/4HANA (on premise) system starting with release 2022.

Please note that the feature “Value Help Binding” is currently not available for all types of UIs.
Whether it‘s available on a specific UI or not depends on the technology on which the UI‘s backend service is built. Currently, this feature is supported for OData services built with the newest OData service exposure technologies, which are

    1. Referenced Data Source

 

    1. Service Definition/Service Binding



Please note that in order to implement the described scenario in SAP S/4HANA Cloud, you need a user in the customizing tenant (client 100). The following business roles have to be assigned:  SAP_BR_PURCHASER, SAP_CORE_BC_EXT_FLD, SAP_CORE_BC_EXT_FLEX.

Feedback, Comments, or Questions

You’re cordially invited to provide them in the comments section below. Also, please follow my profile to get updates when I publish more posts on these topics.
Also feel invited to post and answer questions  here (https://answers.sap.com/tags/270c4f37-c335-46e1-bfad-a256637d5e26) and read other posts on the topic (https://blogs.sap.com/tags/270c4f37-c335-46e1-bfad-a256637d5e26/).

I want to thankyasmina.vanrooij and karstenschaser  for their extremely  helpful contributions.

12 Comments
Suman_Pandit
Explorer
0 Kudos
Thanks georg.wilhelm for this wonderful post.

We want to achieve similar kind of requirement to have 2 custom fields Project type and Project Category in Plan Customer Project app and, Project type depends upon Project Category. Project Category value in the screen will be used to filter out the value help for Project Type.

But we are not able to find out any option of 'Value Help Binding' in UI of Plan Customer Project.

Is there any other way this be achieved?

Thank you!

Suman
georg_wilhelm
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Suman,
thanks for the feedback! I am not sure whether I fully understood your use case...but when I am right this is what I would propose: you create a key user custom field of  type "Code list based on CDS view" where the value help has two key fields ProductCategory and ProjectType...if you find an SAP standard view that has these two fields as key fields you can take that one. If not you can try to create a key user custom CDS view which has these two fields as key fields. If the solution with a custom CDS view does not work there is still one more option...you can create a developer extensibility custom entity and code the value help logic yourself in ABAP ( blog: https://blogs.sap.com/2022/07/27/sap-s-4hana-key-user-extensibility-custom-field-with-abap-context-d....

There is one more blog which describes other scenarios of context dependent value help...maybe that is also interesting for you:  https://blogs.sap.com/2022/07/27/sap-s-4hana-key-user-extensibility-custom-field-with-abap-context-d...

Best regards Georg
Suman_Pandit
Explorer
0 Kudos
Ok Thank you Georg ..
former_member398838
Discoverer
0 Kudos
Hi Georg,

We are currently adding some custom fields related Bank Account Management (business context Bank Account Master Data - I_BankAccountTp).

SAP already provides a company code field.

We are adding a new field "Top Account" which will refer to another account, but should be within the same company code.

We have followed your procedure on how to add a value help by using a custom CDS view, and it is working fine as long as we also create the "Company code (duplicate)" field and populate this with a value through a BADI (and use this field in the value help binding).

My question is: Why do we need to create an additional field "Company code (duplicate)" (+ badi to fill it) and use this in the mapping, when SAP already provides a Company Code field. Seems only logical to use the SAP provided "Company Code" field in the value help binding.

Why doesn't SAP allow the use of the standard "Company Code" field in the value help binding?

Surely having duplicate fields and badi's that does not really serve a business purpose cannot be considered in line with the clean core principles?

Regards,

Knut
georg_wilhelm
Product and Topic Expert
Product and Topic Expert
Hi Knut, you discovered a "gap" and you implemented exactly the only currently available way to realize your requirement. Anyway we are already working on a concept that allows SAP standard development to "C1-release" fields in standard CDS views which are not C1-released and are not intended to be C1-released so that you as a customer can then use these "C1-released" fields for the valuehelp mapping and no longer have to create additional custom fields which you fill with data based on some BAdI implementations. But I can not tell you in which release we will deliver this. Best regards Georg
nadia_mueller
Explorer
0 Kudos
Dear Knut, dear Georg,

we implemented a custom field in context Customer company code core (CUST_COMPANYCODE) and added a CDS View based Valuehelp. This valuehelp contains the property BusinessPartner what we like to prefill with the business partner/customer number out of the context.

As i understand you correctly this is exaclty the issue you discribed, isnt it? Or do you know any way to solve this issue? What kind of BADI we might can use for prefilling custom fields?

Thanks for response and kind regards

Nadia
georg_wilhelm
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Nadia, this is exactly the use case I described and that is exactly the critical question "which BADI can I use to prefill an additional key user custom field so that I can use it as input field for the valuehelp binding...AND: is there any respective BAdI". A BAdI like this one is application specific and even more it is OData service specific  and most likely OData service entity specific. Can you tell me in which Fiori UI you want to have this custom field (the ID within the Fiori APP liberary would be helpfullI. And if you also know the ODAta service name and/or the OData service entity name this would also be helpful. As I belong to the ABAP platform organization from SAP I do not know all the BAdIs from S/4HANA but when I have the respective input information from your side I can ask S/4HANA development to tell you if there is a BAdI you can use for your use case and if so the name of the BAdI.

Please note also that we currently work on a feature that such a workaround to create an additional key user custom field to act as input field for the valuehelp binding for another key user custom field is no longer needed but instead you can select the standard field which is already in the respective OData service entity as input field for the valuehelp binding . Best regards Georg
nadia_mueller
Explorer
0 Kudos

Dear Georg,

thanks for response. See detailed information down under for:

  • used Application
  • Url Link for CDS View Navigation
  • used Service
  • a image how we implemented the new field with Custom Valuehelp CDS

Maybe you know a variant we can make the valuehelp more user-friendly, because of missing information about business partner number in this part of the app the user have to remember it and to advise them to url is not a suitable solution at all.

Thanks.

Sincerly Nadia

 

App-Link:

https://XXXXXXXXXXX/sap/bc/ui2/flp?sap-client=100&sap-language=EN#BusinessPartner-manage?BusinessPartner=100014&BusinessPartnerRole=Customer&DraftUUID=00000000-0000-0000-0000-000000000000&IsActiveEntity=true&IsLaunchedFromFLP=false&sap-app-origin-hint=&/C_BusinessPartner(BusinessPartner='100014',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)/to_BusinessPartnerCustomerCo(BusinessPartner='100014',CompanyCode='1200',DraftUUID=guid'00000000-0000-0000-0000-000000000000',IsActiveEntity=true)/?sap-iapp-state--history=TAS1Z5E2M8ET7C8CCZCKBVEHI2E80TU6P8PISQ94N

metadata-Link:

https://XXXXXXXXXXX/sap/opu/odata/sap/MD_BUSINESSPARTNER_SRV/$metadata?sap-client=100&sap-value-list=MD_BUSINESSPARTNER_SRV.C_BusinessPartnerCustCoType

FIORI-App:
Title
Manage Business Partner
ID
F3163
Version
10.0.6
Component
LO-MD-BP
Technical Component ID
mdm.md.businesspartner.manage
Framework ID
UI5
Framework Version
1.108.0 (202211020933)
georg_wilhelm
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Nadia, that was exactly the information I was looking for. I did now forward your question regarding the BAdI to fill the the additional workaround key user custom field with the value of standard CompanyCode field in order to use this custom field then for the valuehelp binding to the extensibility lead of the S/4 dev organization. I come back to you as soon as I have the feedback. Best regards Georg
georg_wilhelm
Product and Topic Expert
Product and Topic Expert
Hi Nadia, today I received a first feedback from the S/4 developers responsible for OData model “MD_BUSINESSPARTNER_MDL          0001”, Entity C_BusinessPartnerCustCoType  (CDS view C_BusinessPartnerCustCo )  and they told me that there is no such BAdI available that would allow to prepopulate an additional KeyUserCustomField "YY1_MY_COMPANY_CODE" with the value of the standard CompanyCode field. So sorry...your workaround will not work

Anyway we from ABAP platform are already working on a concept that allows a customer to directly utilize standard fields for the context dependent valuehelp binding for fields of type "Codelist based on CDS view". I do not know whether this feature will be already available with the next possible release which is 2408. Anyway we do our best. As soon as I know whether we will deliver it with 2408 or not I will once again answer via this blog conversation. But this will take a couple of weeks. Best regards Georg
Kashish_Rajpal
Explorer
0 Kudos

Hi @georg_wilhelm,

We are currently adding some custom fields related Bank Account Management (business context Bank Account Master Data - I_BankAccountTp).

I have added the custom field as code list as well as using available standard CDS view as value help and it published successfully.

Only issue over here is that in my earlier version of 2022, in the backend extension include the newly value help CDS created for code list was displayed as check table as well as value table but now in 2023 version it is displayed only as value table and not check table due to which user is able to enter values which are not part of code list values or CDS data values.

Could you please help what I am missing here or is there any note available to resolve this ?

Regards,

Kashish 

georg_wilhelm
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Kashish, whether the code values of a key user custom field of type code list are checked or not does not depend on the fact which value help you choose. It depends on how SAP application development enabled their custom fields support in their respective application...some applications call a validation API and some do not. So if you want us to follow up please create a ticket so that we can have a look in the system. Best regards Georg