‎2008 Aug 31 10:49 AM
Hi ,
I am having 2 parameters on Selection-Screen.
Also in Z table I am having two fields and both are Primary Keys.
Fields on screen are linked with these 2 parameters as F4 help.
My requirement is that, when on running program, on F4 of first parameter,
if I select one value of field, corresponding value of 2nd field must come in second parameter.
Pls guide.
Raja
‎2008 Aug 31 11:52 AM
Use Event
AT SELECTION-SCREEN OUTPUT.
write code here to get data in another field.
Hope this is enough for you.
Rajiv singh.
‎2008 Aug 31 11:52 AM
Use Event
AT SELECTION-SCREEN OUTPUT.
write code here to get data in another field.
Hope this is enough for you.
Rajiv singh.
‎2008 Aug 31 12:09 PM
This example and fm may help you
source from sourceveda.com
tables: t001w.
DATA: lc_werks LIKE t001w-werks,
ltab_fields LIKE help_value OCCURS 0 with header line,
BEGIN OF ltab_values OCCURS 0,
feld(40) TYPE c,
END OF ltab_values.
*-- Set up fields to retrieve data
ltab_fields-tabname = 'T001W'.
ltab_fields-fieldname = 'WERKS'.
ltab_fields-selectflag = 'X'.
APPEND ltab_fields.
ltab_fields-tabname = 'T001W'.
ltab_fields-fieldname = 'NAME1'.
ltab_fields-selectflag = space.
APPEND ltab_fields.
*-- Fill values
select * from t001w.
ltab_values-feld = t001w-werks.
append ltab_values.
ltab_values-feld = t001w-name1.
append ltab_values.
endselect.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
EXPORTING
fieldname = 'WERKS'
tabname = 'T001W'
title_in_values_list = 'Select a value'
IMPORTING
select_value = lc_werks
TABLES
fields = ltab_fields
valuetab = ltab_values
EXCEPTIONS
field_not_in_ddic = 01
more_then_one_selectfield = 02
no_selectfield = 03.
‎2008 Aug 31 2:57 PM
HI Rishi
Use this function module 'F4IF_INT_TABLE_VALUE_REQUEST'
check this for ur reference.
REPORT z_test11 .
PARAMETERS:
p_carrid(2).
DATA: table1 LIKE
ddshretval
OCCURS 0 WITH HEADER LINE.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_carrid.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'scarr'
fieldname = 'carrid'
SEARCHHELP = ' '
SHLPPARAM = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = 'p_carrid'
STEPL = 0
VALUE = ' '
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
SELECTION_SCREEN = ' '
TABLES
return_tab = table1
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.
p_carrid = table1-fieldval.
START-OF-SELECTION.
WRITE: p_carrid.
Best Rgards
Pravin