Use BAdI ME_PROCESS_PO_CUST, in the methods PROCESS_HEADER or CHECK, you have access to header (current screen PAI) value with GET_DATA, to previous (last PBO) value with GET_PREVIOUS_DATA and database value with GET_PERSISTENT_DATA.
With GET_ITEMS you get the list of items, and for each item you can get history with GET_HISTORY.
So now reformulate you requirement (90%) and code it (10%).
Regards,
Raymond