You can introduce a variable in the beginning of the script, say vDebug, and when it is set to "X", you can introduce a WHERE condition automatically in the extract query, on a table field (like BUKRS, or VKORG, etc.).
In any case, debugging based on a variable is always a good idea, as while debugging you may want to restrict load on the main (big) table but you may want to load all records from smaller (text, dimension) table.