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: 

Re: F4 functionality

Former Member
0 Kudos

Hi all,

How to give the f4 functionality for a specific field with out going to the Dictionary, I know we have to call a function module for that, On which event we have to call this function module.

regards,

Sashi,

3 REPLIES 3

Former Member
0 Kudos

At selction screen on value request for field name

varma_narayana
Active Contributor
0 Kudos

Hi..

This is the Example code:

REPORT zsel_f4help .

*---Report with selection screen and to display the list of

  • possible entries for field 'B' as per the value in field 'A'.

PARAMETERS: p_vbeln TYPE vbak-vbeln,

p_posnr TYPE vbap-posnr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.

DATA: BEGIN OF help_item OCCURS 0,

posnr TYPE vbap-posnr,

matnr TYPE vbap-matnr,

arktx TYPE vbap-arktx,

END OF help_item.

DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.

dynfields-fieldname = 'P_VBELN'.

APPEND dynfields.

**Read the Values of the SCREEN FIELDs

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = dynfields

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.

**Find out the Value of P_VBELN

READ TABLE dynfields WITH KEY fieldname = 'P_VBELN'.

p_vbeln = dynfields-fieldvalue.

**Convert the Value into internal format

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = p_vbeln

IMPORTING

output = p_vbeln.

**Fetch the correponding itemnos from VBAP

SELECT posnr matnr arktx INTO TABLE help_item

FROM vbap

WHERE vbeln = p_vbeln.

**Generate the F4 help with internal table values

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'POSNR'

dynprofield = 'P_POSNR'

dynpprog = sy-cprog

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = help_item.

REWARD IF HELPFUL.

Former Member
0 Kudos

hi,

you can directly attach f4 help to any field you want on selection screen.

select-option: s_matnr for mara-matnr matchcode object searchhelpname.

this way you can assign any help here.