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

Multiple default Valus in Selection

Former Member
0 Likes
767

Hi,

I want to creat a select option with multiple selection default values A, B, C, D, and F. How can I do this.

Thanks & Regards

Venkata

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
740

You can do that like this.



report zrich_0001 .

data: char01 type char01.

select-options: s_char for char01.

initialization.

clear s_char .  Refresh s_char.
s_char-sign = 'I'.
s_char-option = 'EQ'.
s_char-low = 'A'.  append s_char.
s_char-low = 'B'.  append s_char.
s_char-low = 'C'.  append s_char.
s_char-low = 'D'.  append s_char.
s_char-low = 'F'.  append s_char.

Regards,

Rich Heilman

7 REPLIES 7
Read only

Former Member
0 Likes
740

Hello,

In the Initialization event

s_option-sign = 'I'.

s_option-option = 'EQ'.

s_Option-low = 'A'.

append s_option.

s_option-sign = 'I'.

s_option-option = 'EQ'.

s_Option-low = 'B'.

append s_option.

.

.

.

s_option-sign = 'I'.

s_option-option = 'EQ'.

s_Option-low = 'F'.

append s_option.

Reward if helps.

Vasanth

Read only

0 Likes
740

hi,

my 2 cents - short:

 DO 6 TIMES VARYING s1-low FROM sy-abcde(1) NEXT sy-abcde+1(1).
    s1-sign = 'I'.
    s1-option = 'EQ'.
    IF s1-low <> 'E'.
      COLLECT s1.
    ENDIF.
  ENDDO.

A.

Read only

Former Member
0 Likes
740

Hi venkata,

1. Simple

2. just copy paste

3.

report abc.

data : a type c.

select-options : abc for a.

initialization.

refresh abc.

clear abc.

abc-sign = 'I'.

abc-option = 'EQ'.

abc-low = 'A'.

abc-high = 'A'.

append abc.

abc-low = 'B'.

abc-high = 'B'.

append abc.

abc-low = 'C'.

abc-high = 'C'.

append abc.

regards,

amit m.

Read only

Former Member
0 Likes
740

Append them to the SELECT-OPTIONS field in the INITIALIZATION event.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
741

You can do that like this.



report zrich_0001 .

data: char01 type char01.

select-options: s_char for char01.

initialization.

clear s_char .  Refresh s_char.
s_char-sign = 'I'.
s_char-option = 'EQ'.
s_char-low = 'A'.  append s_char.
s_char-low = 'B'.  append s_char.
s_char-low = 'C'.  append s_char.
s_char-low = 'D'.  append s_char.
s_char-low = 'F'.  append s_char.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
740

populate data to the internal table of the select options.

use the following sample code.

tables : mara.

select-options : matnr for mara-matnr.

initialization.

matnr-sign = 'I'.

matnr-option = 'EQ'.

matnr-low = 'A'.

append matnr.

matnr-sign = 'I'.

matnr-option = 'EQ'.

matnr-low = 'B'.

append matnr.

Read only

Former Member
0 Likes
740

Hi Venkat,

You can do this as follows

SELECT-OPTIONS s_matnr FOR mara-matnr.

initilization.

CLEAR s_matnr.

s_matnr-options = 'EQ'.

s_matnr-sign = 'I'.

s_matnr-low = 'A'.

APPEND s_matnr.

CLEAR s_matnr.

s_matnr-options = 'EQ'.

s_matnr-sign = 'I'.

s_matnr-low = 'B'.

APPEND s_matnr.

so on...