0% found this document useful (0 votes)
160 views7 pages

Search Help Exit

SEARCH HELP EXIT

Uploaded by

Lyrical heaven
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
160 views7 pages

Search Help Exit

SEARCH HELP EXIT

Uploaded by

Lyrical heaven
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

SEARCH HELP EXIT ASSIGNMENT

Search Help Exit

1.Search help exit is a function module with a predefined interface(import/export/input/output is given


by SAP itself)

Example for Function Module is : F4IF_SHLP_EXIT_EXAMPLE.

Important Parameters in Search help exit

1.SHLP : This is parameter for current search help.

2.CALL CONTROL : Parameter which controls the F4 help/search help

3.SHLP_TAB : Table for elementary search help.(It is for collective search help which stores all
elementary search help)

4.RECORD_TAB: Hit list/record list

CALL_CONTROL STEPS

1.SELONE - It is applicable for collective search help, it is used to select elementary search help from
collective search help.

2.PRESEL - It is used for select condition.

Ex: In case of dialog with value restriction, we will get a dialog pop-up to select the condition. This is
called PRESEL.

But in case of Display values immediately, there will be no PRESEL because their is no dialog restriction
pop up

3.SELECT : It is for selecting values based on condition

Ex: We have entered some value in dialog with value restriction ,based on that system will select only
related data.

4.DISPLAY: After selecting it will display the values.

5.RETURN : It returns the value to the screen fields.

***********************************************************************

1) in collective search help we have 4 elementary search helps and user wants to display 2 elementary
search helps how to restrict the elementary search helps by using search help exit ?
CREATED COLLECTIVE SEARCH HELP WITH 4 ELEMENTARY SEARCH HELP

BY USING SEARCH HELP EXIT WE CAN RESTRICT NO.OF ELEMENTARY SEARCH


HELP
PARAMETER USED : CALLCONTROL-STEP-’SELONE’.

ONLY 2 ELEMENTARY SEARCH HELP HAS DISPLAYED


2) in selection screen F4 help user wants to hold the multiple records based on conditions need to
display output ?
For SELECTION CONDITION we should go for CALLCONTROL-STEP = ‘PRESEL’.
IN SHLP we have component called SELOPT its an internal table for any select conditions we
should fill SHLP_SELOPT internal table.

ELEMENTARY SEARCH HELP where user want to display records based on condition
Ex: Based on ORDER STATUS user want to display the order id. So the order status which has
values of ‘Deliverd ’ and ‘Pending ’ should be displayed.

BEFORE PRESEL WE ARE INSERTING VALUES INTO INTERNAL TABLE AND


TRANSFERRING IT TO SELOPT.
Only values of selected conditions are selected and displayed

******************************************
If we want to restrict the dialog box in case of dialogue with value restriction we use
Callcontrol-step = 'SELECT' ,this will skip that pop-up and directly gives the values directly.
3) if we have one record in f4 help it should automatically populate the record.
For the same search help condition above here we are giving condition so that user get values
automatically populated on screen if hit list contains single record.
This is possible by CALLCONTROL_STEP = ‘DISP’
After selection condition (PRESEL) we need to check the no.of records in RECORD_TAB and
if it contains single row then make CALLCONTROL_STEP = ‘RETURN’.
data: lv_lines type i .
IF callcontrol-step = 'PRESEL'.

DATA: lv_wa TYPE ddshselopt, " work area for shlp-selopt


lv_itab TYPE DDSHSELOPS. " internal table for shlp-selopt which is
of table type

" filling values to internal table through work area

lv_wa-shlpname = 'ZCH_ESH4_ORDER'.
lv_wa-shlpfield = 'ORDER_STATUS'.
lv_wa-sign = 'I'.
lv_wa-option = 'EQ'.
lv_wa-low = 'DELIVERED'.

APPEND lv_wa TO lv_itab. " one value has inserted


lv_wa-shlpname = 'ZCH_ESH4_ORDER'.
lv_wa-shlpfield = 'ORDER_STATUS'.
lv_wa-sign = 'I'.
lv_wa-option = 'EQ'.
lv_wa-low = 'PENDING'.

APPEND lv_wa TO lv_itab. " second condition

shlp-selopt = lv_itab.

* CALLCONTROL-STEP = 'SELECT'.
ENDIF.

IF callcontrol-step = 'DISP'. “BEFORE GOING TO DISPLAY THE HITLIST

describe TABLE RECORD_TAB lines lv_lines.

if lv_lines = 1. “CHECKING CONDITION


CALLCONTROL-STEP = 'RETURN'. "ASSIGNING CALLCONTROL STEP TO RETURN

endif.

ENDIF.

SELCTING THE CONDITION which has single record

The value got automatically populated.

You might also like