Please, post your DUMP report. Probably your query is resulting in too much records.
Dump is occurring at the first or the second select statement?
The WHERE clause of the BKPF selection is wrong on the BUKRS field. Change the '=' to 'IN' and test it again.