Hello all: I am trying to do something like this in QTP Add a customer (customer # is unique) Once I add a customer I want to add multiple Orders for this customer in same script. I am able to use a do -- while loop and add the first customer and first order however I am not able add the 2ne order to the same customer. My code is something like this
Do while objExcel.Cells(rowNum,1) <> "" add customer (using data from excel) search for the customer using the customer # add PO -- ( Here I need to add more than one PO for same customer ) rownum + 1 Loop
I am able to add the first PO but unable to add the 2nd PO
Thanks Cody My excel spreadsheet is something like this when I put the for loop the same PO is being added again to same customer The first time I am able to add the custnum and PO but next time it adds the same PO The PO for each customer could vary.
CustNum CustName PONum PO Name 100 test 10 testpo1 100 test 11 testpo2 101 test2 13 testpo3 101 test2 14 testpo4 101 test2 15 testpo5
l_RowCount = DataTable.GetRowCount() For i=1 To l_RowCount DataTable.SetCurrentRow i custNum=DataTable("CustNum",dtGlobalSheet) CustName=DataTable("CustName",dtGlobalSheet) CustPo=DataTable("CustPo",dtGlobalSheet) ...so on