Skip to Content
Technical Articles
Author's profile photo Rosaria Dipaola

Adding a Value Help for Custom Business Object fields

The Custom CDS View app can be used to create customized value helps for custom business object fields of type Association to Business Object.

The value help view needs to have the associated custom business object as primary data source. 

Please refer to the following SAP Help portal link for more details:

https://help.sap.com/viewer/e0cd7c1ecf3d4f2f9feb46ec1c5b68fb/2111.500/en-US/93f6abd65d754b38b259ca6ae23f69e9.html

Prerequisites

  • You have checkmarked Can Be Associated in the custom business object you want to associate.
  • You have used the associated custom business object view as Primary Data Source in the Custom CDS Views app.

Process Steps

  • Create the custom business object that will be used for the value help (Fig.1).

Fig1

Fig.1 Custom Business Object

  • Create a custom standard CDS view with the custom business object as Primary Data Source and define the join condition with the associated data source (Fig.2 and Fig.3)

Fig%20@

Fig. 2 Custom CDS View

Fig.%203%20Join%20condition

Fig. 3 Join condition

  • Navigate to the custom business object in which you want to use the value help view and click on the Fields tab.
  • Create a new field or select an already existing field.
  • Select the type Association to Business Object and enter the following information:
    • Business Object: Enter the technical name of the custom business object you want to associate.
    • Value Help View: The automatically created value help view is selected automatically. If you want to use a customized value help, enter the technical name of the custom CDS view you have created in the Custom CDS Views app or use the value help to see all custom CDS views which use the business object as primary data source. The value help view is pre filled automatically for standard business objects.

Fig. 3 Association to Business Object with custom value help

  • Publish your custom business object, maintain the business catalogs, go to the generated UI to create a new entry in the custom business object.
  • Use the search help to select the desired value (Fig. 4)

Fig. 4 Value help from the Custom CDS view

 

Summary

To summarize:

  • We created a custom business object to be used as value help;
  • We used the Custom CDS view app to create a custom CDS view with the associated custom business object as primary source;
  • We created a custom business object with a field in which we want to use the value help view, we selected type “Association to Business Object” , selected the technical name of the custom business object we want to associate (Business Objects) and entered the technical name of the custom CDS view we created in the Custom CDS Views app (value help view).

 

If you’d like to ask questions, share feedback and thoughts, please use the comment section and/or post questions in the SAP S/4HANA Cloud Extensibility community.

That’s all for now and I hope you found this blog helpful!

Thanks,

Rosaria (Rosie)

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Kamran Akthar
      Kamran Akthar

      Great Blog Rosaria. Gives us good insight into the Workings of CDS.

      Author's profile photo Phani Kumar Yennamani
      Phani Kumar Yennamani

      Hi Rosaria,

       

      Followed your bog and creating below custom value help.

      1. created custom business object and checkmarked Can Be Associated
      2. created custom CDS view of scenario value help with custom business object as primary data source .
      3. added standard CDS view as associated data source .

       

      we are not able to see any data in CDS preview . could you please help.

       

       

      join

      join

      Author's profile photo Andreas Riehl
      Andreas Riehl

      Related Question & Answers: https://answers.sap.com/questions/13610667/adding-standard-cds-view-as-value-help-for-custom.html

      Author's profile photo Andreas Riehl
      Andreas Riehl

      Thanks for this great guide, Rosaria!

      In the meantime (since 2202), there is also a dedicated Custom CDS Views "Value Help" scenario available, that has some additional advantages over using a standard Custom CDS View.

      Some more details can be found here:

      Author's profile photo Bhaskar Nagula
      Bhaskar Nagula

      Hi Rosaria Dipaola,

      Thank you for your post!

      I've tried the same but the table/view that i wanted doesn't exist in the associated source for mapping.

      The database table on On-premise is T856 (Transaction Types), value help of field is TRTYP (Transaction type).

      Do you know how we can incorporate this in custom CBO as a value help/search help?

      Thanks in advance.

      Author's profile photo Prateek Sharma
      Prateek Sharma

      This does not work.

      We are also facing issue while adding the standard value help in a CBO with the help of custom CDS app value help scenario.

      So we have 1 CBO table and UI app generated on top of it. then in order to add value help we created 1 more CBO which we are using as primary data source in the value help scenario of Custom CDS app and using i_plant as associated data source as mentioned on the sap help page. I can now attach the value help to the main CBO with the help association to business object but it is not fetching the plant data.

      Main reason can be since the CBO associated is primary data source and it does not contain any data but SAP has mentioned to use it as a primary data source as per below page.

      https://help.sap.com/docs/SAP_MARKETING_CLOUD/e0cd7c1ecf3d4f2f9feb46ec1c5b68fb/93f6abd65d754b38b259ca6ae23f69e9.html

      We are using 0:* association with same key fields, tried adding UUID as a key field too but it does not work. Please let me know if anyone has solution to this issue.

      Author's profile photo Yannick Schmitt
      Yannick Schmitt

      Hi Prateek,

      If the associated CBO doesn't have any records, I would expect the value help to be empty. You want to select a record from that CBO via the value help after all. Make sure that every field that is marked as "Key" in the associated CBO, is also marked as Key in the Custom CDS View on the Elements tab. Don't set the UUID as Key.

      Best regards,

      Yannick

      Author's profile photo Raghu Murugesan
      Raghu Murugesan

      Prateek Sharma / Phani Kumar Yennamani Did you guys found any breakthrough later? If so , Could you please share here?