Application Development and Automation 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: 
Read only

F4 help

Former Member
0 Likes
363

Hi Everyone,

How to create F4 help for a field in selection screen.

Could any please help me

3 REPLIES 3
Read only

Former Member
0 Likes
339

hi,

here is some info...........

If you created a search help in the DDIC...Then check the check box EXPORt parameter for one of the fields

If you used the function module Make sure you pass the correct values..Also the field name in CAPITAL letters..

Check this code..

TABLES: T005T.

DATA: BEGIN OF t_t005 OCCURS 0,

land1 TYPE t005-land1,

END OF t_t005.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(6) v_text FOR FIELD P_LAND1.

PARAMETERS: p_land1 TYPE t005-land1.

SELECTION-SCREEN COMMENT 13(35) v_text1.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

v_text = 'Country'.

v_text1 = ' '.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_land1.

REFRESH: t_t005.

SELECT land1

INTO TABLE t_t005

FROM t005.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'T005'

PVALKEY = ' '

retfield = 'LAND1'

dynpprog = sy-repid

DYNPNR = sy-dynnr

dynprofield = 'P_LAND1'

callback_program = sy-repid

value_org = 'S'

TABLES

value_tab = t_t005

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.

other way would be..............

SELECT-OPTIONS: selcrit for <data>.

Now use

AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-LOW.

*Using the FM F4IF_INT_TABLE_VALUE_REQUEST to show the F4

AT SELECTION-SCREEN ON VALUE-REQUEST FOR selcrit-HIGH.*Using the FM F4IF_INT_TABLE_VALUE_REQUEST to show the F4

Read only

Former Member
0 Likes
339

Hi,

First you create a serch help in the se11 t-code for that particular field.

Now assign that serch help with the syntax match code object beside the field.

press f1 for further help.

Use this piece of code

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_belnr-HIGH .

Select all the required BELNR values into a table i_belnr to be displayed in the search help in the below form.

perform select.

perform help.

&----


*& Form help

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form help.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'BELNR'

  • PVALKEY = ' '

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 'S_BELNR-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_belnr

  • 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.

pls go through this for search help creation

http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm

Regards,

Read only

varma_narayana
Active Contributor
0 Likes
339

Hi

This is the Sample program for F4 help on Selection Screen.

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.