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

select-options

Former Member
0 Likes
1,379

HI gurus,

In my code i have to loop based on the value given in the selection screen(this is must) so in the select query in the where option some prblm occured so i have written the code as

s_lifnr is select-option value.

This code works if i give single entry and sigle values.If i give range of values consider am giving 100 to 200 in the gv_lifnr its taking the value as IBT100200.I have to do the calculation first based on 100 and next by 200.How to do it.

loop at s_lifnr

gv_lifnr = s_lifnr.

shift gv_lifnr left deleting leading 'IEQ'.

some perform.

endloop.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,114

Hi ,

When ever we use a Selection Screen field ,it just act like an internal table.

It contains the 4 fileds.The internal format will be as follows.

s_lifnr-option = 'EQ'

s_lifnr-sign = 'I'.

s_lifnr-low = The value which ever you give in the selection screen.

s_lifnr-high = ' '.

So use the S_LIFNR-LOW to know the value which you give in the screen.

Regards,

Naveen Kumar Pulluri.

9 REPLIES 9
Read only

Former Member
0 Likes
1,114

first check if s_lifnr-option contains 'BT' ..

if so .. check with s_lifnr-low and then with s_lifnr-high

Read only

Former Member
0 Likes
1,114

Hi,

If you are using select-options value to retreive from database,

Use FOR ALL ENTERIES in ur select query.

If it is not, brief ur que more.

Read only

Former Member
0 Likes
1,114

Hi:

Just check s_lifnr-low and then with s_lifnr-high

Regards

Shashi

Read only

0 Likes
1,114

ur ans is copied from Srini Vas

Read only

Former Member
0 Likes
1,115

Hi ,

When ever we use a Selection Screen field ,it just act like an internal table.

It contains the 4 fileds.The internal format will be as follows.

s_lifnr-option = 'EQ'

s_lifnr-sign = 'I'.

s_lifnr-low = The value which ever you give in the selection screen.

s_lifnr-high = ' '.

So use the S_LIFNR-LOW to know the value which you give in the screen.

Regards,

Naveen Kumar Pulluri.

Read only

Former Member
0 Likes
1,114

The from... and to... vales are stored in s_lifnr-low and s_lifnr-high respectively. In your loop endloop transfer the values as shown below,


loop at s_lifnr into s_lifnr.
clear: w_lifnr_low,
         w_lifnr_high.

w_lifnr_low = s_lifnr-low.
w_lifnr_high = s_lifnr-high.

perform select_some_data.

endloop.

form select_some_data.

select single *
from LFB1
where lifnr GE w_lifnr_low
   and lifnr LE w_lifnr_high.

endform.

Read only

p604431
Active Participant
0 Likes
1,114

Hi,

try like this..

loop at s_lifnr
gv_lifnr = s_lifnr-low.

***
some perform.
endloop.

Read only

Former Member
0 Likes
1,114

HI Divya,

You have to sort your select option-low

in ascending order to fetch the lowest value,

And like wise sort your select options high

in descending order so as to fetch the highest value.

Hope it helps

Regrds

Mansi

Read only

Former Member
0 Likes
1,114

Hi Divya,

selection table contains fields high,low,option ,sign...

looping at selection table gives u only the lower & upper limit..

not the complete set of values b/w them.

while retriving data

loop at s_lifnr

gv_lifnr1 = s_lifnr-low.

gv_lifnr2 = s_lifnr-high.

shift gv_lifnr1 left deleting leading 'IEQ'.

shift gv_lifnr2 left deleting leading 'IEQ'.

perform <> using gv_lifnr1.

perform<> using gv_lifnr1

endloop.