In the below program there r 2 input fields. Material No. and Plant. when ever I enter a particular Material No. In the selection screen and If i press F4 on palnt field I am getting relevent plants for that material. But This is happening when ever I press enter button after giving input in material No field. But my requirement is i should get relevent plant when I press F4 on plant field even though I dont press enter button .
REPORT ZBC_BC1 .
TABLES: MARA, MARC.
PARAMETERS: MATNR TYPE MARA-MATNR.
PARAMETERS: WERKS TYPE MARC-WERKS.
TYPES : BEGIN OF TY_MARC ,
WERKS TYPE MARC-WERKS ,
END OF TY_MARC.
DATA : IT_MARC TYPE STANDARD TABLE OF TY_MARC.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR WERKS.
SELECT WERKS FROM MARC INTO TABLE IT_MARC WHERE MATNR EQ MATNR.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
RETFIELD = 'WERKS'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_WERKS'
VALUE_ORG = 'S'
VALUE_TAB = IT_MARC.
WRITE: / ' this is for testing'.