Skip to Content
Author's profile photo Amy King

Using Importing/Exporting Search Help Parameters in Web Dynpro ABAP

Overview

When providing search helps for View fields, developers frequently need to achieve two things,

  1. Pass into the search help importing parameters to restrict the search help values.
  2. On return from the search help, populate multiple View fields based on the value selected in the search help.

Both things are possible by defining your context node to have a dictionary structure whose components use the same search help. This article shows the step-by-step procedure both to pass multiple View field values to a search help’s importing parameters and to pass multiple search help exporting parameters to a View’s fields.

Scenario

You require an employee search help that allows the user to restrict search help values based on values the user enters into three View fields: Personnel Number, First Name and Last Name. The View must also populate these three fields, Personnel Number, First Name and Last Name, based on the employee selected in the search help.

Procedure

1.0 Create an Elementary Search Help

Create an elementary search help having the import and export parameters you plan to use in the View. In this example, we use search help Z_EMPLOYEE_SHLP_DEMO, which both imports and exports Personnel Number, First Name and Last Name.

demo_searchhelp.PNG

2.0 Create a Dictionary Structure

Create a structure in the data dictionary having the same fields that are imported and exported by the search help. Here, we name the structure ZEMPLOYEE_DEMO_S. On the Entry help/check tab, assign the same search help, Z_EMPLOYEE_SHLP_DEMO, to each component. This creates a mapping between the search help parameters and the structure components.

demo_ddic_struc.PNG

3.0 Create the Context Node

In the COMPONENTCONTROLLER context, create a node named EMPLOYEE and assign it dictionary structure ZEMPLOYEE_DEMO_S. Use the Add Attribute from Structure button to add each of the components of the structure to the node as attributes.

demo_node.PNG

demo_context.PNG

4.0 Create the View Layout

Map the EMPLOYEE node from the COMPONENTCONTROLLER context to the View context. Using the Form Template wizard, create input fields for the three context attributes, Personnel Number, First Name and Last Name.

demo_form_wizard.PNG

demo_view_layout.PNG

5.0 Create and Run the Web Dynpro Application

Create a Web Dynpro Application and run the application.

Result

Values the user enters in the Personnel Number, First Name and Last Name input fields are passed into the search help as importing parameters. After clicking the Start Search button and selecting a record from the search help hit list, each of the search help’s exporting parameters are mapped automatically to the context attributes, populating each of the Personnel Number, First Name and Last Name input fields.

demo_app_before.PNG

demo_app_during.PNG

demo_app_during2.PNG

demo_app_after.PNG

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Amy,

                   is there restriction of node cardinality to  1:1.

      regards

      jitendra

      Author's profile photo Amy King
      Amy King
      Blog Post Author

      Hi Jitendra,

      The search help actually acts on an element (or an attribute) of a node, so the node itself can have any cardinality.

      Cheers,

      Amy

      Author's profile photo Former Member
      Former Member

      I create a node with 0.n cardinality and 3 subnode with cardinality 0.n.

      In one of the subnode i need to assgin suggestive search on one  attribute and at same time needs to assign value to other attribute.its showing me correct result but result display are not binding with other attribute other then attribute at which suggestive search is assign on selecting.

      Author's profile photo Amy King
      Amy King
      Blog Post Author

      Hi Jitendra,

      Do you mean that upon selecting a value from the InputField's suggested values, you want the other attributes to auto-populate based on the suggested value? I don't believe it is possible to affect the behavior of suggest values like that. The suggest values behavior of an InputField doesn't take into account other attributes that may be exported by the same search help.

      Unfortunately you also cannot do this programmatically using a hook method because suggest values doesn't adhere to the phase model. From the documentation on Proposals for InputFields:

      • Proposals attempt to be available as quickly as possible. The proposals trigger a roundtrip, without running the Phase Model. For this reason you cannot affect the results by means of action handlers or WDDOMODIFYIEW...
      • Note that the proposals do not support OVS, nor user-programmed input help.

      Cheers,

      Amy

      Author's profile photo Former Member
      Former Member

      Hi Amy,

      • Pass into the search help importing parameters to restrict the search help values. ( this is not working for me )

      i have created a structure which has same  import and export parameters as in the search help , created a context node and field binding as you have explained.

      • On return from the search help, populate multiple View fields based on the value selected in the search help.( this working as you have exlained )

      what could be wrong , plz help

      Author's profile photo Prasanna CD
      Prasanna CD

      Hi Amy,

      Nice Post. I have a user requirement to hide below highlighted fields of OVS popup.

      Kindly suggest if that is possible.

      Thanks in Advance.