Google Search - Blog...........

ABAP - F4 (Value On Request) For Parameter On Selection Screen.

REPORT ztests .

PARAMETERS: p_name(10).

DATA: BEGIN OF value_tab OCCURS 0,
name(10),
END OF value_tab.

DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.

DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA : x TYPE string.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.

REFRESH value_tab[].
REFRESH field_tab[].
REFRESH return_tab[].

field_tab-fieldname = 'ERNAM'.
field_tab-tabname = 'VBAK'.
APPEND field_tab.
value_tab-name = 'John'.
APPEND value_tab.
value_tab-name = 'Abraham'.
APPEND value_tab.
value_tab-name = 'Lingam'.
APPEND value_tab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = field_tab-fieldname
TABLES
value_tab = value_tab
field_tab = field_tab
return_tab = return_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
p_name = return_tab-fieldval.
ENDIF.


No comments:

Post a Comment