I had created a document on enhancement of standard search helps in SAP.
Kindly go through the same provide your valuable suggestions.
R/3 system has enabled a standard functionality for the users to display all possible values for an input field in the screen with input help or Search help often referred to as F4 help. When there is any custom requirement for a search help, then the standard search help could be enhanced using append search help functionality. This document illustrates the enhancement of Standard search help.
Introduction on Search Helps in SAP:
The search helps are basically classified into two types:
- Elementary search help
- Collective search help
Elementary search helps defines from where the data has to be read with the user input in the selection field and how the result has to be displayed etc. Whereas collective search helps are combination of various elementary search helps which could offer various paths for the search.
Let us consider standard search help for GL accounts-SAKO for an example.
SAKO is a collective search help which offers various search paths for a GL account.
Screenshot 1: SAKO search help for GL account
This collective search help comprises of various elementary search helps. In the below screenshot it could be found that the GL account could be searched based on various criteria.
Screen shot 2: GL account search help screen
When there is a custom requirement for the search help , this colelctive search help could be enhanced in such a way without modifying the existing one usign append search helps.
- Go to transaction SE11 and in search help provide the collective search help which has to be enhanced and choose display.
Screen shot 3: SE11 initial screen
2. In the next screen , click on Go to menu and select append search help as below.
Screen shot 4 : Append search help
3. In the screen appearing , seelct option highlighed in red below to create a new append search help.
Screen shot 5: Create new append search help
A pop up appears for providing append search help name. Provide the required name and press continue.
Scren shot 6 : Append search help name
Now the next screen appears as below. Provide the descripton for the new append search help and click on save and then activate it.
Screen shot 7 : New custom append search help
4. Now the new append search help is added to the existing collective search help.
The search help is not yet assigned to the append search help. For this we need to include an elementary search help to the newly created append search help .
5. Create an elementary search help from SE11 .
Screen shot 8 : Search help type
6. Provide the description and selection method and fields required for the user input in the search help as below.
Screen shot 10: Search help definition
The selection method determined the database table from which the value has to be fetched.
When the dialog type is gived as diaply values immediately, there is no restriction for the values.
If the value has to be restricted , the dialog type ‘Display values with restrictions’ could be selected and also search help exit has to be provided.
Screen shot 11: Dialog behaviour
A search help exit restricts the values returned by the standard search help according to the custom requirement.
7. Create a Function module with the logic required to restcit the search help values with the parameters as bewlo and assign it to the search help exit option in the elementary search help.
Scren shot 12: FM parameters
Screen shot 13: search help exit assignment
The required logic could be written in the FM to resrtict the values. In the below code , the values are restrcited based on company code, Alternate account number and GL account value
IF callcontrol–step = ‘DISP’.
LOOP AT shlp–selopt INTO f_selopt.
WHEN ‘BUKRS’. “Company code
MOVE-CORRESPONDING f_selopt TO r_bukrs.
WHEN ‘ALTKT’. “Alternate account
MOVE-CORRESPONDING f_selopt TO r_altkt.
WHEN ‘SAKNR’. “GL account
MOVE-CORRESPONDING f_selopt TO r_saknr.
SELECT bukrs saknr erdat altkt INTO TABLE gt_temp FROM skb1
WHERE bukrs IN r_bukrsAND saknr IN r_saknrAND altkt IN r_altkt.
** Build the record table with the details obtained
IF gt_temp IS NOT INITIAL.
LOOP AT gt_temp INTO gf_temp.
record_tab–string+0(10) = gf_temp–saknr.
record_tab–string+10(4) = gf_temp–bukrs.
record_tab–string+64(10) = gf_temp–altkt.
8. Now the search help could be tested from the menu bar Searchhelp-> Test or just by pressing F8.
Screen shot 14: Testing Search help
9. Provide the inputs in the selection screen and the values are obtained as follows.
Screen shot 15: Search help result
Thus the append search help could be used to enhance a standard search help without modifying the existing collective search help logic as illustarted above.