read table itab2 into ls_itab2 with key anlage = <fs_itab1>-anlage.
if sy-subrc = 0. l_tabix = sy-tabix. loop at itab2 into ls_tab from l_tabix. if ls_itab1-anlage<> ls_itab2-anlage. exit. endif. l_count = l_count + 1. endloop. if l_count NE 2. <fs_itab1>-pod = 'X'.