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: 

Regarding Multiple values in selection

Former Member
0 Kudos
100

Hi all,

I want to design my selection-screen by giving multiple value ranges but i dont want to use select-options bcoz i dont have any specific range of values.

I dont want to hard code the values bcoz in future it may happen that a new plant or new garrage my added up.

So frnds any technique to overcome this issue.

Thanking u,

sanjay

4 REPLIES 4

former_member583013
Active Contributor
0 Kudos
72

Maybe you can create a new domain, add some values...Create a new data element and assing it to your Select-Option...If new values are added, you just need to update your domain -;)

Greetings,

Blag.

0 Kudos
72

Hi Alvaro,

Can you please tell me how to pass data element to select-option.

Thanking u.

sanjay

former_member186143
Active Contributor
0 Kudos
72

can you explain more what you're problem is ? I really don't get why select options is limiting you towards the future ?

you talk about a new plant so the values for the range are coming from the plant table ?

raymond_giuseppi
Active Contributor
0 Kudos
72

Use SELECT-OPTIONS with NO INTERVALS option, so no range will be allowed.

If you only want exact values (no generic) use SELECT_OPTIONS_RESTRICT in the INITIALIZATION. (sample follows)

FORM restrict_select.
  DATA: restrict TYPE sscr_restrict,
        opt_list TYPE sscr_opt_list,
        ass TYPE sscr_ass.

* Defeine select modes
* - ALL all kinds of select allowed
  CLEAR opt_list.
  MOVE 'ALL' TO opt_list-name.
  MOVE 'X' TO: opt_list-options-bt,
               opt_list-options-cp,
               opt_list-options-eq,
               opt_list-options-ge,
               opt_list-options-gt,
               opt_list-options-le,
               opt_list-options-lt,
               opt_list-options-nb,
               opt_list-options-ne,
               opt_list-options-np.
  APPEND opt_list TO restrict-opt_list_tab.
* - KEY no exclusion
  CLEAR opt_list.
  MOVE 'KEY' TO opt_list-name.
  MOVE 'X' TO: opt_list-options-bt,
               opt_list-options-cp,
               opt_list-options-eq,
               opt_list-options-ge,
               opt_list-options-gt,
               opt_list-options-le,
               opt_list-options-lt.
  APPEND opt_list TO restrict-opt_list_tab.
* - EQU only exact values
  CLEAR opt_list.
  MOVE 'EQU' TO opt_list-name.
  MOVE 'X' TO opt_list-options-eq.
  APPEND opt_list TO restrict-opt_list_tab.

* Affect modes to  select-options
* ALL to all select-options
  CLEAR ass.
  MOVE: 'A'          TO ass-kind,
        '*'          TO ass-sg_main,
        'ALL'        TO ass-op_main.
  APPEND ass TO restrict-ass_tab.
* KEY to key fields
  CLEAR ass.
  MOVE: 'B'          TO ass-kind,
        'B02'        TO ass-name, " selection-screen block name <<<
        'I'          TO ass-sg_main, " no exclude
        'KEY'        TO ass-op_main. " no generic
  APPEND ass TO restrict-ass_tab.
* I/EQ to your exact values fields
  CLEAR ass.
  MOVE: 'S'          TO ass-kind,
        'S-MATNR'    TO ass-name, " Field name <<<
        'I'          TO ass-sg_main, " no exclude
        'EQU'        TO ass-op_main. " only exact values
  APPEND ass TO restrict-ass_tab.
* Appel FM
  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
       EXPORTING
            restriction = restrict
       EXCEPTIONS
            OTHERS      = 1.
ENDFORM.                    " restrict_select

Regards