You are on page 1of 15

Search Helps

Or
The Possibilities of Possible
Values

by
Allan Davidson





1. Different types of value help
A. Simple list
1. From check table te!t table " used for value list that chan#es by application or by
confi#uration
$. From domain fi!ed value list " doesn%t chan#e e!cept by development
&. Pro#rammed usin# an internal table and function module T'(F)(H*+P ,or others-
.. Search help , Formerly matchcode -
1. *lementary search help " list of values
$. /ollective search help ,set of elementary helps-
$. 0sin# search helps
A. Help settin#s ,1enu path HelpSettin#s-
.. Shortcuts
/. Personal help lists " these are #enerated and handled by the system. They sho2
2hen no
matches are found or if you leave the field blank.
D. Tips 3 Tricks
&. Pro#rammin# search helps
A. /reatin# search helps 2ith S*44
.. Pro#rammin# in reports
/. Pro#rammin# in screens
Overvie2





*!ample5 Table T664 is a list of company codes
maintained by confi#uration.
The check table is linked to the field in the dictionary
by maintainin# the
forei#n key relationship. ,Sho2n here linked to
.7PF".07'S-
Simple list5 check table





*!ample5 Field .7PF".STAT is linked to data element
.STAT(D8
2hich is linked to domain .STAT8 2hich has a fi!ed list
of values.
Simple list5 domain





Internal table T_CECAT has already been flled with a list of legend codes and
descriptions. See program ZFMANAL8, screen parameter Legend Code
form f_legend_code changing p_lc.
data! begin of w_title,
code"#$ type c value %LC%,
descr"#&$ type c value %'escription9,6:&-8
end of w_title.
data sel_id( li)e sy*tabi(.
call f+nction %T,_-_.EL/%
e(porting
i0_title 1 %Select Legend Code%"&2$
is_sel_title3 1 w_title
i0_n+mber_of_rows 1 3#
i0_no_of_)ey_col+mns 1 1
i0_with_printer_icon 1 %4%
tables
it_sel_table 1 t_cecat
changing
c0_selected_inde( 1 sel_id(
e(ceptions
no_lines 1 1
no_line_pic)ed 1 #
others 1 5.
chec) sy*s+brc 1 &.
read table t_cecat inde( sel_id(.
p_lc 1 t_cecat*cecat.
endform. 6 -_LE7E8'_C9'E
Simple list5 pro#rammed





An elementary search help provides the list of values
Search help5 elementary





A collective search help is the ob;ect that holds a set of
elementary search helps.
Search help5 collective





1enu path5 HelpSettin#s
0sin# search helps5 Help settin#s





0sin# search helps5 shortcuts
The short cut for the input help permits you to restrict the hit list and reduce the number of dialo# steps even
before selectin# the input help ,F)-.
The short cut permits you to select an elementary search help from a collective search help and to assi#n the
selection fields in the dialo# bo! for restrictin# values.
<our entry must have the follo2in# pattern in the input field before you press F) or call the input
help.
Pattern of the short notation5
=H7.S4.S$.S& etc.
2here5
H75 short cut of the elementary search help. >t does not have to be specified if only one elementary search
help is assi#ned to the field or
if the elementary search help stored as default search help should be used. The separator %.% follo2in# the
short cut can be omitted if S4
consists of more than one character.

S4 to S& are the restrictions that are entered in this order in the correspondin# dialo# bo! for restrictin#
values. *ach entry is considered
to be a pattern 2ith a final %?%. 'estrictions for fields that could not accept input are
i#nored.
*!ample5
=b.lh.frankfurt is entered in the input field. There is a collective search help 2ith several elementary search
helps for the field. >f you
press F)8 the hit list is displayed immediately.

The search help 2ith short cut . is selected invisibly for the user. The hit list is selected 2ith the restriction
%+H?% for the first field and
%F'A@7F0'T?% for the second field of the dialo# bo! for restrictin#
values.

@ote
Ahen you select an elementary search help 2ith the short cut8 no ne2 default search help is stored. The
default search help stored for each
user and collective search help is only reset 2hen you select an elementary search help usin# the selection
dialo# bo!.





0sin# search helps5 personal help lists
These are #enerated and handled by the system. They sho2
2hen no matches are found or if you leave the field blank.
*!ample5 A.AP editor search help for pro#ram name.
<ou can delete entries from this list or navi#ate to other
search helps.





0sin# search helps5 tips 3 tricks
1. Pressin# F) even 2hen there is no do2n arro2 sometimes
#ets you value help.
$. >n technical info for a field8 2hen you see B=B for the
search help8 it means that
the search help for that field is used. To find the name
of the search help used8
double"click the field name in the popup8 2hich takes
you to the dictionary.
Then double"click on the table field8 2hich #ives you
the field details.





/reatin# search helps
Description of fields5
Selection method5 name of table or vie2 2here the data is stored.
Text table5 Filled in by system8 if a te!t table is attached to the selection method.
Dialog type:5 Determines 2hether the user is presented 2ith a selection screen before the
hit list is displayed. Possible values5
A C Dialo# depends on set of values. >f there are more than 466 hits8 a selection screen is
displayed. Other2ise8 the hit list is displayed immediately.
D " Display values immediately.
/ C Dialo# 2ith value restriction. A selection screen is al2ays displayed.
Hot key5 allo2s user to type a shortcut into the field to bypass selection of elementary
search help.
Search help exit5 " specify the name of a function module to be called durin# the search
help process ,more later-.
Search help parameters5 Specify the names of parameters to be passed in out8 or
additional fields to be used as filters for data.
IMP5 /heck this bo! to indicate that the field is an input field8 that is8 to be passed to the
search help.
!P5 /heck this bo! to indicate that the field is an output field8 that is8 to be passed from
the search help to the screen.
"P#S5 The position of the as it appears in the hit list.
SP#S5 The position of the field as it appears in the selection screen.
SDIS5 /auses the field to be Ddisplay onlyE in the selection screen.
Data element5 Sets the attributes of the search help parameter. @ormally filled in by the
system.
M#D5 /heck this bo! to assi#n a different data element than the one supplied by the
system.
De$ault value5 Specify the default value in one of & 2ays5 a 9literalF,in Guotes-8 a
parameter >D,H'D-8
or a system field ,S<"0@A1*-.

<ou create search helps in the data dictionary.





Search Help Hierarchy





About the Parameter ID - it looks like you just create a name and description (via
transaction SE80 Edit !bject so"t button#$
%ou de"ine the data type via the command &SE' PA(A)E'E( ID$& *ater you can
use this Parameter ID +,(D+ to set a date$
-.date / sy-datum$
SE' PA(A)E'E( ID +0(D+ 1IE*D -.date$
'odayFs date 2ill appear in the transport reGuest field
Parameter >D





Search help e!its " 1
/allcontrol"step5 This field is set by the system and can be
chan#ed by your code. The function module 2ill be called
once for each step of the process8 2ith some conditional
e!ceptions noted belo2.
S*+O@* C before selectin# an elementary search help.
P'*S*+4 C after selectin# an elementary search help.
P'*S*+ C before sendin# the dialo# bo! for restrictin#
values.
S*+*/T " before selectin# the values.
D>SP " before displayin# the hit list.
'*T0'@ " set by your code if one hit 2as found
durin# selection.
'*TTOP C follo2s '*T0'@ if called from a collective
search help
*I>T C set by your code. Terminates the search help
process
/'*AT* " if the user selects the function D/reate ne2
valuesB.

<ou can chan#e the behavior of search helps 2ith a search
help e!it. /opy the SAP supplied function module
F)>F(SH+P(*I>T(*IA1P+*. This module is 2ell
documented ,for a chan#eJ-8 but here are some hi#hli#hts5
TA.+* parameters5
SH"P%T&' " contains information about the search
help fields and structures.
'*/O'D(TA. C contains the hit list.
/HA@K>@K parameters5
SH+P C additional information about the parameters.
,Deep structure-
/A++/O@T'O+ C instructions for controllin# the
search help process.





/A++/O@T'O+"ST*P 1
1$ SE*!2E
3all be"ore selectin4 an elementary search help$ 'he possible elementary search helps are already
in SHLP_TAB$ 'his timepoint can be used in a search help e5it o" a collective search help to restrict
the selection possibilities "or the elementary search helps$
Entries that are deleted "rom SHLP_TAB in this step are not o""ered in the elementary search help
selection$ I" there is only one entry remainin4 in SHLP_TAB the dialo4 bo5 "or selectin4 elementary
search helps is skipped$ %ou may not chan4e the ne5t timepoint$
'he timepoint is not accessed a4ain i" another elementary search help is to be selected durin4 the
dialo4$
6$ P(ESE*7
A"ter selectin4 an elementary search help$ 'able INTERFACE has not yet been copied to table
SE*!P' at this timepoint in the de"inition o" the search help (type S8*P.DES3(.'#$ 'his means
that you can still in"luence the attachment o" the search help to the screen here$ ('able INTERFACE
contains the in"ormation about ho- the search help parameters are related to the screen "ields#$
9$ P(ESE*
:e"ore sendin4 the dialo4 bo5 "or restrictin4 values$ 'his timepoint is suitable "or prede"inin4 the
value restriction or "or completely suppressin4 or copyin4 the dialo4$
;$ SE*E3'
:e"ore selectin4 the values$ I" you do not -ant the de"ault selection you should copy this timepoint
-ith a search help e5it$ DISP should be set as the ne5t timepoint$
<$ DISP
:e"ore displayin4 the hit list$ 'his timepoint is suitable "or restrictin4 the values to be displayed e$4$
dependin4 on authori=ations$





/A++/O@T'O+"ST*P $
>$ (E'?(2 (usually as return value "or the ne5t timepoint#
'he (E'?(2 timepoint should be returned as the ne5t step i" a sin4le hit -as selected in a search
help e5it$
It can make sense to chan4e the 1; "lo- at this timepoint i" control o" the process se@uence o" the
'ransaction should depend on the selected value (typical e5ampleA settin4 SE'BCE' parameters#$
8o-ever you should note that the process -ill then depend on -hether a value -as entered
manually or -ith an input help$
D$ (E''!P
%ou only 4o to this timepoint i" the input help is controlled by a collective search help$ It directly
"ollo-s the timepoint (E'?(2$ 'he search help e5it o" the collective search help ho-ever is called
at timepoint (E''!P$
8$ EEI' (only "or return as ne5t timepoint#
'he EEI' timepoint should be returned as the ne5t step i" the user had the opportunity to terminate
the dialo4 -ithin the search help e5it$
F$ 3(EA'E
'he 3(EA'E timepoint is only accessed i" the user selects the "unction &3reate ne- values&$ 'his
"unction is only available i" "ield 3?S''A: o" the control strin4 3A**3!2'(!* -as 4iven a value
not e@ual to SPA3E earlier on$
'he name o" the (customi=in4# table to be maintained is normally entered there$ 'he ne5t step
returned a"ter 3(EA'E should be SE*E3' so that the ne-ly entered value can be selected and
then displayed$
10$ APP7 APP6 APP9
I" "urther pushbuttons are introduced in the hit list -ith "unction module 1;?'.*IS'.EEI' these
timepoints are introduced$ 'hey are accessed -hen the user presses the correspondin4
pushbutton$





Search help e!its " $
::: This f+nction is a search help e(it for ;_T,<9,, * search
::: help for transport re=+est n+mber. It%s p+rpose is to limit the
::: hit list to transports released within the last >& days, and to
::: sort the hit list in descending order.
data delete_date li)e sy*dat+m.
data w_selopt li)e line of shlp*selopt.
::: 'efa+lt the selection date to " sy*dat+m * >& $ ? today.
::: Also flter o+t blan) target systems to flter o+t tas)s.
if callcontrol*step 1 %/,ESEL3%.
delete_date 1 sy*dat+m * >&.
w_selopt*shlpfeld 1 %AS'ATE%.
w_selopt*sign 1 %I%.
w_selopt*option 1 %7T%.
w_selopt*low 1 delete_date.
append w_selopt to shlp*selopt.
w_selopt*shlpfeld 1 %TA,S@STEA%.
w_selopt*sign 1 %E%.
w_selopt*option 1 %EB%.
w_selopt*low 1 space.
append w_selopt to shlp*selopt.
endif.
::: Sort the hit list.
if callcontrol*step 1 %'IS/%.
sort record_tab descending.
callcontrol*sortoC 1 %4%.
endif.
Sample code from function module
H(0T(F)(T'7O''(SH(*I>T





Pro#rammin# in reports
>f there is a search help linked to a dictionary field ,either directly to the field or to its data
element-8 then definin# a report parameter +>7* the dictionary field 2ill brin# in the search
help functionality for you. <ou mi#ht 2ant to specify the search help yourself for the
follo2in# reasons5
There is no search help attached to the dictionary field.
<ou 2ant to use a different search help than the one attached to the dictionary field.
<ou 2ant to specify 2hich elementary search help to use8 rather than allo2 the user
to see the collective search help.
This e!ample forces the selection screen to adopt the elementary search help H1>DA8
rather than use the collective search help H1>D8 2hich is attached to the dictionary field.

Parameters5 p(mitid like Lmitid"mitid.
Parameters5 p(mitid like Lmitid"mitid matchcode ob;ect H1>DA.
<ou can pro#ram your o2n possible values directly. /ode the event AT S*+*/T>O@"
S/'**@ O@ (&") '*M0*ST FO' Nfield nameO8 then 2rite the code to produce the
list. The system creates the possible values button for you.





Pro#rammin# in screens
Specify the search help name in the screen element list. >f you specify a reference field
2hich has a search help
attached8 leave the search help field blank and the system 2ill use the attached search help.
<ou can also code your o2n value"help. Define the screen field 2ith a possible entries key
,set in field attributes-. Then code a module for the field under P'O/*SS O@ (&")"
'*M0*ST. <ou can use the function modules D<@P(VA+0*S('*AD and
D<@P(VA+0*S(0PDAT* to effect field transfer to from the screen8 since this is not
done durin# value reGuest.

Pro#ram HF1A@A+P " screen parameter +e#end /ode
Accordin# to the documentation for T'(F)(H*+P8 iv(number(of(ro2s is ho2 many ro2s
the dialo# bo! contains. This is not e!actly accurate because it varies accordin# to platform8
but this parameter does control the relative len#th of the dialo# bo!.

You might also like