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: 

Please give answer

Former Member
0 Kudos
140

Hi,

In selection-screen one parameter is there But we are not enter any value but We press f4 some window have to diaplay,

To do that in selction-screen in which event we have to write code and what code we have to write.

But we have to do that useing only code,We are not createing any serch help here.Useing only event in selection-screen.

Please give me answer.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
95

Hi

Use this sample code.

*--- on this event

At Selection-screen on <parameter-name>. <<<- your parameter name declared in report

Check this sample code below..Check the return table T_RETURN..You will get multiple records..

TYPE-POOLS: shlp.

DATA: sh TYPE shlp_descr_t.


DATA: lt_f4 LIKE ddshretval OCCURS 0 WITH HEADER LINE.

PARAMETERS: p_plnty TYPE plnty.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plnty.


DATA: interface LIKE ddshiface OCCURS 0 WITH HEADER LINE.

DATA: v_plnnr TYPE plnnr.
DATA: v_plnal TYPE plnal.


sh-shlpname = 'PLKS'.
sh-shlptype = 'SH'.

CALL FUNCTION 'DD_SHLP_GET_DIALOG_INFO'
CHANGING
shlp = sh.

interface-shlpfield = 'PLNNR'.
interface-valfield = 'V_PLNNR'.
APPEND interface.


interface-shlpfield = 'PLNAL'.
interface-valfield = 'V_PLNAL'.
APPEND interface.

sh-interface[] = interface[].



DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: v_subrc TYPE sysubrc.

CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = sh
disponly = ' '
IMPORTING
rc = v_subrc
TABLES
return_values = t_return.


BREAK-POINT.

Or

Alternatively

*--- on this event

At Selection-screen on <parameter-name>. <<<- your parameter name declared in report

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname = 'PLKO'
    fieldname = 'PLNNR'
    searchhelp = 'PLKS'
  TABLES
    return_tab = lt_f4
  EXCEPTIONS
    field_not_found = 1
    no_help_for_field = 2
    inconsistent_help = 3
    no_values_found = 4
  OTHERS = 5.

<b>Please let me know if you are not getting the correct results...</b>

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

4 REPLIES 4

Former Member
0 Kudos
96

Hi

Use this sample code.

*--- on this event

At Selection-screen on <parameter-name>. <<<- your parameter name declared in report

Check this sample code below..Check the return table T_RETURN..You will get multiple records..

TYPE-POOLS: shlp.

DATA: sh TYPE shlp_descr_t.


DATA: lt_f4 LIKE ddshretval OCCURS 0 WITH HEADER LINE.

PARAMETERS: p_plnty TYPE plnty.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plnty.


DATA: interface LIKE ddshiface OCCURS 0 WITH HEADER LINE.

DATA: v_plnnr TYPE plnnr.
DATA: v_plnal TYPE plnal.


sh-shlpname = 'PLKS'.
sh-shlptype = 'SH'.

CALL FUNCTION 'DD_SHLP_GET_DIALOG_INFO'
CHANGING
shlp = sh.

interface-shlpfield = 'PLNNR'.
interface-valfield = 'V_PLNNR'.
APPEND interface.


interface-shlpfield = 'PLNAL'.
interface-valfield = 'V_PLNAL'.
APPEND interface.

sh-interface[] = interface[].



DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: v_subrc TYPE sysubrc.

CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = sh
disponly = ' '
IMPORTING
rc = v_subrc
TABLES
return_values = t_return.


BREAK-POINT.

Or

Alternatively

*--- on this event

At Selection-screen on <parameter-name>. <<<- your parameter name declared in report

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
  EXPORTING
    tabname = 'PLKO'
    fieldname = 'PLNNR'
    searchhelp = 'PLKS'
  TABLES
    return_tab = lt_f4
  EXCEPTIONS
    field_not_found = 1
    no_help_for_field = 2
    inconsistent_help = 3
    no_values_found = 4
  OTHERS = 5.

<b>Please let me know if you are not getting the correct results...</b>

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Former Member
0 Kudos
95

Hi,

Try this code

Call the program, use F4 to call search help standard window

in debug, look at RETURN TABLE to see values

Hope this will help,

    • Please rewind point if it helps **

Tony


REPORT  ZTESTTONY1.
TYPE-POOLS: shlp.

DATA: sh TYPE shlp_descr_t.


DATA: lt_f4 LIKE ddshretval OCCURS 0 WITH HEADER LINE.

PARAMETERS: p_plnty TYPE plnty.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_plnty.


DATA: interface LIKE ddshiface OCCURS 0 WITH HEADER LINE.

DATA: v_plnnr TYPE plnnr.
DATA: v_plnal TYPE plnal.


sh-shlpname = 'PLKS'.
sh-shlptype = 'SH'.

CALL FUNCTION 'DD_SHLP_GET_DIALOG_INFO'
CHANGING
shlp = sh.

interface-shlpfield = 'PLNNR'.
interface-valfield = 'V_PLNNR'.
APPEND interface.


interface-shlpfield = 'PLNAL'.
interface-valfield = 'V_PLNAL'.
APPEND interface.

sh-interface[] = interface[].

DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: v_subrc TYPE sysubrc.

CALL FUNCTION 'F4IF_START_VALUE_REQUEST'
EXPORTING
shlp = sh
disponly = ' '
IMPORTING
rc = v_subrc
TABLES
return_values = t_return.


BREAK-POINT.

Former Member
0 Kudos
95

Hi,

if you know the screen no/ window and the program name when f4 is pressed you can pass these value in the following function module . try to check this.

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = 'LTAP'

fieldname = 'KZDIF'

    • SEARCHHELP = ' '

    • SHLPPARAM = ' '

dynpprog = 'program name'

dynpnr = '4060'

dynprofield = 'LTAP-KZDIF'

  • STEPL = 0

  • VALUE = ' '

  • MULTIPLE_CHOICE = ' '

display = 'F'

  • SUPPRESS_RECORDLIST = ''

  • CALLBACK_PROGRAM = ''

  • CALLBACK_FORM = 'X'

SELECTION_SCREEN = ' '

  • IMPORTING

USER_RESET =

TABLES

return_tab = lt_myreturn

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.

ELSE.

READ TABLE lt_myreturn INDEX 1 INTO lv_myreturn.

gv_output-kzdif = lv_myreturn-fieldval.

ltap-kzdif = lv_myreturn-fieldval.

ENDIF.

Br,

Laxmi

*

  • ENDIF.

Former Member
0 Kudos
95

Hi,

check this link.

http://help.sap.com/saphelp_nw2004s/helpdata/en/79/34a246d9b511d1950e0000e8353423/content.htm

check the DEMO_SELECTION_SCREEN_EVENTS program in se38.

Regards,

Sruthi