cancel
Showing results for 
Search instead for 
Did you mean: 

hi

Former Member
0 Kudos

can anyone explore on how to use read statement without hitting database for each time..

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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,

Former Member
0 Kudos

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