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

Coding based on two internal tables

Former Member
0 Likes
281

Hi everybody,

Please give me the code

I am having an internal table itab1 with 3 fields(itab1-a,itab1-b,itab1-c) and with 15 entries.

I am also having another internal table itab2 with 10 fields(itab2-a,itab2-b,itab2-c,itab2-lifnr,itab2-land1,itab2-name1...................) and with 10 entries.

First i should check Out of the 10 entries in itab2 weather any entry matches with the entries allready present in itab1

out of 10 entries in itab2 if any entry matches means then i should check weather itab2-lifnr is from lfa1-lifnr for any one of the remaining 9 entries

Thanks in advance,

Ajay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
265

loop at itab2.

read table itab1 with key a = itab2-a

b = itab2-b

c = itab2-c.

if sy-subrc = 0.

itab3[] = itab1[].

*-- get remaining 9 entries

delete itab3 where a = itab1-a and b = itab1-b and c = itab1-c.

exit.

endif.

endloop.

loop at itab3.

read table itab4 with key lifnr = itab3-lifnr binary search.

if sy-subrc = 0.

*--criteria satisfied

else.

*--not satisfied

endif.

endloop.

Regards

Vasu

1 REPLY 1
Read only

Former Member
0 Likes
266

loop at itab2.

read table itab1 with key a = itab2-a

b = itab2-b

c = itab2-c.

if sy-subrc = 0.

itab3[] = itab1[].

*-- get remaining 9 entries

delete itab3 where a = itab1-a and b = itab1-b and c = itab1-c.

exit.

endif.

endloop.

loop at itab3.

read table itab4 with key lifnr = itab3-lifnr binary search.

if sy-subrc = 0.

*--criteria satisfied

else.

*--not satisfied

endif.

endloop.

Regards

Vasu