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

Select Options

Former Member
0 Likes
1,168

Hi all,

I have a field 'years of service' in selections screen with select option.

Now i have to give 5,10,16,20,25,30,35,40,45 as possible values in that field.

Can anyone suggest me how can i do that?

thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,148

Hi,

Try this.

Either use

1. 'RANGES

2. Populate the values of the select options in the internal table say itab1. Then call the function module.

'F4_INT_TABLE_VALUE_REQUEST'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = <table field name>

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = <select option name>

value_org = 'S'

TABLES

value_tab = itab1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Sharin.

10 REPLIES 10
Read only

Former Member
0 Likes
1,148

Hi,

Append the select-option internal table with desired values in AT Selection Screen Output event.

Thanks,

Kamesh Bathla

Read only

0 Likes
1,148

thanks

Read only

Former Member
0 Likes
1,148

Hi,

Check this example code, populate your values accordingly.

tables mara.

select-options: s_matnr for mara-matnr.

at selection-screen output.

s_matnr-low = 'A'.

append s_matnr.

s_matnr-low = 'B'.

append s_matnr.

s_matnr-low = 'C'.

append s_matnr.

Read only

0 Likes
1,148

thanks

Read only

Former Member
0 Likes
1,148

Hi,

Create a range table with type LVC_T_RNGS. And add the required values to the table in AT SELECTION-SCREEN OUTPUT.

Ex:

data: years_of_service type LVC_T_RNGS,

wa_years_of_service type LVC_S_RNGS.

wa_years_of_service-sign = 'I'.

wa_years_of_service-option = 'EQ'.

wa_years_of_service-low = 5.

append wa_years_of_service to years_of_service.

wa_years_of_service-sign = 'I'.

wa_years_of_service-option = 'EQ'.

wa_years_of_service-low = 10.

append wa_years_of_service to years_of_service.

wa_years_of_service-sign = 'I'.

wa_years_of_service-option = 'EQ'.

wa_years_of_service-low = 16.

append wa_years_of_service to years_of_service.

....

Add all the values you are required.

Regards,

Sai Prasad

Read only

0 Likes
1,148

thank you very much

Read only

Former Member
0 Likes
1,149

Hi,

Try this.

Either use

1. 'RANGES

2. Populate the values of the select options in the internal table say itab1. Then call the function module.

'F4_INT_TABLE_VALUE_REQUEST'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = <table field name>

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = <select option name>

value_org = 'S'

TABLES

value_tab = itab1

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

Sharin.

Read only

Former Member
0 Likes
1,148

Hi,

we can populate the values for select-options with the help of at selection-screen output statement.

example :

tables mara.

select-options: s_matnr for mara-matnr.

at selection-screen output.

s_matnr-sign = 'I'.

s_matnr-option = 'EQ'.

s_matnrx-low = '5'.

append s_matnr .

s_matnr-sign = 'I'.

s_matnr-option = 'EQ'.

s_matnr-low = '10'.

append s_matnr .

s_matnr-sign = 'I'.

s_matnrx-option = 'EQ'.

s_matnr-low = '16'.

append s_matnr .

Hope this helps.

thanx,

dhanashri.

Read only

Former Member
0 Likes
1,148

Hi,

Select-options is an internal table with s_matnr as the table name and having sign,options,low,high.

all you have to do is update low value with your conditions in 'at selection-screen output'.

Thanks

Ramana

Read only

Former Member
0 Likes
1,148

Hi Siddarth .,

Use at selection screen event and validate the input value in ( 5 , 10, 15 ,20,25,30,35,40) .

thanks

Sreenivas