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 internal tables(Urgent)

Former Member
0 Likes
409

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
390

Hi,

Loop at it_tab2.

read table it_tab1 with key a = it_tab2-a and b = it_tab2-b and c = it_tab2-c.

if sy-subrc eq 0.

read table it_tab2 with key lifnr = it_tab2-lifnr.

if sy-subrc eq 0.

ur code.

endif.

endif.

endloop.

Plzz reward points if it helps.

2 REPLIES 2
Read only

Former Member
0 Likes
391

Hi,

Loop at it_tab2.

read table it_tab1 with key a = it_tab2-a and b = it_tab2-b and c = it_tab2-c.

if sy-subrc eq 0.

read table it_tab2 with key lifnr = it_tab2-lifnr.

if sy-subrc eq 0.

ur code.

endif.

endif.

endloop.

Plzz reward points if it helps.

Read only

Former Member
0 Likes
390

select lifnr from lfa1 for all entries in itab2 with itab2 lifnr.

loop on itab1

read itab2 with keys of itab1.

if sy-subrc 0.

read lt_lfa1 with lifnr .

if sy-subrc 0.

then your processing .

endif.

else.

coninue.

endif.

endloop.

this is just a pseudo code .

just change it accordingly n try for your own logic also.

reward if helpful,

taher