2007 Feb 09 3:50 PM
Hi all,
there is an internal table itab1 without headerline.
Now i selected data in to that.
if suppose matnr is field in that.
Now i want to select the data for other internal table by using FOR ALL ENTRIES in itab.
select matnr maktx
from makt
into table itab2
for all entries in itab1
where matnr = itab1-matnr.
please tell me above query is right or wrong because we are using for all entries to the table which has no header line.
2007 Feb 09 3:52 PM
Hello ,
Ur coding is correct.
When using for all entries no need to consider whether the table is having header line or not.
Vasanth
Hi all,
there is an internal table itab1 without headerline.
Now i selected data in to that.
if suppose matnr is field in that.
Now i want to select the data for other internal table by using FOR ALL ENTRIES in itab.
select matnr maktx
from makt
into table itab2
for all entries in itab1
where matnr = itab1-matnr.
please tell me above query is right or wrong because we are using for all entries to the table which has no header line.
2007 Feb 09 3:52 PM
Hello ,
Ur coding is correct.
When using for all entries no need to consider whether the table is having header line or not.
Vasanth
2007 Feb 09 3:53 PM
Its ok. Check for not initial of itab before query.
<b>IF NOT ITAB[] IS INITIAL.</b>
select matnr maktx
from makt
into table itab2
for all entries in itab1
where matnr = itab1-matnr.
<b>ENDIF.</b>
Thanks,
Santosh
2007 Feb 09 3:53 PM
Hi,
Before using for all entries pl make sure the itab1 is not empty.
Cheers.
2007 Feb 09 3:54 PM
Hi
It's right FOR ALL ENTRIES option doesn't need a table with header line, you only check if the table has some hits:
if not itab1[] is initial.
select matnr maktx
from makt
into table itab2
for all entries in itab1
where matnr = itab1-matnr.
endif.
Because if itab1 is empty the select'll get all records of MAKT.
Max
2007 Feb 09 4:04 PM
2007 Feb 09 4:09 PM
Hi ,
yes ur query is correct ,
but this will give a error if the itab1 is empty .
so , it is good idea to use if not itab[] is initail.
cheers ,
abhishek
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |