Application Development 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: 

Initialize SELECT-OPTIONS values

Former Member
0 Kudos

Hi all,

i would like to initialize a parameter of my SELECT-OPTIONS.

My code :

SELECT-OPTIONS: s_date FOR sy-datum,

ptype FOR l_bkpf-blart,

pexo FOR l_bkpf-gjahr.

INITIALIZATION.

pexo-sign = 'I'.

pexo-option = 'EQ'.

pexo-high = sy-datum(4).

pexo-low = sy-datum(4) - 1.

APPEND pexo.

START-OF-SELECTION.

...

Well, my problem is that in my START-OF-SELECTION the pexo variable have not the values of INITIALIZATION, the system write in option 'BT'. Any ideas ?

Thanks

8 REPLIES 8

Former Member
0 Kudos

HI,

when you passing the low value and High value you need to use the BT option not the EQ. as system considers the value need to check between low and high.

SELECT-OPTIONS: s_date FOR sy-datum,
ptype FOR l_bkpf-blart,
pexo FOR l_bkpf-gjahr.

INITIALIZATION.
pexo-sign = 'I'.
pexo-option = 'BT'.
pexo-high = sy-datum(4).
pexo-low = sy-datum(4) - 1.
APPEND pexo.

START-OF-SELECTION.

Former Member
0 Kudos

Hi,

try below:


INITIALIZATION.
pexo-sign = 'I'.
pexo-option = 'EQ'.
pexo-high = sy-datum(4).
pexo-low = sy-datum(4) - 1.
Modify pexo.

Hope it solves your problem.

Thanks!!

Former Member
0 Kudos

Hi,

Try the below code.

SELECT-OPTIONS: s_date FOR sy-datum,

ptype FOR l_bkpf-blart,

pexo FOR l_bkpf-gjahr.

INITIALIZATION.

pexo-sign = 'I'.

pexo-option = 'BT'.

pexo-high = sy-datum(4).

pexo-low = sy-datum(4) - 1.

APPEND pexo.

START-OF-SELECTION.

Former Member
0 Kudos

Hi,

Here in you program you have given both the low and high i.e you are initialising a range..So , the option BT will be used..the option EQ is used only when you are giving single value.....

Regards

Vasavi Kotha

Former Member
0 Kudos

In the INITIALIZATION.below you are providing both low and high values so it has to option BT .System doing is write .change ur INITIALIZATION event.

INITIALIZATION.

pexo-sign = 'I'.

pexo-option = 'EQ'.

pexo-high = sy-datum(4).

pexo-low = sy-datum(4) - 1.

APPEND pexo.

Former Member
0 Kudos

Hi ,

You had assigned the values in initialization , tht is correct ,

as this selection option will act like an internal table and it has structure like

SIGN , OPTION , LOW ,HIGH .

it will store all the values provided by you.

so after the code you mentioned , if in START-OF-SELECTION.

if you write a statement like

write pexo. " Output is IBT20082009 .

take the values separetely like

write: pexo-low , pexo-high. " output is 2008 2009 .

Regards,

Aby

Former Member
0 Kudos

hi,

SELECT-OPTIONS: s_date FOR sy-datum,

ptype FOR l_bkpf-blart,

pexo FOR l_bkpf-gjahr.

INITIALIZATION.

pexo-sign = 'I'.

pexo-option = 'BT'.

pexo-high = sy-datum(4).

pexo-low = sy-datum(4) - 1.

APPEND pexo.

START-OF-SELECTION.

thanks

Former Member
0 Kudos

.