2008 Mar 24 8:54 AM
Purpose :- To read multiple rows of internal table on a search criteria.
Read statement selects only single row.
Any other option to select multiple rows at a time?
Answers will be rewarded!
2008 Mar 24 8:56 AM
Hi,
Make use of LOOP Statement.
Example.
LOOP AT ITAB WHERE MATNR = '11111'.
DO U MANIPULATIONS HERE
ENDLOOP.
Regards,
Balakumar.G
Reward Points if helpful.
2008 Mar 24 8:56 AM
use select *
SELECT * FROM dbtab ... INTO wa ...
SELECT * FROM dbtab ... INTO TABLE itab ...
SELECT * FROM dbtab ... APPENDING TABLE itab ...
2008 Mar 24 8:56 AM
Hi,
Make use of LOOP Statement.
Example.
LOOP AT ITAB WHERE MATNR = '11111'.
DO U MANIPULATIONS HERE
ENDLOOP.
Regards,
Balakumar.G
Reward Points if helpful.
2008 Mar 24 8:57 AM
use loop .. endloop instead of read ... there is no other
alternative ..
loop at itab where <condition>.
your coding ...
endloop.
2008 Mar 24 8:58 AM
Use Loop at statement .
To know your specific requirements , use F1 in the ABAP Editor.
Loop at itab where (condition).
endloop.
2008 Mar 24 8:58 AM
Hi,
Use "Loop at ... Where" inorder to process all the records of internal table where your condition is met.
Reward points if this helps,
Kiran
2008 Mar 24 9:01 AM
Hi,
Use LOOP AT <itab>.... ENDLOOP
Reads multiple rows in a internal table
You can also restrict by using WHERE, FROM..TO
LOOP AT <itab> WHERE <condition>
LOOPA AT <itab> FROM 2 TO 3.
Thanks and Best Regards,
Ruthra
2008 Mar 24 9:04 AM
Hi,
To select multiple rows at a time use
loop at where clause.
Reward.
2008 Mar 24 9:05 AM
it is like this:-
in itab1 i have sno , name , address.
1 xyz abc
2 aaa bjhj
in itab2 i have sno , subject , marks
1 en 33
1 mm 55
2 en 44
No i will loop thru itab1 and want to retrieve all the marks of sno = 1. Is this poss without using 2 loop at 's.
2008 Mar 24 10:44 AM
Hi,
Inorder to retrive the marks u can use this code
Loop at itab1 into wa_itab1.
read table itab2 with key sno = wa_itab1-sno into wa_itab2
If sy-subrc =0.
move : wa_itab2-marks to wa_marks-marks.
append wa_marks to it_marks.
Now it_marks contains the marks of it_itab2
2008 Mar 24 9:09 AM
Hi Friend,
Use
Loop at itab1 where < Specigy search pattern > in to itab2 up to n rows.
Endloop.
Regards,
Suresh.S
Edited by: Suresh Babu S on Mar 24, 2008 10:48 AM
Edited by: Suresh Babu S on Mar 25, 2008 8:22 AM
2008 Mar 24 9:25 AM
no other way rather than internal table or else use read statement continously if you want to pick 2 or 3 rows
2008 Mar 24 9:57 AM
use..loop at itab1 into wa1.
instead of read
reward points if useful
2008 Mar 24 10:05 AM
Hi,
TYPES: BEGIN OF T_TYPE,
LINE(80),
END OF T_TYPE.
DATA: T TYPE STANDARD TABLE OF T_TYPE WITH
NON-UNIQUE DEFAULT KEY,
WA_T TYPE T_TYPE.
MOVE 'Alaska Texas ' TO WA_T.
APPEND WA_T TO T.
MOVE 'California Arizona ' TO WA_T.
APPEND WA_T TO T.
SEARCH T FOR '*ONA' AND MARK.
Rgds
Vijay
2008 Mar 24 10:05 AM
hope this is what u are looking for -
read table itab with key val1 = 'XXXX'
if sy-subrc EQ 0.
l_tabix = sy-tabix
loop at itab from l_tabix .
if itab-val1 NE 'XXXX'
exit.
endif.
< do processing on multiple records here >
endloop.
endif.
2008 Mar 24 10:07 AM
2008 Mar 24 10:21 AM
HI
Thaks for the replies. All f them were useful.But i am not sure how gud the performance will be when using 2 loop at 's.