‎2009 Sep 02 7:39 AM
Hi Experts,
I have a requirement like in my selection screen I will have a select-options which will be input disabled. But in the initialization event I want to populate some values through coding. How can I populate multiple values. I should not use variant. I have to code only.
Expecting your help,
Venkatraman.
‎2009 Sep 02 7:40 AM
there are four fields of a select option.
SIGN
OPTION
HIGH
LOW
select options are tables with header line.
say you write like :
select-options s_unam for sy-uname. "just press F1 on select-option to know what values to pass
INITIALIZATION.
p1-sign = 'I'. "another option is 'E'.
p1-OPTION = 'BT'. "you can put 'EQ'
p1-low = 'ZA'.
p1-high = 'ZZ'.
APPEND p1.
START-OF-SELECTION.
...
..Edited by: Soumyaprakash Mishra on Sep 2, 2009 8:41 AM
‎2009 Sep 02 7:40 AM
there are four fields of a select option.
SIGN
OPTION
HIGH
LOW
select options are tables with header line.
say you write like :
select-options s_unam for sy-uname. "just press F1 on select-option to know what values to pass
INITIALIZATION.
p1-sign = 'I'. "another option is 'E'.
p1-OPTION = 'BT'. "you can put 'EQ'
p1-low = 'ZA'.
p1-high = 'ZZ'.
APPEND p1.
START-OF-SELECTION.
...
..Edited by: Soumyaprakash Mishra on Sep 2, 2009 8:41 AM
‎2009 Sep 02 7:42 AM
Hi Venkatraman,
In intialization event .
you should build range.
e.g.
select-option : s_matnr for mara-matnr.
Initialization.
s_matnr-low = 'M1'.
s_matnr-high = 'M1'.
s_matntr-option = 'BT'.
s_matnr-sign = 'I'.
append s_matnr.
clear s_matnr.
then use this in select query.
Hope this is useful for you.
Regards,
Vijay
‎2009 Sep 02 7:45 AM
Try like this.
Tables: mara.
select-options: matnr for mara-matnr.
INITIALIZATION.
matnr-sign = 'I'.
matnr-option = 'BT'.
matnr-low = '0000000001'.
matnr-high = '0000000010'.
append matnr.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name CS 'MATNR' .
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
‎2009 Sep 02 7:45 AM
Hi Venkatraman,
Try this way.
Thanks
Venkat.O
REPORT ztest_notepad.
TABLES marc.
SELECT-OPTIONS : s_werks FOR marc-werks.
INITIALIZATION.
s_werks-low = 'CMM1'.
s_werks-sign = 'I'.
s_werks-option = 'EQ'.
APPEND s_werks.
CLEAR s_werks.
s_werks-low = 'CMM2'.
s_werks-sign = 'I'.
s_werks-option = 'EQ'.
APPEND s_werks.
CLEAR s_werks.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name EQ 'S_WERKS-LOW' OR
screen-name EQ 'S_WERKS-HIGH'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP..
‎2009 Sep 02 7:57 AM
Hi,
As problem has Solved but following my Sample Code can help People who will Search, in fact i am posting this one because it is different from all the previous replies i am using Macro to populate Select-Options or you can do the Same for Ranges.
DEFINE fill_select_options.
clear: &1. &1-sign = &2. &1-option = &3. &1-low = &4. &1-high = &5. append &1.
END-OF-DEFINITION.
SELECT-OPTIONS: sodate FOR sy-datum.
INITIALIZATION.
fill_select_options sodate 'I' 'BT' '20080101' '20080131'.
fill_select_options sodate 'E' 'BT' '20080110' '20080115'.
fill_select_options sodate 'I' 'EQ' '20080201' '20080201'.
fill_select_options sodate 'I' 'EQ' '20080205' '20080205'.Regards,
Faisal