Sunday, December 19, 2010
REPORT zvenkat_f4_for_parameters MESSAGE-ID zmsg .
TYPES:BEGIN OF t_t001w,
werks       TYPE t001w-werks,
name1       TYPE t001w-name1,
END OF t_t001w,
t_return_tab  TYPE ddshretval.
DATA:w_t001w      TYPE t_t001w,
w_return_tab TYPE t_return_tab.
DATA:i_t001w      TYPE STANDARD TABLE OF t_t001w,
i_return_tab TYPE STANDARD TABLE OF t_return_tab.
DATA:w_dynpfields TYPE dynpread,
i_dynpfields LIKE STANDARD TABLE OF dynpread.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS :p_werks TYPE t001w-werks,
p_name1 TYPE t001w-name1.
SELECTION-SCREEN END OF BLOCK b1.
"F4 Help for Werks

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
IF i_t001w[] IS INITIAL.
SELECT werks name1
FROM t001w
INTO TABLE i_t001w.
ENDIF.
"Function module for F4 help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield    = 'WERKS'   "field name on f4 help window
dynpprog    = sy-repid
dynpnr      = sy-dynnr
dynprofield = 'P_WERKS' "Screen field name
value_org   = 'S'
TABLES
value_tab   = i_t001w
return_tab  = i_return_tab.
READ TABLE i_return_tab INTO w_return_tab INDEX 1.
p_werks = w_return_tab-fieldval.
READ TABLE i_t001w INTO w_t001w WITH KEY werks = p_werks.
IF sy-subrc = 0.
w_dynpfields-fieldname    = 'P_NAME1'.
w_dynpfields-fieldvalue   = w_t001w-name1.
APPEND w_dynpfields TO i_dynpfields.
CLEAR w_dynpfields.
"DYNP_VALUES_UPDATE
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname     = sy-repid
dynumb     = sy-dynnr
TABLES
dynpfields = i_dynpfields.
ENDIF. 

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.