I have two internal table and joined them based on purchase order number .now I have picked werks from ekpo based on purchase order number.Based on werks how can I loop name1 from T001w into final internal table which do not have purchase order field?
LOOP AT ITAB1 INTO WA_TAB1.
WA_TAB3-EBELN = WA_TAB1-EBELN.
WA_TAB3-EBELP = WA_TAB1-EBELP.
WA_TAB3-BELNR = WA_TAB1-BELNR.
WA_TAB3-BUDAT = WA_TAB1-BUDAT.
WA_TAB3-MENGE = WA_TAB1-MENGE.
READ TABLE ITAB2 INTO WA_TAB2 WITH KEY EBELP = WA_TAB1-EBELP.
WA_TAB3-EMATN = WA_TAB2-EMATN.
WA_TAB3-TXZ01 = WA_TAB2-TXZ01.
WA_TAB3-WERKS = WA_TAB2-WERKS.
READ TABLE IT_EKET INTO WA_EKET WITH KEY EBELN = WA_TAB1-EBELN EBELP = WA_TAB1-EBELP.
WA_TAB3-WEMNG = WA_EKET-WEMNG.
READ TABLE IT_EKKO INTO WA_EKKO WITH KEY EBELN = WA_TAB1-EBELN.
WA_TAB3-LIFNR = WA_EKKO-LIFNR.
APPEND WA_TAB3 TO ITAB3.
ENDLOOP.