SAP4 updated with if statements