‎2009 Aug 21 10:36 AM
Dear Colleagues,
I am trying to restrict the values of a domain by building my own value help.
The values are getting restricted and also shown in the pop up.But the problem is that first time the value gets selected and shown on the dynpro screen. But second time if I select a different value, the dynpro field is not getting updated.
I am using the FM:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'DOMVALUE_L'
tabname = 'ZTCAFI'
fieldname = 'CATSPOSI'
value_org = 'S'
dynprofield = 'ZTCAFI-CATSPOSI'
dynpprog = sy-repid
dynpnr = sy-dynnr
TABLES
value_tab = lt_table
return_tab = lt_ret
field_tab = lt_field_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
REFRESH dynfields.
READ TABLE lt_ret INTO ls_ret INDEX 1.
IF sy-subrc = 0.
dynfields-fieldname = ls_ret-retfield.
dynfields-fieldvalue = ls_ret-fieldval.
APPEND dynfields.
ENDIF.
Update the dynpro values.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dynfields
EXCEPTIONS
OTHERS = 8.
ENDIF.
The Problem is that lt_ret doesnt return any record on second time selection.
Could anyone please tell me why the function module doesnt return any value on selecting second time from the F4 pop up screen.
Thanks,
Priyanka
‎2009 Aug 21 12:16 PM
Use FM 'C14Z_DYNP_READ_FIELD'
For Instance it should be like below
Data : v_field(255) type c.
CALL FUNCTION 'C14Z_DYNP_READ_FIELD'
EXPORTING
i_program = sy-repid
i_dynpro = sy-dynnr
i_fieldname = 'V_PLANT' "here specify your own field which u want to read
i_flg_steploop = ''
CHANGING
e_value = v_field. "Specify the variable inwhich u want to have the value and based on that u select other F4 help entries
Venkat
‎2009 Aug 21 12:28 PM
Hi Venkat,
It doesnt seem to work.
I have done the following.Did i miss something.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KEY'
tabname = 'ZTCAFI'
fieldname = 'CATSPOSI'
value_org = 'S'
dynprofield = 'ZTCAFI-CATSPOSI'
dynpprog = sy-repid
dynpnr = sy-dynnr
TABLES
value_tab = lt_value_tab
return_tab = lt_ret
field_tab = lt_field_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc = 0.
DATA : v_field(255) TYPE c.
CALL FUNCTION 'C14Z_DYNP_READ_FIELD'
EXPORTING
i_program = sy-repid
i_dynpro = sy-dynnr
i_fieldname = 'CATSPOSI' "here specify your own field which u want to read
i_flg_steploop = ''
CHANGING
e_value = v_field. "Specify the variable inwhich u want to have the value and based on that u select other F4 help entries
ENDIF.
Priyanka
‎2009 Aug 21 12:52 PM
Ensure you are calling FM F4IF_INT_TABLE_VALUE_REQUEST in POV and don't use return_tab parameter. Instead return picked value directly to screen field.
"screen
PROCESS ON VALUE-REQUEST.
FIELD connection MODULE pov. "connection is my field here
"program
MODULE pov INPUT.
DATA: PROGNAME LIKE SY-REPID,
DYNNUM LIKE SY-DYNNR.
progname = sy-repid.
dynnum = sy-dynnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CONNID'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CONNECTION' "return directly to screen field
VALUE_ORG = 'S'
TABLES
VALUE_TAB = VALUES_TAB.
ENDMODULE.
Regards
Marcin
‎2009 Aug 24 4:20 AM