What would be the best way to write queires in SAP as in B1 I would use something known as the query generator.