‎2009 Apr 29 6:17 AM
HI
there is an interanble with some values. Now i want to select only particular records from that table and want to put into same internal table depending on some selection criteria?
can anybody suggest me please?
‎2009 Apr 29 6:20 AM
hi,
use this code .
READ TABLE ITAB WITH KEY FILED-NAME = RE_FILE-NAME.
IF SY-SUBRC = 0.
DO WHAT U WANT .
ENDIF.
HOPE IT WILL HELP U .
~LINGANNA
‎2009 Apr 29 6:22 AM
Hi,
If u want particulare from an internal table on some condition use READ statement. press F1 on READ in ABAP EDITOR u ill understand how to use it...
if you want to move to another internal table use APPEND statement.press F1 on APPEND in ABAP EDITOR
Eg:
READ table itab index sy-index.
if sy-subrc eq 0 & cond1 = X.
append itab to itab1.
endif.
Hope it helps!!
Rgds,
Pavan
‎2009 Apr 29 6:26 AM
HI,
Actually my requirement is i want to filter out that internal table at a particular point ans use that table at all other points in the program. Instead of writing the read statement every time.
are there any suggestions?
‎2009 Apr 29 6:34 AM
Loop at interanble into wa where condition.
append wa to internaltable2.
endloop.
‎2009 Apr 29 7:27 AM
hi ,
if u want to filter internal table
loop at itab1 where field-name = value (u r filter) .
end loop.
hope it will help u .
‎2009 Apr 29 6:24 AM
Hi,
You can delete the records from the internal table which you do not require by specifying the necessary condition.
Delete itab where <condition on which record is to be deleted>.
The remaining records are the ones you want to retain.
Hope this helps.
Regards,
Himanshu
‎2009 Apr 29 6:25 AM
Hi
READ TABLE ITAB WITH KEY FIELD-NAME = W_carrid.
If option1 is selected.
Modify table Itab from wa_itab transporting w_carrid.
endif.
Thanks
Viquar Iqbal
‎2009 Apr 29 6:42 AM
hi,
you can use read table for reading the data of an internal table one bye one.
Read table itab with key field-name = Field name.
for example.
READ TABLE it_vbrk INTO wa_vbrk WITH KEY vbeln = XYZ .
and if you want to insert data in the same table you can use. APPEND
like
Append wa_vbrk to it_vbrk.
if you want to modify some value in same table you can use modify too..
MODIFY it_vbrk FROM wa_vbrk INDEX ...
‎2009 Apr 29 7:17 AM
hi
use this
loop at table itab1 into wa.
now check the work fields for your selection criteria.
if they match then append wa to itab2.
endloop.
here itab1 and itab2 should be of same structure.
if not then use
append wa to corrosponding fields of itab2.
please check the syntex.
Edited by: mayank jain on Apr 29, 2009 8:17 AM
‎2009 Apr 29 7:21 AM
hi,
use ...
loop at itab1 into wa1 where 'ur selection criteria'.
append wa1 to itab2.
endloop.
thnx
Rohit