‎2009 Feb 20 6:03 AM
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.
‎2009 Feb 20 6:12 AM
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.
‎2009 Feb 20 6:07 AM
first check if s_lifnr-option contains 'BT' ..
if so .. check with s_lifnr-low and then with s_lifnr-high
‎2009 Feb 20 6:09 AM
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.
‎2009 Feb 20 6:09 AM
Hi:
Just check s_lifnr-low and then with s_lifnr-high
Regards
Shashi
‎2009 Feb 20 6:12 AM
‎2009 Feb 20 6:12 AM
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.
‎2009 Feb 20 6:13 AM
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.
‎2009 Feb 20 6:14 AM
Hi,
try like this..
loop at s_lifnr
gv_lifnr = s_lifnr-low.
***
some perform.
endloop.
‎2009 Feb 20 6:19 AM
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
‎2009 Feb 20 7:15 AM
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.