If you have many records in first internal table, and no index on MSEG for LFGJA, LFBNR, LFPOS, this is normal....
- Did you check first internal table not empty (If empty SELECT will ignore the whole WHERE clause, reading whole MSEG x MKPF tables)
- Did you read Note 191492 - Performance: Customer developments in MM/WM ?
Regards,
Raymond