Skip to Content
0
Former Member
Aug 16, 2009 at 04:28 AM

Can I modify the LineStatus and OpenQty fileds in POR1 using DI API?

55 Views

Hi, guys,

The addon under development will run on SBO 2005B PL35. I tried to use DI API to directly modify the values of LineStatus and Openqty in POR1 throught following codes. No error come up but the values of LineStatus and Openqty in POR1 didnot changed.

Something wrong in the codes? Or such action is not allowed in SBO 2005B?

Thanks for your reply!

TRY

sSQL = "SELECT * FROM POR1 T0 where DocEntry = " & poEntryNo & " and LineNum = " & oPOLine
oDataTable.ExecuteQuery(sSQL)
oDTSize = oDataTable.Rows.Count
Offset = oDataTable.Rows.Offset
If (oDTSize > 1) Then
        oLineStatus = oDataTable.GetValue("LineStatus", Offset)
        If oLineStatus = "O" Then 
               oOpenQty = oDataTable.GetValue("OpenQty", Offset) - CInt(omatrix.Columns.Item("col_Qty").Cells.Item(row).Specific.string)
                       
               If oOpenQty > 0 Then
                       oDataTable.SetValue("OpenQty", Offset, oOpenQty) 
               Else
                       oDataTable.SetValue("OpenQty", Offset, 0)
                       oDataTable.SetValue("LineStatus", Offset, "C")
               End If
       End If
End If

CATCH ex as exception
       sbo_application.message(ex.exception)
End TRY