2008 Nov 20 7:30 PM
hello,
I have to make a change to my program and it involves the statement below.
SELECT-OPTIONS s_zbukr FOR w_payr-zbukr MODIF ID fff
DEFAULT 1000 TO 1200.
the business wants to include more company codes. the current process defaults to all the company codes between 1000 and 1200. they now want to include to new company codes 1800 and 2000, the problem is that there are company codes between 1200 and 2000 that they do not want to use.
I am not sure if I can use the default statement anymore or if I have to create a variant with the company codes coded in the variant .
I have been searching the SDN for any threads on this and also in the SAP help but I cannot find any answer.
if someone know how to code this, could you please share it with me
thanks in advance for the help.
2008 Nov 20 7:40 PM
You can't use the DEFAULT for the more than one values or combinations.
So, you have to fill the Select option in the INITIALIZATION event.
DATA: w_bukrs TYPE bkpf-bukrs.
SELECT-OPTIONS s_zbukr FOR w_bukrs MODIF ID fff.
INITIALIZATION.
s_zbukr-sign = 'I'.
s_zbukr-option = 'BT'.
s_zbukr-low = '1000'.
s_zbukr-high = '1200'.
APPEND s_zbukr.
CLEAR s_zbukr.
s_zbukr-sign = 'I'.
s_zbukr-option = 'BT'.
s_zbukr-low = '1800'.
s_zbukr-high = '2000'.
APPEND s_zbukr.
CLEAR s_zbukr.
Regards,
Naimesh Patel
hello,
I have to make a change to my program and it involves the statement below.
SELECT-OPTIONS s_zbukr FOR w_payr-zbukr MODIF ID fff
DEFAULT 1000 TO 1200.
the business wants to include more company codes. the current process defaults to all the company codes between 1000 and 1200. they now want to include to new company codes 1800 and 2000, the problem is that there are company codes between 1200 and 2000 that they do not want to use.
I am not sure if I can use the default statement anymore or if I have to create a variant with the company codes coded in the variant .
I have been searching the SDN for any threads on this and also in the SAP help but I cannot find any answer.
if someone know how to code this, could you please share it with me
thanks in advance for the help.
2008 Nov 20 7:39 PM
Why not you add manually 1800 and 2000(i'm guessing you want add only 1800 and 2000,not all between 1800 to 2000) in Multiple selection-screen?
By Just clicking on => .
2008 Nov 20 7:40 PM
You can't use the DEFAULT for the more than one values or combinations.
So, you have to fill the Select option in the INITIALIZATION event.
DATA: w_bukrs TYPE bkpf-bukrs.
SELECT-OPTIONS s_zbukr FOR w_bukrs MODIF ID fff.
INITIALIZATION.
s_zbukr-sign = 'I'.
s_zbukr-option = 'BT'.
s_zbukr-low = '1000'.
s_zbukr-high = '1200'.
APPEND s_zbukr.
CLEAR s_zbukr.
s_zbukr-sign = 'I'.
s_zbukr-option = 'BT'.
s_zbukr-low = '1800'.
s_zbukr-high = '2000'.
APPEND s_zbukr.
CLEAR s_zbukr.
Regards,
Naimesh Patel
2008 Nov 20 7:40 PM
Hi,
You can use the initialization event to populate the select options..
Ex..
TABLES: t001.
SELECT-OPTIONS s_zbukr FOR t001-bukrs MODIF ID fff.
INITIALIZATION.
* First add 1000 to 1200
s_zbukr-sign = 'I'.
s_zbukr-option = 'BT'.
s_zbukr-low = '1000'.
s_zbukr-high = '1200'.
APPEND s_zbukr.
CLEAR s_zbukr.
* Then add 1800 separately.
s_zbukr-sign = 'I'.
s_zbukr-option = 'EQ'.
s_zbukr-low = '1800'.
APPEND s_zbukr.
CLEAR s_zbukr.
* Then add 2000 separately.
s_zbukr-sign = 'I'.
s_zbukr-option = 'EQ'.
s_zbukr-low = '2000'.
APPEND s_zbukr.
CLEAR s_zbukr.Thanks
Naren
2008 Nov 20 7:41 PM
May be try this way
Initialization
ranges : s_zbukr FOR w_payr-zbukr .
s_zbukr-sign = 'I'.
s_zbukr-option = 'EQ'
s_zbukr-low = '1000'.
append s_zbukr.
...
...
...
s_zbukr-sign = 'I'.
s_zbukr-option = 'EQ'
s_zbukr-low = '1200'.
append s_zbukr.
add all values you want.
SELECT-OPTIONS s_zbukr FOR w_payr-zbukr MODIF ID fff
a®s
....
2008 Nov 20 7:46 PM
I would do it the first way you suggested - create a variant. Everything else requires a program change and when the users decide they want different company codes, it's easier just to change the variant.
Rob
2008 Nov 20 8:06 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |