Skip to Content
0
Jun 02, 2006 at 06:22 AM

how to collect similar record from the internal table

25 Views

Dear firends...

I having a problem, I wish to collect exact matched records from 1 internal table another internal table by searching 7 fields, i need to have records who are exactly matched at 7 records, i have written a code wich is mention below it gave me only similar records but not 100% matched record.. would you like to help me. any correction, suggetion, code. will be great help of mine thanking you,

regards

Naim.

sort i_bp_p by title initials name_last idnumber idtype f50code rbcode. "acc_num.

loop at i_bp_p into wa_i_bp_p.

lv_tabix = sy-tabix.

read table i_bp_p index lv_tabix into wa_i_bp_p.

read table i_but0id into wa_but0id with key idnumber = wa_i_bp_p-idnumber

idtype = wa_i_bp_p-idtype binary search.

read table i_but000 into wa_but000 with key title = wa_i_bp_p-title

initials = wa_i_bp_p-initials

name_last = wa_i_bp_p-name_last binary search.

read table i_but0is into wa_but0is with key f50code = wa_i_bp_p-f50code

rbcode = wa_i_bp_p-rbcode binary search.

if sy-subrc = 0.

move-corresponding wa_i_bp_p to i_bp_p100.

append i_bp_p100.

endif.

endloop.

sort i_bp_p100 by partner.

loop at i_bp_p100.

write : /10 i_bp_p100-partner,

20 i_bp_p100-title,

30 i_bp_p100-initials,

40 i_bp_p100-name_last,

53 i_bp_p100-idnumber,

70 i_bp_p100-idtype,

85 i_bp_p100-rbcode,

95 i_bp_p100-f50code.

endloop.