2007 Feb 15 7:13 PM
How to select from internal table.
e.g I would like to do
select from single * from itab1 into itab2 where fieldx = itab1-oldnumber.
How to select from internal table.
e.g I would like to do
select from single * from itab1 into itab2 where fieldx = itab1-oldnumber.
2007 Feb 15 7:17 PM
Hi Tina,
You can not perform any kind of SELECT statement operations on Internal tables.
For your requirement, you can do using LOOP...ENDLOOP statements on internal table.
DATA WA_ITAB1 LINE OF ITAB1.
LOOP AT ITAB1 INTO WA_ITAB1.
READ TABLE ITAB1 WITH KEY FIELDX = WA_ITAB1-OLDNUMBER.
IF SY-SUBRC = 0.
APPEND WA_ITAB1 TO ITAB2.
EXIT.
ENDIF.
ENDLOOP.
READ TABLE ITAB1
Thanks,
Vinay
2007 Feb 15 7:20 PM
Hi,
We do not write the selects on Internal tables, we can write the READ statements on it.
LOOP AT ITAB1.
Read table ITAB2 with key FIELD1 = ITAB1-FIELD1.
If sy-subrc = 0.
write the code
endif.
ENDLOOP.
Regards
Sudheer
2007 Feb 15 7:21 PM
Try:
LOOP AT itab1 INTO itab2 WHERE (...)
APPEND itab2.
ENDLOOP.
Rob
2007 Feb 15 7:34 PM
HI,
Your select query itself is wrong. What others have suggested is nothing but
itab2[] = itab1[].
Use:
select * from tablename into itab2
for all entries in itab1
where fieldx = itab1-oldnumber.
Regards
Subramanian
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |