Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Internal Table

Hi Experts,

I have two internal tables with different structures.

In My first internal table have fields like,

EMP_ID, EMP_NAME, EMP_CITY, EMP_COUNTRY.

But In my Second Internal have the Structure like,

EMP_ID, EMP_NAME,

So Based on First Internal table's EMP_ID I need to get the EMP-NAME to my second Internal Table.

How Can I do This? Help me on this isssue.

Thanks in Advance,

Points Assured.

Tags:
Former Member
replied

Hi,

sort itab2 by emp_id.
data : v_tabix like sy-tabix.
loop at itab1.
  v_tabix = sy-tabix.
  read table itab2 with key emp_id = itab1-emp_id
                                       binary search.
  if sy-subrc eq 0.
     move itab2-emp_name to itab1-emp_name.
     modify itab1 index v_tabix.  
  endif.
endloop.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question