2008 Mar 07 12:34 PM
Hello
i have 2 fields in a screen. Field1 and Field2
i enter the field1 and want to set the f4 help for second field field2 on the basis of the input in field1.
but when i enter field1 and press f4 help for field2, it doesnot work because the field1 values are not passed when i use process on value request for field2 .
please help .... what am i missing.
Thanks
2008 Mar 07 12:53 PM
Hi ,
you have to use "DYNP_VALUES_READ" function mdule to read the field1 value to process in "F4IF_INT_TABLE_VALUE_REQUEST" function module.
check the code below
declare one internal table like this.
data dynpro_values type table of dynpread.
add the fields which you want to read.
field_value-fieldname = Z_POLCY-BUKRS'.
append field_value to dynpro_values.
field_value-fieldname = 'Z_POLCY-WERKS'.
append field_value to dynpro_values.
call function 'DYNP_VALUES_READ'
exporting
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
tables
dynpfields = dynpro_values
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
others = 11
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'POLTYPE'
PVALKEY = ' '
dynpprog = progname
dynpnr = dynnum
dynprofield = 'z_POLCY-POLTYPE'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = it_poltype
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING = it_ret
exceptions
parameter_error = 1
no_values_found = 2
others = 3
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
regards
shibu
*check the code for syntax i just given one prototype
2008 Mar 07 12:53 PM
Hi ,
you have to use "DYNP_VALUES_READ" function mdule to read the field1 value to process in "F4IF_INT_TABLE_VALUE_REQUEST" function module.
check the code below
declare one internal table like this.
data dynpro_values type table of dynpread.
add the fields which you want to read.
field_value-fieldname = Z_POLCY-BUKRS'.
append field_value to dynpro_values.
field_value-fieldname = 'Z_POLCY-WERKS'.
append field_value to dynpro_values.
call function 'DYNP_VALUES_READ'
exporting
dyname = progname
dynumb = dynnum
translate_to_upper = 'X'
REQUEST = ' '
PERFORM_CONVERSION_EXITS = ' '
PERFORM_INPUT_CONVERSION = ' '
DETERMINE_LOOP_INDEX = ' '
tables
dynpfields = dynpro_values
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
others = 11
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
DDIC_STRUCTURE = ' '
retfield = 'POLTYPE'
PVALKEY = ' '
dynpprog = progname
dynpnr = dynnum
dynprofield = 'z_POLCY-POLTYPE'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
tables
value_tab = it_poltype
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING = it_ret
exceptions
parameter_error = 1
no_values_found = 2
others = 3
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endif.
regards
shibu
*check the code for syntax i just given one prototype
2008 Mar 07 1:31 PM
shibuettickal,
thanks dude,
it solved my probelm ... i rewarded you full points.
Thanks,
Hem
2008 Mar 07 12:55 PM
hi,
u need to press enter after entering data in field1 then only it will have data in field1.
reward if usefull...
2008 Mar 07 1:32 PM
Dhwani shah,
thanks for helping me ... ánd for your efforts.
thanks
hem