‎2008 Jul 30 2:07 PM
Hi all,
I am having an internal table itab1 with 100 records(Purchase order numbers)
I need to write a select query to fetch all the records from the table ekpo into table itab2 other than the records in the internal table itab1.
That means i should not select the records into internaltable itab2 which r existing in the internal table itab1.
Please give me the select query
Regards
Ajay
‎2008 Jul 30 2:10 PM
itab_100.<--100 records table
itab_final is the select from EKPO
select * from ekpo
into table itab_final
where condition.
loop at itab_final
read table itab_100.
if sy-subrc eq 0.
delete itab_final.
endif.
endloop.
‎2008 Jul 30 2:08 PM
Hi,
use for all entries statement, in the where statement use NE for all fields in itab1.
‎2008 Jul 30 2:09 PM
HI
Please give me the select query
*select **
from ekpo
into itab2
for all entries in table itab1
where <condition>.
Regards
Pavan
‎2008 Jul 30 2:09 PM
hi Ajay,
I would move the numbers from the itab into a range the following way:
sign option low
I NE number1
I NE number2
...
then the select would be:
SELECT ... FROM EKPO INTO ... WHERE ebeln IN range.
hope this helps
ec
rubbish... scroll down to Rob Burbank's post...
‎2008 Jul 30 2:10 PM
Hi ,
this might be useful.
Select * from ekpo into table itab2 for all entries in itab1 where ebeln ne itab1-ebeln.
Regards,
Kalyan.
‎2008 Jul 30 2:10 PM
select ebeln
from ekko
into table itab
where ebeln in s_ebeln .
if sy-subrc = 0.
select ebeln
ebelp
from ekpo
into table itab1
for all entries in itab
where ebeln = itab-ebeln.
endif.
‎2008 Jul 30 2:10 PM
itab_100.<--100 records table
itab_final is the select from EKPO
select * from ekpo
into table itab_final
where condition.
loop at itab_final
read table itab_100.
if sy-subrc eq 0.
delete itab_final.
endif.
endloop.
‎2008 Jul 30 2:12 PM
I don't think any of the proposed solutions will work. You should build a range table using EQ and "E"xclude.
Rob
‎2008 Jul 30 2:12 PM
Hi Ajay,
Just give the WHERE clause conditions reverse in EKPO select.
eg: If u r using some field EQ in ekko then use NE in ekpo.
But in this case the where clause fields should be common in ekko and ekpo.
Also paste the code on how u r populating the data into itab1(Po numbers).
Thanks,
Vinod.