Thursday, 30 December 2021

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. 

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).

ABAP Development, SAP S/4HANA Cloud, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Guides, SAP ABAP Skills
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)

ABAP Development, SAP S/4HANA Cloud, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Guides, SAP ABAP Skills
Fig. 2 Custom CDS View

ABAP Development, SAP S/4HANA Cloud, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Guides, SAP ABAP Skills
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.

ABAP Development, SAP S/4HANA Cloud, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Guides, SAP ABAP Skills
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)

ABAP Development, SAP S/4HANA Cloud, SAP ABAP Certification, SAP ABAP Learning, SAP ABAP Career, SAP ABAP Guides, SAP ABAP Skills
Fig. 4 Value help from the Custom CDS view

Source: sap.com

No comments:

Post a Comment