‎2008 Aug 07 7:58 AM
HI FRIENDS.
i am working on a SELECT-OPTIONS and in which i need to initialize the same as follows:
10-20 but need to be exclude 11,
20-40 need to exclude 33.
how to initialize the select-option plz provide me the sample code and how to code above logic.
plz help me.
mahesh'
‎2008 Aug 07 8:07 AM
Hi,
Try:
suppose s_sel is the select-option
Initialization
s_sel-sign = 'I'.
s_sel-optipn = 'BT'
s_sel-low = '10'.
s_sel-high = '20'.
append s_sel.
s_sel-sign = 'E'.
s_sel-optipn = 'EQ'
s_sel-low = '11'.
append s_sel.
20-40 exclude 33 is the same logic.
Regards,
Pole
Edited by: Pole li on Aug 7, 2008 9:08 AM
‎2008 Aug 07 8:04 AM
Hello Mahesh
You can do the initialization as following:
" Define a switch variable
DATA: gd_init TYPE abap_bool.
AT SELECTION-SCREEN OUTPUT.
" Assures that the initialization happens only once
IF ( gd_init = abap_false ).
gd_init = abap_true.
o_selopt-sign = 'I'. " include
o_selopt-option = 'BT'. " between
o_selopt-low = 10.
o_selopt-high = 20.
append o_selopt.
clear: o_selopt. " just the header line
o_selopt-sign = 'E'. " exclude
o_selopt-option = 'EQ'. " equal
o_selopt-low = 11.
append o_selopt.
ENDIF.
Regards
Uwe
‎2008 Aug 07 8:07 AM
Hi,
Try:
suppose s_sel is the select-option
Initialization
s_sel-sign = 'I'.
s_sel-optipn = 'BT'
s_sel-low = '10'.
s_sel-high = '20'.
append s_sel.
s_sel-sign = 'E'.
s_sel-optipn = 'EQ'
s_sel-low = '11'.
append s_sel.
20-40 exclude 33 is the same logic.
Regards,
Pole
Edited by: Pole li on Aug 7, 2008 9:08 AM
‎2008 Aug 07 8:10 AM
Hello,
DATA: L_V_SEL TYPE CHAR2.
SELECT-OPTIONS: S_SEL FOR L_V_SEL.
INITIALIZATION.
S_SEL-SIGN = 'I'.
S_SEL-OPTION = 'BT'.
S_SEL-LOW = '10'.
S_SEL-HIGH = '20'.
APPEND S_SEL.
S_SEL-SIGN = 'I'.
S_SEL-OPTION = 'BT'.
S_SEL-LOW = '20'.
S_SEL-HIGH = '40'.
APPEND S_SEL.
S_SEL-SIGN = 'E'.
S_SEL-OPTION = 'EQ'.
S_SEL-LOW = '11'.
APPEND S_SEL.
S_SEL-SIGN = 'E'.
S_SEL-OPTION = 'EQ'.
S_SEL-LOW = '33'.
APPEND S_SEL.
‎2008 Aug 07 8:13 AM
Hi,
select-options: s_matnr for mara-matnr.
initialization.
s_matnr-sign = 'I'.
s_matnr-optipn = 'BT'
s_matnr-low = '10'.
s_matnr-high = '20'.
append s_matnr.
clear s_matnr.
s_matnr-sign = 'E'. " Its for EXCLUDE "
s_matnr-optipn = 'EQ'
s_matnr-low = '11'.
append s_matnr.
same logic can be applied for 20 to 40.
hope this helps.
thanx,
dhanashri.
‎2008 Aug 07 8:20 AM
Hi Plz follow below.
SELECT-OPTIONS: SNO FOR L_V_SEL.
INITIALIZATION.
SNO-SIGN = 'I'.
SNO-OPTION = 'BT'.
SNO-LOW = '10'.
SNO-HIGH = '20'.
APPEND SNO.
CLEAR SNO.
SNO-SIGN = 'I'. "INCLUDE
SNO-OPTION = 'BT'.
SNO-LOW = '20'.
SNO-HIGH = '40'.
APPEND SNO.
CLEAR SNO.
SNO-SIGN = 'E'. "EXCLUDE
SNO-OPTION = 'EQ'.
SNO-LOW = '11'.
APPEND SNO.
CLEAR SNO.
SNO-SIGN = 'E'.
SNO-OPTION = 'EQ'.
SNO-LOW = '33'.
APPEND SNO.
CLEAR SNO.
rgds
rajesh
‎2008 Aug 07 9:24 AM
Hi, Mahesh
You could try the code as follow:
DATA : i TYPE i.
SELECT-OPTIONS n1 FOR i.
SELECT-OPTIONS n2 FOR i.
INITIALIZATION.
n1-sign = 'I'.
n1-option = 'BT'.
n1-low = 10.
n1-high = 20.
APPEND n1.
CLEAR n1.
n1-sign = 'E'.
n1-option = 'EQ'.
n1-low = 11.
APPEND n1.
CLEAR n1.
n2-sign = 'I'.
n2-option = 'BT'.
n2-low = 20.
n2-high = 40.
APPEND n2.
CLEAR n2.
n2-sign = 'E'.
n2-option = 'EQ'.
n2-low = 33.
APPEND n2.
CLEAR n2.
And check the website as follow: http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba71f35c111d1829f0000e829fbfe/content.htm, it will help you to understand it much more better.
Hope it will help.
Best Regards,
Stephanie
‎2008 Aug 07 11:15 AM
hi ,
Thank you all of you. i understood the same.
its been very helpful to me..
again thanking all of who replied me
take care.
mahesh
‎2008 Aug 07 11:20 AM
hi mahes ....see this..
s_field-low = 11.
s_field-option = 'EQ'.
s_field-sign = 'E'.
append s_feld.
s_field-low = 33.
append s_feld.
clear s_field.
s_field-low = 1.
s_field-option = 'BT'.
s_field-sign = 'I'.
s_field-high = 40.
append s_feld.
‎2008 Sep 30 1:41 PM