code to get ERP data