2007 Sep 03 3:12 PM
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
2007 Sep 03 3:18 PM
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.
2007 Sep 03 4:28 PM
Hi Alvaro,
Can you please tell me how to pass data element to select-option.
Thanking u.
sanjay
2007 Sep 03 3:19 PM
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 ?
2007 Sep 03 3:21 PM
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