LOOP AT xy_it_po_open INTO xwa_open.
READ TABLE xit_temp INTO xwa_temp WITH KEY bukrs = xwa_open-bukrs
waers = xwa_open-waers
due = xwa_open-due
flag = xwa_open-flag
BINARY SEARCH.
IF sy-subrc NE 0.
xwa_temp-bukrs = xwa_open-bukrs.
xwa_temp-waers = xwa_open-waers.
xwa_temp-due = xwa_open-due.
xwa_temp-flag = xwa_open-flag.
IF xwa_open-amnt IS NOT INITIAL.
xwa_temp-amnt = xwa_open-amnt.
ENDIF.
APPEND xwa_temp TO xit_temp.
CLEAR: xwa_temp,xwa_open.
ELSE.
IF xwa_open-amnt IS NOT INITIAL.
xwa_temp-amnt = xwa_temp-amnt + xwa_open-amnt.
ENDIF.
MODIFY xit_temp FROM xwa_temp
INDEX sy-tabix TRANSPORTING amnt.
ENDIF.
CLEAR: xwa_temp,xwa_open.
ENDLOOP.
take a temporary empty table same as the strcuture of your final table and right the above code u will get the desired output just put the key as ur localcurrency
BR
Anurag