Steps for implementing search help exit
- Create a function module copying "F4IF_SHLP_EXIT_EXAMPLE"
- Declare an internal table and work area which is same as search help structure
- Go to source code tab. Then go to "IF CALLCONTROL-STEP = 'SELECT'." section of the code
- Populate the internal table with required data
- Implement another function module "F4UT_PARAMETER_RESULTS_PUT"
Sample Code:
IF CALLCONTROL-STEP = 'SELECT'.
SELECT * FROM ZDISP_PENDING INTO CORRESPONDING FIELDS OF TABLE @it. "Populating Internal Table
DATA t_fields LIKE TABLE OF shlp_tab-fielddescr.
DATA w_fields LIKE LINE OF shlp_tab-fielddescr.
LOOP AT shlp_tab.
LOOP AT shlp_tab-fielddescr INTO w_fields.
DATA l_fname TYPE dfies-lfieldname.
l_fname = w_fields-fieldname.
SELECT * FROM ZDISP_PENDING INTO CORRESPONDING FIELDS OF TABLE @it. "Populating Internal Table
DATA t_fields LIKE TABLE OF shlp_tab-fielddescr.
DATA w_fields LIKE LINE OF shlp_tab-fielddescr.
LOOP AT shlp_tab.
LOOP AT shlp_tab-fielddescr INTO w_fields.
DATA l_fname TYPE dfies-lfieldname.
l_fname = w_fields-fieldname.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = w_fields-fieldname
* OFF_SOURCE = 0
* LEN_SOURCE = 0
* VALUE =
FIELDNAME = l_fname
tables
shlp_tab = shlp_tab
record_tab = record_tab
SOURCE_TAB = it_disp "Internal Table
CHANGING
shlp = shlp
callcontrol = callcontrol
* EXCEPTIONS
* PARAMETER_UNKNOWN = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDLOOP.
ENDLOOP.
IF sy-subrc EQ 0.
callcontrol-step = 'DISP'.
ELSE.
callcontrol-step = 'EXIT'.
ENDIF.
EXIT. "Don't process STEP DISP additionally in this call.
ENDIF.
Steps to assign this search help exit to the required search help
- Go to SE11
- Enter into the search help in change mode
- Assign the created function module in the search help exit field.
Comments
Post a Comment