Enhancing Elementary search helps in SAP:search help exit for elementary search help
Very often we face requirements to influence the contents returned when f4 help is pressed.In case of collective search help we have procedures to influence the contents returned or write our own logic .
If there is no exits(after pressing F4) and your field in fact uses a elementary search help then also we can influence the contents returned via source code plug in.
Let us take an example scenario: Requirement is to suppress few entries from desc of illness field (when F4 is pressed) in time of record creation at PA30 for a particular subtype .
Now if we need to supress specific entries from final output after F4 is pressed we can use an implicit enhancement point , location of the enhancement is shared below
At end of subroutine get_values_sh, before the endform statement we need to modify the value_tab internal table based on variable
SHLP–SHLPNAME which will contain the search help name for which F4 is pressed. Thus in our case when F4 is pressed for field UMSKD as search help for this field is H_T572B so SHLP–SHLPNAME will contain H_T572B.
If we create an implicit enhancement before endform statement we can write our business logic to influence the end content returned when F4 is pressed.
This include is used whenever F4 help is pressed for any field so we need to be careful to influence only the fields we want, as stated we can simply do it using SHLP–SHLPNAME variable which will hold the search help exit.
Inside the block highlighted we can write our business logic . we need to validate it with the string column in value tab to determine which entries to be discarded.
This way we can overcome the setbacks when we need to influence elementary search help returns.
P.S: This is an alternate way to influence F4 help return list(particularly elementary search helps), In case any easier way do exist then kindly inform,
In case it is useful would like to hear in the scenarios it is utilized.