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

Initialize SELECT-OPTIONS values

Former Member
0 Likes
8,394

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
Read only

Former Member
0 Likes
3,203

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.

Read only

Former Member
0 Likes
3,203

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!!

Read only

Former Member
0 Likes
3,203

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.

Read only

Former Member
0 Likes
3,203

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

Read only

Former Member
0 Likes
3,203

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.

Read only

Former Member
0 Likes
3,203

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

Read only

Former Member
0 Likes
3,203

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

Read only

Former Member
0 Likes
3,203

.