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

Closing Order rows

Hi,

I am trying to close sales order rows using DI API. the following is the code i am using.

objSales.Lines.SetCurrentLine(objRec.Fields.Item("LineNum").Value)

objStatic.Caption = "Updating Sales Order No. " & objRec.Fields.Item("Docentry").Value & " Line No. " & objRec.Fields.Item("LineNum").Value

objSales.Lines.LineStatus = SAPbobsCOM.BoStatus.bost_Close

If objSales.Update() <> 0 Then

MsgBox(objSBOAPI.oCompany.GetLastErrorDescription)

End If

I am getting the following error.

"Document rows cannot be closed concurrently with other document modifications you have made [RDR1.LineStatus]"

i am on 2007 B1 PL 37.

Please Help.

Thanks in Advance

Amudha

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Posted on Oct 07, 2008 at 07:53 PM

    Hi,

    because i only see a code snippet:

    are you sure you made no other changes in the document header or changes in other document rows ?

    lg David

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      No. i have not made any changes to the document. the scenario is this, i import some sales orders from legacy system. When i import, an UDF in sales order rows is marked as Y. Based on this value i either close my row or leave it as it is.

  • Posted on Oct 15, 2008 at 02:11 PM

    I have exactly the same problem, using SAP B1 2007.

    I use:

    SAPbobsCOM.Company company = SwissAddonFramework.B1Connector.GetB1Connector().Company;

    SAPbobsCOM.Documents ordr = (SAPbobsCOM.Documents)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);

    ordr.GetByKey(1734);

    ordr.Lines.LineStatus = SAPbobsCOM.BoStatus.bost_Close;

    int a = ordr.Update();

    if (a != 0)

    {

    string errorMsg = company.GetLastErrorDescription();

    throw new Exception(errorMsg);

    }

    I always get the error "Document rows cannot be closed concurrently with the other document modifications you have made". Closing the orderline by the interface of SAP B1 is possible...

    All help is welcome.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 15, 2008 at 06:40 PM

    Hello,

    We were having the same problem in 2007 version on sales orders that were entered in the 2005 version prior to upgrade. My initial tests seem to suggest that it has something to do with the COGS column in the Sales Order matrix. If you fill this column in for ALL line items in the matrix (this requires that all lines on the order still be open), then you will be able to close the lines via the DI with no issue.

    Since some items were already closed on our orders, we found that in our customization if we first update something on the order (e.g. we add a space to the notes field) and then close the line with a second update it works with no error. While this is not optimal because you have to update the order twice (once to update the notes and once to close the line) it is better than the alternative which is that you receive the error and the line is not closed.

    Hope this helps and hopefully SAP will eventually fix this issue!

    Regards,

    Heath

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 15, 2008 at 07:13 PM

    It's a new order, created in 2007.

    I tried your suggestion but i keep the same result.....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2008 at 08:11 PM

    Hello,

    We started running into this issue in the 2007 version. However, it was not happening on every order rather only on a specific few. I have found that the reason it is happening in our database is explained in SAP Note 1273795 - "DI_Unable to close document lines after change in item code".

    When I changed the item names in the item master back to match the description as was on the sales order, I am able to close the lines through DI with no error. For the order to not be affected by this bug, all item names in the item master must match all the descriptions on the sales order (doesn't matter if the line on the order is open or closed).

    Hopefully this helps.

    Regards.

    Heath

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 15, 2013 at 10:32 PM

    I could not close lines on some orders in DI or SBO. In SBO I received the "Document rows cannot be closed concurrently with other document modifications..." message. If I updated the notes field then a different error appeared.

    My issue ended up being lower case letters on some lines in the Currency field. The PO was created in DI. Updating the currency to upper case (as listed in the currency table) eliminated the problems.

    SBO 2007A PL 10

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 26, 2014 at 12:25 PM

    I am using 8.82 PL11 and also getting same error message in DI API.

    "Document rows cannot be closed concurrently with other document modifications you have made [RDR1.LineStatus]"

    here is example :

    for (int i = 0; i < oOrder.Lines.Count; i++)

    {

    oOrder.Lines.SetCurrentLine(i);

    oOrder.Lines.LineStatus = SAPbobsCOM.BoStatus.bost_Close;

    }

    int output = oOrder.Update();

    regards:

    Sandy

    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.