Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Aug 16, 2009 at 01:43 PM

    hi

    In your code, I didn't find a code which update the LineStatus value in the database.

    You are just updating the DataTable object. Which will not reflect in the database.

    Use the SAPbobsCOM.Documents object if you need to update the LineStatus.

    In Documents object there is a Lines subobject available. Update the LineStatus property.

    Anoop

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I use Recordset object to handle this problem temporarily. But I got another question.

      Initially I regarded the value of OpenQty field in POR1 as the quantity copied to Goods Receipt PO, A/P Invoice or Goods Return.

      However, after some tests, the logic of SBO seems not to be so simple. Is it possible to find the document about business logic

      of Purchasing module?

  • author's profile photo Former Member
    Former Member
    Posted on Aug 24, 2009 at 02:40 PM

    No documents.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.