{"id":7747,"date":"2025-09-06T01:16:18","date_gmt":"2025-09-05T19:46:18","guid":{"rendered":"https:\/\/www.sapewmhelp.com\/?question=search-help-and-value-help-in-sap-rap-restful-abap-programming-model"},"modified":"2025-09-06T01:16:18","modified_gmt":"2025-09-05T19:46:18","slug":"search-help-and-value-help-in-sap-rap-restful-abap-programming-model","status":"publish","type":"question","link":"https:\/\/www.sapewmhelp.com\/?question=search-help-and-value-help-in-sap-rap-restful-abap-programming-model","title":{"rendered":"Search Help and Value Help in SAP RAP (RESTful ABAP Programming Model)"},"content":{"rendered":"<p><strong>search help\/value help<\/strong> is not implemented in the classic way (with SE11 search helps + F4 help). Instead, RAP follows the <strong>Fiori and OData paradigm<\/strong>:<\/p>\n<ul>\n<li><strong>Search Help (free text search):<\/strong> Implemented via <code>@Search<\/code> annotations on CDS views.<\/li>\n<li><strong>Value Help (F4 help \/ dropdowns):<\/strong> Implemented via associations + <code>@Consumption.valueHelpDefinition<\/code> annotations.<\/li>\n<\/ul>\n<h5>1. Search Help in RAP<\/h5>\n<p>Search is enabled using annotations in the <strong>Projection View<\/strong> or <strong>Consumption View<\/strong>.<\/p>\n<p>@Search.searchable: true<br \/>define view entity ZI_Book<br \/>as select from zbook<br \/>{<br \/>key book_id,<br \/>title,<br \/>author,<br \/>publisher<br \/>}<\/p>\n<ul>\n<li><code>@Search.searchable: true<\/code> \u2192 Allows free-text search across all fields.<\/li>\n<li>You can refine it:<\/li>\n<\/ul>\n<p>@Search.defaultSearchElement: true<br \/>title,<\/p>\n<p>@Search.defaultSearchElement: true<br \/>author<\/p>\n<p>&nbsp;<\/p>\n<h5>2. Value Help in RAP<\/h5>\n<p>For dropdowns or F4 helps, you define <strong>associations<\/strong> and annotate them.<\/p>\n<h6>Step 1: Define Value Help View<\/h6>\n<p>@EndUserText.label: &#8216;Value Help for Publishers&#8217;<br \/>define view entity ZI_PublisherVH<br \/>as select from zpublisher<br \/>{<br \/>key publisher_id,<br \/>name<br \/>}<\/p>\n<p>&nbsp;<\/p>\n<h6>Step 2: Add Association in Main View<\/h6>\n<p>define view entity ZI_Book<br \/>as select from zbook<br \/>association [0..1] to ZI_PublisherVH as _Publisher<br \/>on $projection.publisher_id = _Publisher.publisher_id<br \/>{<br \/>key book_id,<br \/>title,<br \/>publisher_id,<br \/>_Publisher<br \/>}<\/p>\n<p>&nbsp;<\/p>\n<h6>Step 3: Annotate Value Help<\/h6>\n<p>@Consumption.valueHelpDefinition: [<br \/>{ entity: { name: &#8216;ZI_PublisherVH&#8217;, element: &#8216;publisher_id&#8217; } }<br \/>]<br \/>publisher_id,<\/p>\n<p>&nbsp;<\/p>\n<p>Now in Fiori, <code>publisher_id<\/code> will show F4 help with dropdown based on <code>ZI_PublisherVH<\/code>.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","question-category":[175],"question_tags":[178,201,199,200,177],"class_list":["post-7747","question","type-question","status-publish","hentry","question-category-rap","question_tags-abap","question_tags-btp","question_tags-cds","question_tags-rap","question_tags-sap"],"_links":{"self":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question\/7747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/question"}],"about":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7747"}],"wp:attachment":[{"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7747"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion-category&post=7747"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/www.sapewmhelp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fquestion_tags&post=7747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}