Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

internal table serching..

naimkhans_babi
Active Participant
0 Likes
343

Dear friends

I m working on problem in which i need to extract the 2 type of matching records. 1 is 100% matching records from the internal table where 7 out 7 criteria is matching. 2. where 6 out of 7 criteria is matching(90% matching). in both the scenario i need to transfer records in the respective internal tables.. here i have done 50% work by searching 100% matching fields where in 90% matching field my code is not working or i had done some mistake.. please help me to figure out or give me some idea to carry out this task. i m giving you the code.

in my code: first condition is giving me 100% matching where on the sy-subrc ne 0 it triggered second part where i m checking 7 times by dropping one field in each read statment, but it is not working. please help me to sort out this issue. thanx

regards, naim

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

data: wa_i_bp_p_read1 like wa_i_bp_p.

loop at i_bp_p into wa_i_bp_p.

lv_tabix = sy-tabix.

lv_tabix = lv_tabix + 1.

read table i_bp_p index lv_tabix into wa_i_bp_p_read1

comparing idnumber

idtype

title

initials

name_last

f50code

rbcode

transporting partner

idnumber

idtype

title

initials

name_last

f50code

rbcode.

if sy-subrc = 0.

move-corresponding wa_i_bp_p_read1 to i_bp_p100.

append i_bp_p100.

clear i_bp_p100.

move-corresponding wa_i_bp_p to i_bp_p100.

append i_bp_p100.

clear i_bp_p100.

elseif sy-subrc ne 0.

read table i_bp_p index lv_tabix into wa_i_bp_p

comparing idnumber

title

initials

name_last

f50code

rbcode

transporting partner

idnumber

title

initials

name_last

f50code

rbcode.

if sy-subrc = 0.

move-corresponding wa_i_bp_p_read1 to i_bp_p90.

append i_bp_p90.

clear i_bp_p90.

endif.

elseif sy-subrc ne 0.

1 ACCEPTED SOLUTION
Read only

nishanthbhandar
Contributor
0 Likes
311

Copy the contents of i_bp_p into another table say i_bp_p_temp.

First sort i_bp_p_temp by 7 fields.

loop at i_bp_p.

read table i_bp_p_temp using KEY addition for the 7 fields.

if sy-subrc ne 0.

sort i_bp_p_temp again .. this time with 6 fields.

do read again.

if sy-subrc ne 0.

sort i_bp_p_temp again .. this time with 5 fields.

do read again.

.

.

.

endloop.

Try this and let me know if it works.

1 REPLY 1
Read only

nishanthbhandar
Contributor
0 Likes
312

Copy the contents of i_bp_p into another table say i_bp_p_temp.

First sort i_bp_p_temp by 7 fields.

loop at i_bp_p.

read table i_bp_p_temp using KEY addition for the 7 fields.

if sy-subrc ne 0.

sort i_bp_p_temp again .. this time with 6 fields.

do read again.

if sy-subrc ne 0.

sort i_bp_p_temp again .. this time with 5 fields.

do read again.

.

.

.

endloop.

Try this and let me know if it works.