Register Login

Add F4 help to a field on SCREEN (MODULE POOL)

Updated Jan 22, 2020

Adding F4 help to a field on MODULE POOL Programming

In order to add F4 help to a field in module pool follow these steps:-

  1. First, go to SE11 and create your own search help (if you don't know how to create a search help please feel free to ask me, it is very easy).
  2. Now in your module pool program go to the layout of your screen.
  3. Now when you see the attributes of this field in the Dict tab you will find the field Search Help. Now here you can specify the name of the search help you created in SE11.

There is also another method to create the dynamic search help. eg:- in a posted document data get the Document nos related to that company code.

The sample code is like this:-

First of all, declare the module below in the flow logic of your screen then create it in your main program.

You declare the module in the PROCESS ON VALUE-REQUEST.

PROCESS ON VALUE-REQUEST.
FIELD TXT_DOCNO MODULE VALUE_BELNR.

You also need to create an internal table where you wil store results of the select query fired below in the module.

here you will get an F4 help on the filed Document Number (TXT_DOCNO) based on the field Company code (TXT_CODCO)

MODULE VALUE_BELNR INPUT.

progname = sy-repid.
dynnum = sy-dynnr.
CLEAR: field_value, dynpro_values.
field_value-fieldname = 'TXT_CODCO'.
APPEND field_value TO dynpro_values.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'BKPF'
fieldname = 'BUKRS'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TXT_CODCO'.

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 BUKRS BELNR
FROM BKPF
INTO CORRESPONDING FIELDS OF TABLE it_doc1
WHERE BUKRS = field_value-fieldvalue.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'BELNR'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'TXT_BELNR'
value_org = 'S'
TABLES
value_tab = it_doc1.

ENDMODULE. " VALUE_BELNR INPUT


Comments

  • 14 Aug 2008 3:18 pm Guest
    can somebody suggest me..i've an internal table to be passed to a field on module pool screen n get F4 functionality(when i clk F4 the values shud b shown are frm internal table)
  • 17 Jan 2010 8:38 am Guest

    hai i'm new to ABAP. i created one two tables hotel master and hotel details. In hotel master table contain hotel id etc.. In hotel details have Hotel id ,package id,package name etc.. I created one module pool program here i created two input/output fields one is to select the hotel id another one is for package id. first i select the hotel id in first field. second is package id here i press f4 it will display only the package id for what i selected in the previous one hotel id. not all package how can i create any one assist me.


×