Category Archives: ABAP

How to add search help to selection parameter?

 

I was looking for help to add search help in selection parameter. But I didn’t find any simple one to understand. So I am going to explain for the beginner how to add search help in selection parameter.

DATA:  it_return TYPE STANDARD TABLE OF ddshretval,
wa_return LIKE LINE OF it_return.
PARAMETERS: p_traid TYPE likp-traid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_traid.

*-->; Now call FM F4IF_FIELD_VALUE_REQUEST

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'likp'
fieldname = 'TRAID'
searchhelp = 'ZTRAID'
TABLES
return_tab = it_return[]
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5 .
IF sy-subrc <;> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

*-->; Read it_return table data and assign to the parameter.

IF sy-subrc EQ 0.
READ TABLE it_return INTO wa_return INDEX 1.
p_traid = wa_return-fieldval.
ENDIF.

 

image

image