In ABL, the typical approach for that query would be to define a temp-table with part and qty and do a for each on part, lookup each part no in the TT, create the record if it doesn't exist, then make the qty the max of the qty already there and the one in the current record.  Which said, I think we are missing something since why is there going to be more than one record per part in part?