on 12-27-2007 9:16 AM
can anyone explore on how to use read statement without hitting database for each time..
hi ramya ,
loop at itab1.
itab-ebeln = itab1-ebeln.
itab-bukrs = itab1-bukrs.
itab-aedat = itab1-aedat.
itab-ernam = itab1-ernam.
read table itab2 with key ebeln = itab1-ebeln.
itab-ebelp = itab2-ebelp.
itab-matnr = itab2-matnr.
itab-txz01 = itab2-txz01.
itab-peinh = itab2-peinh.
append itab.
endloop.
i think this will help u
reward if found useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By Using Select statement u can fetch all ur required data into internal table at a time.
Now u can use read command to read from Internal Table. Read command does not connects to database.
Be sure u streamline ur selection during select statement.
Syn: Read Table itab where var1 = val1
var2 = val2......
here we can use only symbols for comparison. here for = we cannot use EQ.
Awrd Points if useful
Bhupal,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Put select on the database table once and fetch the data in an internal table and use READ command on this internal table.
Check the use
SELECT anla~bukrs
anla~anln1
anla~anln2
anla~aktiv
anla~deakt
anla~anlue
anlz~kostl
anlz~bdatu
anlz~adatu
INTO CORRESPONDING FIELDS OF TABLE it_anla
FROM anla INNER JOIN anlz
ON anlabukrs EQ anlzbukrs
AND anlaanln1 EQ anlzanln1
AND anlaanln2 EQ anlzanln2
WHERE anla~bukrs IN so_bukrs
AND anla~anln1 IN so_anln1
AND anla~anln2 IN so_anln2
AND anla~deakt IN so_deakt
AND anla~anlue IN so_anlue
AND anla~aktiv IN so_aktiv
AND anlz~kostl IN so_kostl.
READ TABLE it_anla
INTO wa_anla
WITH KEY bukrs = wa_anlc-bukrs
anln1 = wa_anlc-anln1
anln2 = wa_anlc-anln2
BINARY SEARCH.
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.