Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

F4 help: selection not returned second time

PriyankaAgarwal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,066

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

4 REPLIES 4
Read only

Former Member
0 Likes
817

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

Read only

0 Likes
817

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

Read only

MarcinPciak
Active Contributor
0 Likes
817

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

Read only

PriyankaAgarwal
Product and Topic Expert
Product and Topic Expert
0 Likes
817

Hi Marcin,

Thanks a lot. It worked :).

Regards,

Priyanka