2006 Feb 23 5:44 AM
I have doubt about ranges statement
my query is the below
SELECT * FROM t077s WHERE ktopl EQ 'NCCA' AND
ktoks IN ('CONS','CONT','INVY').
t_hkont-sign = 'I'.
t_hkont-option = 'BT'.
t_hkont-low = t077s-bisnr.
t_hkont-high = t077s-vonnr.
APPEND t_hkont.
ENDSELECT.
SELECT * FROM bseg INTO CORRESPONDING FIELDS OF table
t_bseg
WHERE
**************when removing this like its working*
hkont in t_hkont AND
**************but records there in db for this range***
gjahr EQ p_gjahr AND
bukrs EQ 'NCCP' AND
bschl IN
('89','99','86','96','40','50') AND
augbl EQ space AND
bustw EQ 'WE01'.
that t_hkont table having three rows
Kindly advise me how to handle..
prakash
2006 Feb 23 5:50 AM
Hi prakash
if you want to filter the select from the internal table
you have to use FOr all entries in the select statement.
regards
kishore
2006 Feb 23 5:53 AM
HI
SELECT * FROM bseg INTO CORRESPONDING FIELDS OF table
t_bseg for all entries in t_hkont
WHERE
bisnr eq t_hkont-bisnr and
gjahr EQ p_gjahr AND
bukrs EQ 'NCCP' AND
bschl IN
('89','99','86','96','40','50') AND
augbl EQ space AND
bustw EQ 'WE01'.
regards
kishore
2006 Feb 23 5:54 AM
HAI,
How s t_hkont is declared it should be declared in thos way.
ranges : t_hkont for t077s-bisnr.
and then the code what you have declared should be working
cheers
2006 Feb 23 6:00 AM
hi kishore,
i have a range ...thats between of two values.. for u specified there is single only comes right ??? but i need set of matched records,
hi kumar,
yes. i have specified the range what u wrote..
thanks of u both,
pls suggest any other solution
2006 Feb 23 6:02 AM
no try giving 'EQ' and use <b>in t_hknont</b>,
using in means searching in the whole table, it is not wrong, try and see
2006 Feb 23 5:58 AM
try changing like this and see
<b>t_hkont-option = 'EQ'.</b>
try in debugging wheteher t_hkont is filled or not.
2006 Feb 23 6:03 AM
t_hkont-low = t077s-vonnr.
t_hkont-high = t077s-bisnr.
U have used wrong way.
Pls try this.
Regard
vinod
2006 Feb 23 6:04 AM
Hi Prakash,
1. Use your select statement by having the clause
for all entries in t_hkont.
2. before this make a check that the table t_hkont is NOt initial else it would all entries in table if the table t_hkont is INITIAL.
Cheers,
Tarun
2006 Feb 23 6:10 AM
vinod u r correct but i have tried that coding if i got any error supposed to change the range limits...but not working..
tarun... for having clause can u give correct syntax... here problem in syntax
2006 Feb 23 6:19 AM
HI,
I think your are mislead by statement Having ..
You do not have to use "having"
use this:
check <tablename> is NOT initial.
SELECT * FROM bseg INTO CORRESPONDING FIELDS OF table
t_bseg for all entries in table <table name> WHERE
<conditions>.
2006 Feb 23 6:16 AM
Hi prakash
SELECT * FROM t077s WHERE ktopl EQ 'NCCA' AND
ktoks IN ('CONS','CONT','INVY').
t_hkont-sign = 'I'.
t_hkont-option = 'BT'.
t_hkont-low = t077s-bisnr.
t_hkont-high = t077s-vonnr.
APPEND t_hkont.
ENDSELECT.
in this t_hkont-low and t_hkont-high contains the last value of the table t077s for the selection criteria.
Is that Ok?
I suggest First you generate a internal table for t077s as per the selection criteria then you can select the matching records from BSEG using FOR ALL ENTRIES.
For ALL ENTRIES will match all the records in the internal table with the database table.
regards
kishore
2006 Feb 23 6:24 AM
Hi Kishore... yes i did what u said... but no records return...pls look the below
SELECT * FROM bseg INTO CORRESPONDING FIELDS OF wa_bdc
for all entries in t_hkont
WHERE
hkont gt t_hkont-low and
hkont le t_hkont-high
*intead of this line i tried like hkont eq t_hkont-low
*t_hkont-high , t_hkont not allowing bcsz it has to *declare the equvalent record right ??
gjahr EQ p_gjahr AND
bukrs EQ 'NCCP' AND
ebeln IN t_po AND
bschl IN
('89','99','86','96','40','50') AND
augbl EQ space AND
bustw EQ 'WE01'.
MOVE-CORRESPONDING wa_bdc to t_bseg.
APPEND t_bseg.
ENDSELECT.
2006 Feb 23 6:46 AM
I |BT |0000501001|0000503999
I |BT |0000511001|0000529999
I |BT |0000221001|0000221999
FYI: this is the t_hkont values
2006 Feb 23 6:55 AM
HI parakash
SELECT * FROM bseg INTO CORRESPONDING FIELDS OF wa_bdc
for all entries in t_hkont
WHERE
hkont gt t_hkont-low and
hkont le t_hkont-high and
gjahr EQ p_gjahr AND
bukrs EQ 'NCCP' AND
ebeln IN t_po AND
bschl IN
('89','99','86','96','40','50') AND
augbl EQ space AND
bustw EQ 'WE01'.
MOVE-CORRESPONDING wa_bdc to t_bseg.
APPEND t_bseg.
ENDSELECT.
have you checked the table. does it contain the rows which satisfies this condition.
regards
kishore
2006 Feb 23 7:09 AM
Kishore,
Sorry to say tht records which is not satisfy the condition.....
actualy that rows just cleared before i run the query.. so i didnt much consider all the conditions
sorry to waste all of ur time....any wayy hearty thanks ...to u all...
2006 Feb 23 6:59 AM
Hello Prakash,
t_hkont-low = t077s-bisnr.
t_hkont-high = t077s-vonnr.
this should be interchanged as u are assigning he upperlimit (bisnr) to low instead of high