sap4 updated with if statements