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

ABAP - F4 (Value On Request) For A Field Of Ztable On Selection Screen.

*--crete a z table with 2 fields and name(10) and age(2) and create entries..

REPORT MESSAGE-ID ZMSF.

TABLES:ZZZ000000 ,DFIES.

DATA: BEGIN OF ITAB OCCURS 0,
NAME(10) ,
AGE(2),
END OF ITAB.

DATA : LT_FIELDS TYPE TABLE OF DFIES WITH HEADER LINE,
LS_FIELD TYPE DFIES.

PARAMETER: P_NAME(10) TYPE C.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_NAME.

REFRESH ITAB.
REFRESH LT_FIELDS.

LT_FIELDS-TABNAME = 'ZZZ00000'.
LT_FIELDS-FIELDNAME = 'NAME'.
APPEND LT_FIELDS.
CLEAR LT_FIELDS .

LT_FIELDS-TABNAME = 'ZZZ00000'.
LT_FIELDS-FIELDNAME = 'AGE'.
LT_FIELDS-POSITION = '2'.

APPEND LT_FIELDS.
CLEAR LT_FIELDS .


SELECT NAME
AGE FROM ZZZ00000
INTO TABLE ITAB.


CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = LT_FIELDS-FIELDNAME
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'NAME'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
FIELD_TAB = LT_FIELDS.

No comments:

Post a Comment