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 for select-option

Former Member
0 Likes
897

Hi,

I want to provide F4 help for a select-option field. Actually the table field of the select-option didn't have search-help.

Please let me know how to provide F4 help for this select-option. I have tried with the below code. I didn't work.

at selection-screen on s_db1.

  • CODE TO PROVIDE SEARCH-HELP

SELECT * FROM ztable

INTO TABLE gi_ztable.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'DBNAME1'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_DB1-LOW'

value_org = 'S'

TABLES

value_tab = gi_ztable

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE i799(f9) WITH text-002.

ENDIF.

Regards,

Vishnu Priya

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
870

use my demo code and make changes as per ur selection screen and the table from which u want to read F4 values -

and code shud be written on the event -

At selection-screen on value-request for ECODE.

not on the selection screen event..hope u got my point

&----


*& Report ZGILL_VALUE_REQUEST *

*& *

&----


*& *

*& *

&----


REPORT ZGILL_VALUE_REQUEST .

data: begin of lt_all occurs 0.

include structure DYNPREAD.

data end of lt_all.

data: begin of lt_selected occurs 0.

include structure DDSHRETVAL.

data: end of lt_selected.

DATA: BEGIN OF lt_code OCCURS 0,

code LIKE zgill_main-PERNR,

END OF lt_code.

data no_dyn like sy-dynnr.

Parameters : ECODE like zgill_main-PERNR.

*parameters: pernr like pa0001-pernr .

no_dyn = sy-dynnr. "give the scren no directly or sy-dynnr in case of report.

At selection-screen on value-request for ECODE.

select PERNR into table lt_code from zgill_main.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ECODE'

dynpprog = sy-repid

dynpnr = no_dyn

dynprofield = 'ECODE'

window_title = 'Employee Details'

value_org = 'S'

DISPLAY = 'F'

TABLES

value_tab = lt_code

RETURN_TAB = lt_selected.

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

*if sy-subrc eq '0' .

  • write: 'success'.

*endif.

read table lt_selected index sy-tabix.

move lt_selected-fieldval to ECODE.

Reward points if helpfull

amit

Message was edited by:

Amit Tyagi

Hi,

I want to provide F4 help for a select-option field. Actually the table field of the select-option didn't have search-help.

Please let me know how to provide F4 help for this select-option. I have tried with the below code. I didn't work.

at selection-screen on s_db1.

  • CODE TO PROVIDE SEARCH-HELP

SELECT * FROM ztable

INTO TABLE gi_ztable.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'DBNAME1'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_DB1-LOW'

value_org = 'S'

TABLES

value_tab = gi_ztable

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE i799(f9) WITH text-002.

ENDIF.

Regards,

Vishnu Priya

4 REPLIES 4
Read only

Former Member
0 Likes
871

use my demo code and make changes as per ur selection screen and the table from which u want to read F4 values -

and code shud be written on the event -

At selection-screen on value-request for ECODE.

not on the selection screen event..hope u got my point

&----


*& Report ZGILL_VALUE_REQUEST *

*& *

&----


*& *

*& *

&----


REPORT ZGILL_VALUE_REQUEST .

data: begin of lt_all occurs 0.

include structure DYNPREAD.

data end of lt_all.

data: begin of lt_selected occurs 0.

include structure DDSHRETVAL.

data: end of lt_selected.

DATA: BEGIN OF lt_code OCCURS 0,

code LIKE zgill_main-PERNR,

END OF lt_code.

data no_dyn like sy-dynnr.

Parameters : ECODE like zgill_main-PERNR.

*parameters: pernr like pa0001-pernr .

no_dyn = sy-dynnr. "give the scren no directly or sy-dynnr in case of report.

At selection-screen on value-request for ECODE.

select PERNR into table lt_code from zgill_main.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'ECODE'

dynpprog = sy-repid

dynpnr = no_dyn

dynprofield = 'ECODE'

window_title = 'Employee Details'

value_org = 'S'

DISPLAY = 'F'

TABLES

value_tab = lt_code

RETURN_TAB = lt_selected.

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

*if sy-subrc eq '0' .

  • write: 'success'.

*endif.

read table lt_selected index sy-tabix.

move lt_selected-fieldval to ECODE.

Reward points if helpfull

amit

Message was edited by:

Amit Tyagi

Read only

anversha_s
Active Contributor
0 Likes
870

hi,

do this.

sample code.

SELECT-OPTIONS : s_kunnr for kna1-kunnr.

at selection-screen on value-request for s_kunnr-low.

*code for dynamic f4 help.

at selection-screen on value-request for s_kunnr-high.

*code for dynamic f4 help.

Regards

Anver

Read only

Former Member
0 Likes
870

Hi Priya,

U need to use AT SELECTION-SCREEN ON VALUE REQUEST FOR s_db1-low

Regards

Kannaiah

Read only

Former Member
0 Likes
870

Thank u all. I have incorrectly given the selection-screen event. It is working now.