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: 

F4 help in module pool porgramming

geetha_k
Active Participant
0 Kudos

Hi to all,

I have small requirement in SD module ,create a module pool programming. In the selection screen, plant code will be select on the selection of company code. I have taken the module PROCESS ON VALUE-REQUEST. and taken the function module F4IF_INT_TABLE_VALUE_REQUEST. Am getting the plant code in the F4 help related to company code. But it is not selecting in that field, i mean in plant code field in screen. can u give me any ideas y its not selecting.

6 REPLIES 6

Former Member
0 Kudos

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

1. First go to SE11 and create your own search help

2. Now in your module pool program 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.

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 a 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

Former Member
0 Kudos

Hi Geetha,

Go to Screen Painter SE51. Double click on that field where you want F4 help. It will open Attiribute Window.

In Attributes, it is having an option Poss. Entries Key. Select its value as '1' and activate your screen.

Now check whether your F4 help is working or not ?

Let me know also.

Regards,

Nitin.

Former Member
0 Kudos

hi,

are u passing the all the values..


CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    TABNAME                   = 'YRJEMPDETAIL'  "table name
    FIELDNAME                 = 'L_NAME'             "name of field in table
*   SEARCHHELP                = ' '                           
*   SHLPPARAM                 = ' '                           
   DYNPPROG                  = 'SAPMZRJ_HELP' " program name
   DYNPNR                    = '9000'                       "screen number
   DYNPROFIELD               = 'LAST_NAME'     "field name
*   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.

hope this helps

Regards

Ritesh

Former Member
0 Kudos

Hi,

in F4IF_INT_TABLE_VALUE_REQUEST FM, in tables there is return_tab along with value_tab.

declare a table of type ddshretval with header line and provide in retun_tab value.

Regards,

Sunny

Former Member
0 Kudos

Also check Parameters in your FM:

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'CODEGRUPPE'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'ZCSTR_USERSTATUS-CODEGRUPPE'

value_org = 'S'

TABLES

value_tab = it_f4codegroup

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.

Regards,

Nitin.

Former Member
0 Kudos

Hi Geetha,

Please Share where the problem was....

Regards,

Nitin.