2007 Jan 10 1:51 AM
Hi,
Can i use internal table for subquery, like
select ... into table itab_list from aufk where
aufk~objnr in (select objnr from itab1)
itab1 is a internal table which contain the valid objnr list.
How can i do that. Thanks.
Hi,
Can i use internal table for subquery, like
select ... into table itab_list from aufk where
aufk~objnr in (select objnr from itab1)
itab1 is a internal table which contain the valid objnr list.
How can i do that. Thanks.
2007 Jan 10 1:57 AM
FOR ALL ENTRIES is preferred rather than subqueries in terms of performance.
However you can check below link on how to use subqueries:
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm
Thanks,
Santosh
2007 Jan 10 3:42 AM
Assuming itab1 has a field OBJNR, and you want to get records from AUFK where the objnr is in itab1, the syntax is:
select ...
from aufk
for all entries in itab1
where objnr = itab1-objnr.
Michael
2007 Jan 10 3:50 AM
select objnr from ztable into table itab1.
if not itab[] is initial.
select ... into table itab_list from aufk FOR
ALL ENTRIES in ITAB1 where aufk~objnr = itab-objnr.
endif.
2007 Jan 10 3:50 AM
Hi Portfolio,
You can't use like below.Instead of that use for all entries.
Ex: Assume you have data in ITAB1.
IF NOT itab1 IS INITIAL.
SELECT * FROM aufk into table ITAB2
for all entries in itab1
where objnr eq itab-objnr.
ENDIF.
Pls. mark if useful.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |