Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

question on default option for parametere statement

Former Member
0 Likes
784

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.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
764

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

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

6 REPLIES 6
Read only

Former Member
0 Likes
764

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 => .

Read only

naimesh_patel
Active Contributor
0 Likes
765

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

Read only

Former Member
0 Likes
764

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

Read only

former_member194669
Active Contributor
0 Likes
764

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

....

Read only

Former Member
0 Likes
764

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

Read only

Former Member
0 Likes
764

All

thank you all for the quick response