2007 Jul 16 1:28 PM
2007 Jul 16 1:31 PM
Hi,
You can use For all entries insted of using a select statement inside a loop.
If itab[] is not initial.
Select * from mara into L_MARA for all entries in itab where matnr = itab-matnr.
endif.
Reward if helpful.
To avoid select statements in loop.
2007 Jul 16 1:30 PM
Hi,
Collect data using select statement in itab.
Collect data using select statement in jtab for corresponding itab entries.
loop at itab.
read table jtab key = itab-key.
append to ktab.
endloop.
Reward if useful!
2007 Jul 16 1:31 PM
Hi,
You can use For all entries insted of using a select statement inside a loop.
If itab[] is not initial.
Select * from mara into L_MARA for all entries in itab where matnr = itab-matnr.
endif.
Reward if helpful.
2007 Jul 16 1:31 PM
u can use Inner joins or for all entries in select statement,.
or esle.
u have one itab which has department details.
one more itab as Employee details.
u have to matehc these two to gte final output.
Loop at emp.
Clear dept.
Read table dept with key dept_no = emp-deptno.
if sy-subrc = 0.
itab-empno = emp-empno.
itab-deptno = dept-deptno.
itab-name = emp-name.
itab-deptname = dept-deptname.
append itab.
clear itab.
endif.
endloop.
2007 Jul 16 1:32 PM
Hi,
You need to get the data into an internal table.
Suppose you have to loop ITAB1.
And you want data from ITAB2.
Then use
SELECT *FROM <dbtab> INTO TABLE ITAB2 FOR ALL ENTRIES IN ITAB1
WHERE FIELD1 = ITAB1-FIELD1.
Use it this way.
Then use
LOOP AT ITAB1.
READ TABLE ITAB2 WITH KEY FIELD1 = ITAB1-FIELD1.
ENDLOOP.
Regards,
Sesh
2007 Jul 16 1:35 PM
hi,
u can go for READ TABLE STATEMENT instead of select statement in loops as
LOOP AT ITAB.
READ TABLE ITAB WITH KEY MATNR = ' value ' or INDEX = SY-TABIX
OR KWY FIELD = MATNR.
ENDLOOP.
IF HELPFUL REWARD SOME POINTS.
WITH REGARDS,
SURESH.A
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |