Entering content frame

Example Example for Search Helps Locate the document in its SAP Library structure

Each customer of a carrier (see Structure link Flight Model) or of a travel agency has a customer number. You want to find a search option for this customer number.

The user must be offered two different search paths.

You can provide the required search option by creating a collective search help SCUSTOM. Two elementary search helps SCUSTOM_NAME (for searching with the customer data) and SCUSTOM_BOOK (for searching with the existing bookings) are created for the actual search paths. These elementary search helps are included in the collective search help.

Elementary Search Help SCUSTOM_NAME

This elementary search help should enable you to search for the customer number using the name and address (street, city, country). All this data is contained in table SCUSTOM. Table SCUSTOM must therefore be selected as the selection method of the elementary search help.

This graphic is explained in the accompanying text

You now have to decide which fields of the selection method are needed for the input help process. These are the fields that should appear either in the dialog box for restricting values or in the hit list.

In the dialog box for restricting values, the user should be able to restrict values with the customer’s name and address, i.e. the fields for the street, city and country. These fields as well as the customer’s number (the information to be found must always be in the hit list) should appear in the hit list. The fields ID, NAME, STREET, CITY and COUNTRY of table SCUSTOM must be included in the search help as parameters.

The parameter ID is declared to be an import parameter. A pattern entered in the corresponding field of a screen template can therefore be used directly for the value selection. Restrictions for the other parameters of the search help must be entered in the dialog box for value selection.

All the parameters of the search help are declared to be export parameters. As a result, all the parameters of the hit list can be returned to the screen template if the corresponding fields are available there.

Elementary Search Help SCUSTOM_BOOK

This elementary search help should enable you to search for the customer number using existing customer bookings. The flight data for the booking (flight number, date of flight, city of departure, city of arrival) and the name of the customer should be used for the search here. This data is distributed on the tables SBOOK (bookings), SCUSTOM (name) and SPFLI (cities of departure and arrival). The following graphic shows the relationship between the relevant tables, that is the existing foreign key relationships.

This graphic is explained in the accompanying text

In this case a database view SCUS_BOOK must be created on these three tables (see Structure link Example for Views) as selection method. The tables in the view (join) are linked as defined by the existing foreign key relationships (see Structure link Foreign Key Relationship and Join Condition).

This graphic is explained in the accompanying text

In the dialog box for restricting values, the user should be able to restrict the search for booking data with the carrier ID, customer name, city of departure and city of arrival The flight date and of course the customer number should also be displayed in the hit list. Fields CARRID, FLDATE, CUSTOMID, NAME, CITYFROM and CITYTO of view SCUS_BOOK must be included in the elementary search help as parameters of the search help.

The parameter CUSTOMID is declared to be an import parameter. All the parameters of the search help are export parameters.

Collective Search Help SCUSTOM

The two elementary search helps are now included in the collective search help. You must now allocate the parameters of the elementary search helps to the parameters of the collective search help.

This graphic is explained in the accompanying text

The parameter ID of the collective search help is marked as an import parameter. All the parameters are export parameters. The values can thus be copied from the hit list to the screen template.

Attaching the Search Help

In order to be able to use the search help SCUSTOM in screen templates, the attachment of the search help (see Attaching Search Helps with Screen Fields) must be defined.

Attaching to the Check Table SCUSTOM

The search help should be available for all the fields that are checked against table SCUSTOM. The search help therefore must be attached to table SCUSTOM. The search help parameters must therefore be assigned to the key fields of table SCUSTOM.

The parameter ID of search help SCUSTOM is here assigned to the field ID of table SCUSTOM in this field assignment. No assignment is possible for all other parameters of the search help (NAME, CITY and COUNTRY) since table SCUSTOM does not contain this information as key fields.

Attaching to a Field of Table SCUSTOM

In order that the search help is available when the field SCUSTOM-ID is directly copied to the input template, you have to attach the search help to this field.

With this type of attachment, all the parameters of the search help can be assigned to the corresponding fields of the table.

This graphic is explained in the accompanying text

Leaving content frame