Application Development 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: 

F4IF_INT_TABLE_VALUE_REQUEST

Former Member
0 Kudos

Hi Frendz,

What is the use of functional module F4IF_INT_TABLE_VALUE_REQUEST, can any give sample program using the above functional module? full points for those who gives good example....

Regards

Vijaya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

This FM is used for F4 Help(Search Help) ie.,it displays the possible entries for that field from the internal Table.

At first we will select the values from the Database Table & pass it to Internal Table.In this Function Module,u have to Pass 'retfield' of the Internal Table & internal Table Name in the 'value_tab' field.

Regards,

Padmam.

6 REPLIES 6

Former Member
0 Kudos

Hi Vijaya,

This example is for search help for material type .

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_mtart-low .

select all material types you want to display in search help into table i_mtart.

PERFORM select_material_type.

PERFORM help_material_type.

&----


*& Form help_material_type

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM help_material_type .

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'MTART'

  • PVALKEY = ' '

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'S_MTART-LOW'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = i_mtart

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

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.

ENDFORM. " help_material_type

Hope this helps you.

Former Member
0 Kudos

Hi,

This FM is used for F4 Help(Search Help) ie.,it displays the possible entries for that field from the internal Table.

At first we will select the values from the Database Table & pass it to Internal Table.In this Function Module,u have to Pass 'retfield' of the Internal Table & internal Table Name in the 'value_tab' field.

Regards,

Padmam.

Former Member
0 Kudos

TYPES: BEGIN OF TY_STPO,

STLKN LIKE STPO-STLKN,

IDNRK LIKE STPO-IDNRK,

MEINS LIKE STPO-MEINS,

MENGE LIKE STPO-MENGE,

END OF TY_STPO.

DATA: BEGIN OF TEMP_STPO OCCURS 0,

IDNRK LIKE STPO-IDNRK,

END OF TEMP_STPO.

*&--- SY-REPID & SUB SCREEN NO .

DATA : D_REPID TYPE SY-REPID ,

D_SUBSCR TYPE SY-DYNNR ,

L_STLNR TYPE STNUM.

DATA: OK_1234(20),

SCR_NO TYPE SY-DYNNR.

DATA : IT_STPO TYPE STANDARD TABLE OF TY_STPO WITH HEADER LINE.

CONTROLS : TABSTRIP1 TYPE TABSTRIP.

CONTROLS : TAB_CTRL1 TYPE TABLEVIEW USING SCREEN '0002'.

TABLES: MAST, STPO, Z8STPO.

&----


*& Module EXIT_PROG INPUT

&----


module EXIT_PROG input.

IF OK_1234 = 'EX01'.

SET SCREEN 0.

LEAVE PROGRAM.

ENDIF.

endmodule. " EXIT_PROG INPUT

&----


*& Module USER_COMMAND_0001 INPUT

&----


  • text

----


MODULE USER_COMMAND_0001 INPUT.

      • BREAK-POINT.

ENDMODULE. " USER_COMMAND_0001 INPUT

&----


*& Module get_scr_no OUTPUT

&----


  • text

----


MODULE get_scr_no OUTPUT.

*import p1 = scr_no from memory id 'SCRN' .

IF OK_1234 IS INITIAL.

D_SUBSCR = '0001'.

ENDIF.

D_REPID = SY-REPID.

ENDMODULE. " get_scr_no OUTPUT

&----


*& Module USER_COMMAND INPUT

&----


  • text

----


MODULE USER_COMMAND INPUT.

CASE OK_1234 .

WHEN 'FC01' .

D_SUBSCR = '0001'.

TABSTRIP1-ACTIVETAB = 'FC01'.

WHEN 'FC02'.

D_SUBSCR = '0002'.

TABSTRIP1-ACTIVETAB = 'FC02' .

WHEN 'GET1' OR 'GET2'.

REFRESH IT_STPO.

CLEAR : L_STLNR, IT_STPO.

SELECT STLNR

INTO L_STLNR FROM MAST

UP TO 1 ROWS

WHERE MATNR = MAST-MATNR AND WERKS = MAST-WERKS .

ENDSELECT.

SELECT STLKN

IDNRK

MEINS

MENGE

INTO TABLE IT_STPO

FROM STPO WHERE STLNR = L_STLNR.

D_SUBSCR = '0002'.

TABSTRIP1-ACTIVETAB = 'FC02' .

ENDCASE .

ENDMODULE. " USER_COMMAND INPUT

&----


*& Module SET_VALUES OUTPUT

&----


  • text

----


MODULE SET_VALUES OUTPUT.

READ TABLE IT_STPO INDEX TAB_CTRL1-CURRENT_LINE.

ENDMODULE. " SET_VALUES OUTPUT

&----


*& Module GENERATE_HELP INPUT

&----


MODULE GENERATE_HELP INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = 'MARA'

FIELDNAME = 'MATNR'

  • SEARCHHELP = ' '

  • SHLPPARAM = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

  • DYNPROFIELD = ' '

  • STEPL = 0

  • VALUE = ' '

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • SUPPRESS_RECORDLIST = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • SELECTION_SCREEN = ' '

  • IMPORTING

  • USER_RESET =

  • TABLES

  • RETURN_TAB =

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.

ENDMODULE. " GENERATE_HELP INPUT

&----


*& Module CREATE_DROPDOWN INPUT

&----


  • text

----


MODULE CREATE_DROPDOWN INPUT.

SELECT IDNRK FROM STPO INTO TABLE TEMP_STPO.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'IDNRK'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = TEMP_STPO

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

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.

Rewar points if helpful

Regards

Nilesh

Former Member
0 Kudos

Vijaya,

This is good document for your question...

Input Help in Dialog Modules

You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.

PROCESS ON VALUE-REQUEST.

...

FIELD <f> MODULE <mod>.

...

After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. The module <mod> is defined in the ABAP program like a normal PAI module. However, the contents of the screen field <f> are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.

Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. In this case, there are some standard function modules that you can use in the POV event. They support search helps, as well as all other kinds of input help, and are responsible for data transport between the screen and the input help. These all have the prefix F4IF_. The most important are:

F4IF_FIELD_VALUE_REQUEST

Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.

F4IF_INT_TABLE_VALUE_REQUEST

This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.

There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.

Input help in dialog modules

REPORT DEMO_DYNPRO_F4_HELP_MODULE.

TYPES: BEGIN OF VALUES,

CARRID TYPE SPFLI-CARRID,

CONNID TYPE SPFLI-CONNID,

END OF VALUES.

DATA: CARRIER(3) TYPE C,

CONNECTION(4) TYPE C.

DATA: PROGNAME LIKE SY-REPID,

DYNNUM LIKE SY-DYNNR,

DYNPRO_VALUES TYPE TABLE OF DYNPREAD,

FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,

VALUES_TAB TYPE TABLE OF VALUES.

CALL SCREEN 100.

MODULE INIT OUTPUT.

PROGNAME = SY-REPID.

DYNNUM = SY-DYNNR.

CLEAR: FIELD_VALUE, DYNPRO_VALUES.

FIELD_VALUE-FIELDNAME = 'CARRIER'.

APPEND FIELD_VALUE TO DYNPRO_VALUES.

ENDMODULE.

MODULE CANCEL INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE VALUE_CARRIER INPUT.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

TABNAME = 'DEMOF4HELP'

FIELDNAME = 'CARRIER1'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'CARRIER'.

ENDMODULE.

MODULE VALUE_CONNECTION INPUT.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = PROGNAME

DYNUMB = DYNNUM

TRANSLATE_TO_UPPER = 'X'

TABLES

DYNPFIELDS = DYNPRO_VALUES.

READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.

SELECT CARRID CONNID

FROM SPFLI

INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB

WHERE CARRID = FIELD_VALUE-FIELDVALUE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'CONNID'

DYNPPROG = PROGNAME

DYNPNR = DYNNUM

DYNPROFIELD = 'CONNECTION'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = VALUES_TAB.

ENDMODULE.

The next screen (statically defined) for screen 100 is itself. It has the following layout:

The input fields have been adopted from the program fields CARRIER and CONNECTION. The pushbutton has the function code CANCEL with function type E.

The screen flow logic is as follows:

PROCESS BEFORE OUTPUT.

MODULE INIT.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

PROCESS ON VALUE-REQUEST.

FIELD CARRIER MODULE VALUE_CARRIER.

FIELD CONNECTION MODULE VALUE_CONNECTION.

When the user chooses input help for the individual fields, the following is displayed:

For the Airline field, the POV module VALUE_CARRIER is called. The function module F4IF_FIELD_VALUE_REQUEST displays the input help for the component CARRIER1 of the structure DEMOF4HELP from the ABAP Dictionary, namely the search help DEMOF4DE. The user’s selection is returned to the screen field CARRIER.

For the Flight number field, the POV module VALUE_CONNECTION is called. The function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the user’s selection into the screen field CONNECTION.

Don't forget to reward if useful.....

Former Member
0 Kudos

this FM is used to create a dynamic search help for a screen field. it finds most use when your field is not referring to a dictionary field or data element and thus a custom search help needs to be attached to it.

you need to fill up an internal table with values that you need to display in search help and pass this table to this function module.

see the following example....

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_indice.

CLEAR wa_dynpread.

REFRESH itab_dynpread.

wa_dynpread-fieldname = 'P_BUKRS'.

APPEND wa_dynpread TO itab_dynpread.

CLEAR wa_dynpread.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = itab_dynpread

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.

READ TABLE itab_dynpread INTO wa_dynpread WITH KEY fieldname = 'P_BUKRS'.

IF sy-subrc = 0.

p_bukrs = wa_dynpread-fieldvalue.

IF p_bukrs IS NOT INITIAL.

SELECT zzindice zzdesc FROM zindice INTO TABLE itab_indice_hlp WHERE bukrs = p_bukrs.

IF itab_indice_hlp IS NOT INITIAL.

SORT itab_indice_hlp BY zzindice.

DELETE ADJACENT DUPLICATES FROM itab_indice_hlp COMPARING zzindice.

ENDIF.

ENDIF.

ENDIF.

IF itab_indice_hlp[] IS NOT INITIAL.

SORT itab_indice_hlp BY zzindice.

DELETE ADJACENT DUPLICATES FROM itab_indice_hlp COMPARING zzindice.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ZZINDICE' "this is field of internal table which is returned

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P_INDICE' "screen field in which value should come

value_org = 'S'

TABLES

value_tab = itab_indice_hlp "internal table with values

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

ENDIF.

regards,

Priyank

Former Member
0 Kudos
chk the demo program

REPORT demo_dynpro_f4_help_module .

TYPES: BEGIN OF values,
         carrid TYPE spfli-carrid,
         connid TYPE spfli-connid,
       END OF values.

DATA: carrier(3) TYPE c,
      connection(4) TYPE c.

DATA: progname TYPE sy-repid,
      dynnum   TYPE sy-dynnr,
      dynpro_values TYPE TABLE OF dynpread,
      field_value LIKE LINE OF dynpro_values,
      values_tab TYPE TABLE OF values.

CALL SCREEN 100.

MODULE init OUTPUT.
  progname = sy-repid.
  dynnum   = sy-dynnr.
  CLEAR: field_value, dynpro_values.
  field_value-fieldname = 'CARRIER'.
  APPEND field_value TO dynpro_values.
ENDMODULE.

MODULE cancel INPUT.
  LEAVE PROGRAM.
ENDMODULE.

MODULE value_carrier INPUT.

  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
       EXPORTING
            tabname     = 'DEMOF4HELP'
            fieldname   = 'CARRIER1'
            dynpprog    = progname
            dynpnr      = dynnum
            dynprofield = 'CARRIER'.

ENDMODULE.

MODULE value_connection INPUT.

  CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            dyname             = progname
            dynumb             = dynnum
            translate_to_upper = 'X'
       TABLES
            dynpfields         = dynpro_values.

  READ TABLE dynpro_values INDEX 1 INTO field_value.

  SELECT  carrid connid
    FROM  spfli
    INTO  CORRESPONDING FIELDS OF TABLE values_tab
    WHERE carrid = field_value-fieldvalue.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
            retfield    = 'CONNID'
            dynpprog    = progname
            dynpnr      = dynnum
            dynprofield = 'CONNECTION'
            value_org   = 'S'
       TABLES
            value_tab   = values_tab.

ENDMODULE.