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 OPTION

Former Member
0 Likes
495

Hi

I have a SELECT-OPTION, say so_value. 

It can have any of the following 3 values:

"A       B      and       SPACE"

How can I assign these values to the select-option variable -so_value?

Regards

Santo

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
475

Hi,

Hi,

Use Value help for that.

SELECT-OPTIONS : s_plant FOR zaw_pol_plan-plant.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_plant1-low .

i_t001w-value = 'A'.

APPEND i_t001w.

i_t001w-value = 'B'.

APPEND i_t001w.

i_t001w-value = ' '.

APPEND i_t001w.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WERKS'

dynpprog = ws_repid

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = i_t001w

return_tab = v_return

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.

ENDIF.

s_plant1-low = v_return-fieldval.

Pls. reward if useful...

4 REPLIES 4
Read only

Former Member
0 Likes
475

Hi Santo,

chk this

data : v_char(1).

select-options : so_value for v_char.

initialization.

so_value-sign = 'I'.

so_value-option = 'EQ'.

so_value-low = 'A'.

append so_value.

clear so_value.

so_value-sign = 'I'.

so_value-option = 'EQ'.

so_value-low = 'B'.

append so_value.

clear so_value.

so_value-sign = 'I'.

so_value-option = 'EQ'.

so_value-low = ' '.

append so_value.

clear so_value.

Read only

Former Member
0 Likes
475

Hi Sekar

I have one doubt - as we are appending the values, will so_value be able to hold all the 3 values?

Santo

Read only

0 Likes
475

Hi Santo,

yes it will hold the 3 values,

to check that, just click on the extension box on selection screen next to the select option, it will show the 3 values

Read only

Former Member
0 Likes
476

Hi,

Hi,

Use Value help for that.

SELECT-OPTIONS : s_plant FOR zaw_pol_plan-plant.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_plant1-low .

i_t001w-value = 'A'.

APPEND i_t001w.

i_t001w-value = 'B'.

APPEND i_t001w.

i_t001w-value = ' '.

APPEND i_t001w.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'WERKS'

dynpprog = ws_repid

dynpnr = sy-dynnr

value_org = 'S'

TABLES

value_tab = i_t001w

return_tab = v_return

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.

ENDIF.

s_plant1-low = v_return-fieldval.

Pls. reward if useful...