2008 Feb 07 1:14 PM
Hi ,
I have a requirement where i have check that there is only one entry in select option value at AT SELECTION SCREEN.
How can i handle that.
Thanks.
Khan
Hi ,
I have a requirement where i have check that there is only one entry in select option value at AT SELECTION SCREEN.
How can i handle that.
Thanks.
Khan
2008 Feb 07 1:15 PM
add to your select-options : no-extension.
and if you do not want intervales : no intervals
2008 Feb 07 1:16 PM
Give No-Intervals and N0-Extension while declaring the select-options
2008 Feb 07 1:18 PM
AT SELECTION SCREEN.
*IF S_DATE IS YOUR SELECT OPTION ..
DESCRIBE TABLE S_DATE LINES V_LINES.
IF V_LINES > 1.
*GIVE ERROR MESSAGE
ENDIF.
2008 Feb 07 1:19 PM
Hi,
at selection-screen section use this code:
at selection-screen.
number_lines = lines( so_options ).
if number_lines > 1.
......leave, exit, ......
endif.
zd.
2008 Feb 07 1:20 PM
2008 Feb 07 1:21 PM
Hi All,
thanks for your reply.
But my requirement goes on like this :
SELECT-OPTIONS: s_cpudt FOR gv_cpudt.
the user may enter different dates like :
01.09.2004
05.11.2005
02.10.2006
I want to restrict such values.
User can enter dates like :
01.09.2004 to 10.05.2005
Thanks
2008 Feb 07 1:25 PM
2008 Feb 07 1:31 PM
The function module SELECT_OPTIONS_RESTRICT may do that, with this function module, you can restrict input to EQ or BT to meet you requirements.
You may not allow the user to exclude records or use any option you don't want to be used for performance/programmatic purpose.
Sample :
TYPE-POOLS: sscr.
DATA: restrict TYPE sscr_restrict,
opt_list TYPE sscr_opt_list,
ass TYPE sscr_ass.
* create an option "ALL" which allow each mode
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.
* create a restricted option, say only EQ allowed
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 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.
* Affect the EQU restriction to your select-option
CLEAR ass.
MOVE: 'S' TO ass-kind,
'S-DATE' TO ass-name, " your select-optionsd
'I' TO ass-sg_main, " no exclude
'EQU' TO ass-op_main. " only EQ
APPEND ass TO restrict-ass_tab.
* Let the Function module do the job
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
restriction = restrict
EXCEPTIONS
OTHERS = 1.All this coding should be executed at INITIALIZATION event.
Regards