cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SearchHelp - Public Cloud Generate UI Service Table

enry79
Explorer
0 Likes
730

Hi,

I created a custom table in a Public Cloud system.

I have some fields defined with custom domains and fixed values ​​and others defined with standard data elements (such as BUKRS or FAKT).

I published the view with Eclipse using the automatic procedure "Generate Abap Repository object". Tutorial here: https://developers.sap.com/tutorials/abap-environment-rap100-generate-ui-service..html

When I launch the published service the fields linked to custom domains with fixed values ​​do not show an automatic searchhelp, the field is a normal text field without the possibility of seeing the list of declared fixed values.

Example fields with Fix Doman Value:

enry79_0-1750149915581.png

enry79_2-1750150119359.png

 

The same problems with BUKRS or FAKT data elements. In Bukrs case; I modified the Metadata Extension generated by the tool to insert the SearchHelp:

BUKRS I added this annotation:

@Consumption.valueHelpDefinition: [ { entity: { name: 'I_CompanyCodeStdVH', element: 'CompanyCode' } }

But to find "I_CompanyCodeStdVH" isn't easy!

What is the correct or fastest way to:

a) determine the search-help values ​​linked to the standard data elements (usable and released for client use)? Is there a library with all the values ​​cataloged?

b) Is it not possible to use the automatic searchhelp of the fixed domain values? Should a particular annotation be added in the metadata Extension?

Thanks you

Accepted Solutions (1)

Accepted Solutions (1)

Chuma
Active Contributor
0 Likes

Hi Enry,

Great question, you're diving into a common challenge when using custom domains with fixed values, and a standard value helps in SAP S/4HANA Cloud Public Edition

Here are the recommended ways:

1st option, ABAP Development Tools (ADT) in Eclipse

  • Use Ctrl+Shift+A to search for I_*VH or C_*VH (value help views).
  • Look for released CDS views with the annotation

2nd option, SAP Help / API Hub

  • Visit: https://api.sap.com
  • Search for “value help” or entities like I_CompanyCodeStdVH in the S/4HANA Cloud section.
  • These often contain a list of released CDS views for public use.

3rd option, SAP Explorer for S/4HANA Cloud (Cloud SDK)

  • SAP’s “View Browser” app (Fiori) in Public Cloud allows you to browse released CDS views.
  • Filter by usage type: External API / Released View.

https://help.sap.com/docs/BTP/abap-cds-consumption-annotations

With kind regards

Chuma

Answers (1)

Answers (1)

enry79
Explorer
0 Likes

Ok I try this way:

CDS open for Public Cloud: DDCDS_CUSTOMER_DOMAIN_VALUE_T (table DD07T). But it has a problem.. PARAMETER

So I create a new CDS:

define view entity <my_cds_1>

with parameters

domain_name_2 : sxco_ad_object_name --abap.char(30)

as select from DDCDS_CUSTOMER_DOMAIN_VALUE_T ( p_domain_name: $parameters.domain_name_2 )

{

key domain_name,

key language,

@Analytics.hidden: true

@Consumption.hidden: true

@Search.defaultSearchElement: true

@Search.ranking: #HIGH

value_low as DomainValue,

text as Description

}

where language = $session.system_language

A new search-help CDS:

@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@vdm.viewType: #BASIC
@ObjectModel: { dataCategory: #VALUE_HELP,
representativeKey: 'FixValue',
usageType.sizeCategory: #S,
usageType.dataClass: ##ORGANIZATIONAL
usageType.serviceQuality: #A,
supportedCapabilities: [#VALUE_HELP_PROVIDER, #SEARCHABLE_ENTITY],
modelingPattern: #VALUE_HELP_PROVIDER }
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@search.searchable: true
@Consumption.ranked: true
@Metadata.ignorePropagatedAnnotations: true
@EndUserText.label: 'Lista Valori'
define view <MY_CDS_SH>
as select from <MY_CDS_1> ( domain_name_2: '<domain_name>' ) as a
{
@ObjectModel.text.element: ['FixValue']
@search.defaultSearchElement: true
@search.fuzzinessThreshold: 0.8
@search.ranking: #HIGH
key a.DomainValue as FixValue,
@Semantics.text: true
@search: { defaultSearchElement: true, ranking: #LOW }
a.Descrizione as ValueText
}

 In Metadata Extension:

{ entity: { name: '<MY_CDS_SH>',
element: 'FixValue' } }
]
<UIelement>;

Work!

But not I try to generate a Dynamic Search Help... I want change "domain_name_2" parameter in Metadata Extension to used same SH for all Fix Domain Value!!!

It's possible? I don't now. I try my second version but don't Work.

 

In Search Help I insert another PARAMETERS to call my custom cds:

@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@vdm.viewType: #BASIC
@ObjectModel: { dataCategory: #VALUE_HELP,
representativeKey: 'FixValue',
usageType.sizeCategory: #S,
usageType.dataClass: #ORGANIZATIONAL,
usageType.serviceQuality: #A,
supportedCapabilities: [#VALUE_HELP_PROVIDER, #SEARCHABLE_ENTITY],
modelingPattern: #VALUE_HELP_PROVIDER }
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@search.searchable: true
@Consumption.ranked: true
@Metadata.ignorePropagatedAnnotations: true
@EndUserText.label: 'List value'
define view <my_sh_2>
with parameters
value_dd : sxco_ad_object_name --abap.char(30)
as select from <my_cds_1> ( domain_name_2: $parameters.value_dd ) as a
{
@ObjectModel.text.element: ['FixValue']
@search.defaultSearchElement: true
@search.fuzzinessThreshold: 0.8
@search.ranking: #HIGH
key a.DomainValue as FixValue,
@Semantics.text: true
@search: { defaultSearchElement: true, ranking: #LOW }
a.Description as ValueText
}

 value_dd is parameter used in final CDS DDCDS_CUSTOMER_DOMAIN_VALUE_T (parameter = p_domain_name).

@Consumption.valueHelpDefinition: [
{ entity: { name: '<my_sh_2>',
element: 'FixValue' } },
{ additionalBinding: [ { parameter : 'value_dd',
element: '<domain_name>',
usage: #FILTER_AND_RESULT
} ] }
]
<ui_element>

But in Metadata Extension: is possible to pass "value_dd" parameter value to filter result with CDS parameter?

I try this combination but don't work correct:

Any idea to pass a correct value to Parameter value to Search-help cds?