private void runSapSession(byte session, List <RejectionsSapOrderProperty> list, string tableName) { ISAPLib sap; if (session > 0) { sap = Create.sapLib(); sap.createSession(); try { sap = Create.sapLib(session); } catch (Exception) { System.Threading.Thread.Sleep(3000); sap = Create.sapLib(session); } } else { sap = Create.sapLib(session); } IVA02 va02 = new VA02(sap, idaLog); RejectionsVA02Runner va02Runner = new RejectionsVA02Runner(sap, idaLog, va02, isReleaseRejections, true); foreach (var rejObj in list) { var status = va02Runner.runRejections(rejObj, id, tableName); updateOrderLog(tableName, rejObj, status); } }
public void runRejections_Should_SpltLineCorrectly_When_UnitsOfMeasuresAreMUN() { IVA02 va02 = new VA02(sap, idaLog); RejectionsSapOrderProperty rejectionsSapOrderProperty = getRejList(); sap.enterTCode("VA02"); va02.enterOrder(rejectionsSapOrderProperty.orderNumber); va02.bypassInitialPopups(); ITable table = va02.getTable(); var rejectionsVA02Runner = new RejectionsVA02Runner(sap: sap, log: idaLog, va02: va02, isRelease: true, isLog: false); rejectionsVA02Runner.runRejections(rejectionsSapOrderProperty, "someID", "someTable"); }