‎2007 Dec 13 7:26 AM
data.....
i_pernr type p0001-pernr,
i_parea type p0001-werks,
i_barea type p0167-barea,
i_btype type p0167-pltyp,
i_bplan type p0167-bplan,
......
select-options s_pernr for i_pernr.
default '1000' option EQ sign I.
select-options s_parea for i_parea.
select-options s_barea for i_barea.
select-options s_btype for i_btype.
select-options s_bplan for i_bplan.
......
select pernr barea pltyp bplan begda endda from pa0167 into
corresponding fields of table i_0167
where ( barea in s_barea and
pltyp in s_btype and
bplan in s_bplan and
begda <= sy-datum and
endda >= sy-datum ).
......
select pernr werks from pa0001 into corresponding fields of table
i_0001 for all entries in i_0167 where pernr = i_0167-pernr and begda
<= sy-datum and endda >= sy-datum.
....
syntax is correct
but when i do the select options and select single employee it does not work...
not even for other select options....
my other statements are all right ...only problem is select options
plz hel
‎2007 Dec 13 8:11 AM
Hello new Abaper,
select pernr barea pltyp bplan begda endda from pa0167 into
corresponding fields of table i_0167
where ( barea in s_barea and
pernr in s_pernr <--- add!
pltyp in s_btype and
bplan in s_bplan and
begda <= sy-datum and
endda >= sy-datum ).Cheers
old Abaper
‎2007 Dec 13 7:30 AM
Hi,
Use
Tables:pa0001,pa0167.
to ur below code...n then try...
Regards,
Kaveri
‎2007 Dec 13 7:38 AM
hai u have used d structures.. plz use d tables pa0001 for d selection of pernr(employee)
regards,
raji
‎2007 Dec 13 7:49 AM
Hi,
U cannot use select single statement for slect-options.instead use upto 1 rows statement for select.
Regards,
Nagaraj
‎2007 Dec 13 7:58 AM
i tried all these options but none work
i ma not using single select i
i am selecting data into inernal table
plz any on ehelp
‎2007 Dec 13 8:15 AM
Hi ,
Do u mean to say when making a selection for i_0167 ,
your select-options chek is getting neglected , or there is some other issue .
‎2007 Dec 13 8:23 AM
i_0001 is my driver internal table.... during filling and writing data i am looping that internal table .....
i also have in my code these select statements
select pernr subty favor fanam fgbdt from pa0021 into table i_0021
for all entries in i_0001 where pernr = i_0001-pernr and
subty ne '7' and begda <= sy-datum and endda >= sy-datum.
select pernr perid stras locat ort01 state land1 pstlz telnr from pa0106
into table i_0106 for all entries in i_0001 where pernr = i_0001-pernr
and begda <= sy-datum and endda >= sy-datum.
and from here i am filling data into my final internal table
i hope my logic is correct ...
when i run the final program ...my select options are not working....whatever i enter on screen has no effect on output.....
rest of the code is fine.....
i made the s_pernr change ...but for some reason its not working.
‎2007 Dec 13 8:11 AM
Hello new Abaper,
select pernr barea pltyp bplan begda endda from pa0167 into
corresponding fields of table i_0167
where ( barea in s_barea and
pernr in s_pernr <--- add!
pltyp in s_btype and
bplan in s_bplan and
begda <= sy-datum and
endda >= sy-datum ).Cheers
old Abaper
‎2007 Dec 13 8:35 AM
Thanks Old abaper
now ...after your ur changes...my output is strange...if i include a single value its working fine...for some ranges is its ok.....dont kknow why its not working for some values...
I guess i am demanding more here...i will try and debug again...but i dont have enough time
...any suggestions would be helpful....i will try everthing...i ma struck here for past few hours...
have to solve today
thanks again
‎2007 Dec 13 8:55 AM
Hi ,
While declaring ur select options ,
directly refer to the table fields
Include the line
TABLES: pa0001,pa0167.
select-options s_pernr for pa0001-pernr.
default '1000' option EQ sign I.
select-options s_parea for pa0167-parea.
select-options s_barea for pa0167-barea.
select-options s_btype for pa0167-btype.
select-options s_bplan for pa0167-bplan.
And while making a selection
try to select the fields in the order they appear in the table
like
pernr
endda
begda
barea
etc
and so on .
And then check .
Regards
‎2007 Dec 13 9:02 AM
Hi ,
Am sorry for the last msg , please revet to it .
While declaring ur select options ,
directly refer to the table fields
Include the line
TABLES: pa0001,pa0167.
select-options s_pernr for pa0001-pernr.
default '1000' option EQ sign I.
select-options s_parea for pa001-werks.
select-options s_barea for pa0167-barea.
select-options s_btype for pa0167-pltyp.
select-options s_bplan for pa0167-bplan.
And while making a selection
try to select the fields in the order they appear in the table
like
pernr
endda
begda
barea
etc
and so on .
And then check .
Regards
‎2007 Dec 13 9:06 AM
almost ther....
now....while i enter an invalid number ..it does not work...it is giving me all the data....
god..this is getting more and more comples for me....
can any one clear me with select-options logic.......
thnaks santosh and other for ur time
plz help
‎2007 Dec 13 9:17 AM
that's a classic error, always check that internal table has values before doing FOR ALL ENTRIES:
if i_0167[] is not initial. <-- add!
select pernr werks from pa0001 into corresponding fields of table
i_0001 for all entries in i_0167 where pernr = i_0167-pernr and begda
<= sy-datum and endda >= sy-datum.
endif. <-- add!
‎2007 Dec 13 9:42 AM
thnx Old abaper.... Thomas....cheers buddy
for some reason ur statement did not work
i have to do it this way...
if not i_0167[] is initial.
very curious to know why?
thanks kaveri and other for your time
...atlast solved
u may or may not answer my question....
but some feed back will be good for this....
Abaper New
‎2007 Dec 13 9:22 AM
Hi Abaper,
select query picks up un ne cessary values when the select options value are not valid..
u need to validate it by..
if it is a select option ..if u give the low value which is invalid then it takes all values...
select single pernr from pa0000 where pernr in s_pernr.
if sy-subrc eq 0.
continue.........
else.
message 'enter valid pernr' type 'I'.
endif.
as i said earlier give tables:pa0000,pa0001,,..
Regards,
Kaveri
‎2007 Dec 13 9:34 AM
s_parea and s_parea are passed no where in u r query....include it...it will get okay...
‎2007 Dec 13 9:34 AM
s_pernr and s_parea are passed no where in u r query....include it...it will get okay...