Skip to Content
0
Former Member
Dec 13, 2011 at 05:39 AM

fetch data from internal table into another internal table

194 Views

Dear All,

i am taking name address, and email from lfa1 and adr6 table into IT_LFA1 internal table.

then i use select fro all entries and take data from BSIK table to IT_BSIK.

now i want to add :

name1, ort01, adrnr, pstlz, telf1, smtp_addr fields into IT_BSIK internal table

these all fields are in IT_LFA1.

i am using the code:

loop at it_bsik into wa_bsik.

read table it_lfa1 with key lifnr = it_bsik-lifnr into wa_lfa1 .

wa_bsiK-LIFNR = wa_LFa1-LIFNR.

wa_bsiK-name1 = wa_LFa1-name1.

wa_bsiK-ort01 = wa_LFa1-ort01.

wa_bsiK-adrnr = wa_LFa1-adrnr.

wa_bsiK-pstlz = wa_LFa1-pstlz.

wa_bsiK-TELF1 = wa_LFa1-TELF1.

wa_bsiK-SMTP_ADDR = wa_LFa1-SMTP_ADDR.

modify it_bsiK from wa_bsik.

CLEAR: wa_bsiK ,wa_LFa1.

ENDLOOP.

but in this in wa_lfa1 by default i get last record. so loop runs only for last record not for all the records.

kindly help me for the same.

With Regards,

Sulabh Agrawal