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

Former Member
0 Kudos

PLZ SUGGEST ME HOW I CAN ADD A F4 OR SEARCH HELP FOR AN INPUT FIELD.

6 REPLIES 6

Former Member
0 Kudos

Hi !

If it's a report's selection-screen you can use the

selection-screen command "MATCHCODE ID".

See online-help for parameters and select-options command.

Regards

Rainer

Some points would be nice if that helped a bit.

Former Member
0 Kudos

Hi

It depends on where your input field is.

If a field of selection-screen you have to use the event AT SELECTION-SCREEN VALUE REQUEST FOR <FIELD NAME>

If a field of a screen you can assign a search help by several ways:

- A) Yuo can assign a search help in the characteristic of the field by screen-painter;

- B) You can use the event PROCESS ON VALUE-REQUEST

You can use fm F4IF_FIELD_VALUE_REQUEST to call the search help, so:

AT SELECTION-SCREEN VALUE REQUEST FOR <FIELD NAME>.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

..............

PROCESS ON VALUE-REQUEST.

FIELD <INPUT FIELD> MODULE F4_FOR_FIELD.

MODULE F4_FOR_FIELD.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

..............

ENDMODULE.

Max

ferry_lianto
Active Contributor
0 Kudos

Hi Pawan,

You can use this FM <b>F4IF_FIELD_VALUE_REQUEST</b>.

Please check this sample codes.

REPORT ZTEST01.
 
TYPE-POOLS: shlp.
 
DATA: lt_return TYPE STANDARD TABLE OF ddshretval.
 
PARAMETERS: p_belnr LIKE vbkpf-belnr,
            p_gjahr LIKE vbkpf-gjahr.
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_belnr.
 
  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      tabname                   = 'VBKPF'
      fieldname                 = 'BELNR'
      searchhelp                = 'H_VBKPF'
      shlpparam                 = 'BELNR'
      dynpprog                  = 'ZSRITEST59'
      dynpnr                    = sy-dynnr
      dynprofield               = 'P_BELNR'
*     STEPL                     = 0
*     VALUE                     = ' '
*     MULTIPLE_CHOICE           = ' '
*     DISPLAY                   = ' '
*     SUPPRESS_RECORDLIST       = ' '
      CALLBACK_PROGRAM          = 'ZSRITEST59'
      CALLBACK_FORM             = 'HANDLE_F4'
    TABLES
      return_tab                = lt_return[]
    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.
 
START-OF-SELECTION.
 
*---------------------------------------------------------------------*
*       FORM handle_f4                                                *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  LT_DATA                                                       *
*  -->  LS_SHLP                                                       *
*  -->  LS_CALLCONTROL                                                *
*---------------------------------------------------------------------*
FORM handle_f4 TABLES lt_data STRUCTURE seahlpres
****The following TYPE SHLP_DESCR_T is replaced with
****SHLP_DESCR from 4.7 onwards
             CHANGING ls_shlp TYPE shlp_descr_t
                      ls_callcontrol LIKE ddshf4ctrl.
 
  DATA: lwa_interface LIKE LINE OF ls_shlp-interface.
 
  lwa_interface-valtabname = ''.
  lwa_interface-valfield = 'P_GJAHR'.
 
  MODIFY ls_shlp-interface FROM lwa_interface
  TRANSPORTING valtabname valfield
         WHERE shlpfield = 'GJAHR'.
 
ENDFORM.

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

Former Member
0 Kudos

Hi Pawan,

here is the sample code for the select options inputt fields

u can check this below links also for further assiistance

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/daeda0d7-0701-0010-8caa-edc...

Regards,

Naveen

abdul_hakim
Active Contributor
0 Kudos

For an inputfield on the selection screen u can attach as follows..

PARAMETERS P1 TYPE I MATCHCODE OBJECT <search help name>

for input field on the screen you can add it in the input field attribute "search help"...

Cheers,

Abdul

0 Kudos

hi

use matchcode object <search help name>....while defining the parameters..

gunjan