Closing Document Line in 2005

Hi all,
I notice that in SBO2005, user is allowed to close Order's row. However, there is no method in DI to close row of marketing documents. There is an additional method for lines, but that is delete, not close.
I know that in RDR1 there is column LineStatus (O or C) indicating the status of the line, can I just change it from O to C if I want to close the line?? Will it update my committed quantity?
Anyone knows about this?
Thx.

Hi Erwine,
You can close a row in a order by this code:
Order.Lines.LinesStatus = SAPbobsCOM.BoStatus.bost_Close;
Order.Update();
PS: Pay attention that you cannot close a row and change any fields in the same Update

Similar Messages

  • Deleting Document Line in 2005 SP1

    When attempting to delete a Purchase Order line using the Delete method of the document_lines object generates the following error after the Update method of the Document object is called:  "Invalid valid value in Enum 'BoTaxTypes'"
    The documentation states that Delete returns a value indicating success but actually no value is returned.  I've tried using the delete method without calling update but then nothing on the document changes. 
    The documentation doen't include any instructions on using the delete method so I'm not sure what other steps are necessary to get it to work.  Does anyone out there have any suggestions on how to get this to work properly?

    Thanks to all who have responded.  I have finally received a resolution from development support on this.  They have confirmed the problem and have promised a fix in the Nov 2006 patch release.  In the interim, they have provided me the following workaround:
    Dear Mr. Joe Huffman
    From the information provided in the message I understand that you're
    working with patch level 4.
    I would recommand you NOT to upgrade to patch level 7 since there is a
    regression in this patch and the lines.delete method doesn't work at
    all in this version (6.8.317.7) with no work around!
    We will fix both bugs (the bug you've reported on and the regression
    in November patch.
    Working with patch level 4 (6.8.317.4) I've noticed that from some
    reason in your DB - After the GetByKey method the TaxType field value
    is changed from tt_NO to tt_YES.
    I have a work around which you can use only in case that you can
    set the TaxType field value to tt_NO.
    If it is possible to you than you can use the following code for
    changing the value for tt_YES to tt_NO:
    'Work around - Fix TaxType value
    For iIndex = 0 To TotalRowCount - 1
    oPO.Lines.SetCurrentLine (iIndex)
    oPO.Lines.TaxType = tt_No
    Next iIndex
    RetVal = oPO.Update
    and only after running this code I delete the wanted line:
    oPO.Lines.SetCurrentLine (0)
    oPO.Lines.Delete
    RetVal = oPO.Update
    I hope that this work around will be suitable for you.
    I'm sorry for the inconvenient.

  • Document line with price zero in SBO 2007 A

    Hi All
    We have a DI API AddOn that occationally has to create a document line with the total price of zero.
    In SBO 2005 A we just set SBODocument.Lines.Price = 0, but that doesn't work in SBO 2007 A.
    In 2007A when we set SBODocument.Lines.Price = 0 it takes the price from the pricelist as though we had not entered a price at all. If we set SBODocument.Lines.Price to something else that zero it does correctly take the price we entered.
    We have tried to set SBODocument.Lines.UnitPrice or SBODocument.Lines.LineTotal to zero in stead but it gives the same result.
    Any help appriciated.
    Rgds
    Jesper Carstensen

    Sorry, my mistake.
    The solution WAS indeed to set SBODocument.Lines.UnitPrice = 0
    Rgds
    Jesper Carstensen

  • UDF in documents lines that can be Change after adding the doc.

    Dear all
    How can i create a UDF in documents lines that can be change after adding the doc? He need to mark some of the lines to already audit or not audit and the date of the action.
    Kind Regards
    Margarida

    It also depends on what documents you are wanting to add these comments to. On documents such as the A/R Invoice/ Delivery, and A/P Invoice/ Goods Receipt PO you cannot change the UDFs on the line item after the document is added (regardless of whether the document is closed). Sales Orders/ Quotes and Purchase Orders line item UDFs can be changed as long as the line hasn't been closed (or partially received/delivered/invoiced).
    Hopefully that makes sense. I could give more of an explanation if I knew what documents you were wanting to add these line item comments to.

  • Application crash on showing alert message after closing document in CS5

    My application crashes when I show alert message after  standard close using IDocFileHandler's close method i.e
    Close( doc, uiFlags, allowCancel, cmdMode );
    Before calling this method there is no crash on showing alert messages.
    i.e just one line before Close() method is called I am able to show alert message. And just one line after close method call , after showing alert message when I  click on OK button of alert message  my application crashes.
    I tried to use errorcode but returned value was fine i.e no error.(Checked GlobalErrorCode and GlobalErrorString before and after close).
    I also tried CanClose method to check but it worked fine.
    I also used IDocumentCommand methods but application crashed without showing  alert message.

    I used PMSetGlobalErrorCode(kCancel) after closing document and it worked.

  • Trying to close a document line but exception is thrown

    I'm trying to close a document line, that is, setting LineStatus property to 1 (wich coresponds to 'C' [closed]).
    But i receive this message from SAP: 'can't close a row of this document type' (it's a translation so the message could be slightly different), prompting that this is an error in LineStatus property.
    Any ideas?
    regards
    Edited by: Peter Petrelli on Nov 12, 2008 4:32 PM

    Hi Peter,
    The first thing to test would be if you can close the line manually in the SAP Business One application without using the AddOn.
    - If not and you get the same error it might be system behaviour depending on which form.
    - If yes, there might be a bug in the DI API which should be reported in a SAP Ticket.
    The second thing to test would be if you can close the row
    - in a different document of the same type
    - in the same document type in a different database
    Let us know of your results and more specific information which document you are using.
    Kind Regards,
    Friederike
    SAP Business One Forums Team

  • Document line item text in Clearing document

    Dear All,
    Document line item text
    My client want the vendor invoice line item text(BSIK-SGTXT) to be captured in the corresponding clearing document line item text field(BSAK-SGTXT).
    (i.e) The vendor invoice and its payment clearing document should have the same text in the document line item text filed.
    According to me i can use  a substition rule and a user exit to assign the values. but here comes a problem* i have one clearing document against 3 to 4 vendor invoice documents* so my programming logic has got stucked here? like which vendor invoice line item text the clearing document should pick up?
    is there any other enhancements possible or can some one help me with the programming logic to be applied here.
    Thank you
    Regards,
    Vasanth D

    like which vendor invoice line item text the clearing document should pick up?
    is there any other enhancements possible or can some one help me with the programming logic to be applied here
    Why don't you discuss the issue with your client?  As you said, if you pay 5 invoices in a single run, the payment document item text can't carry all of those texts unless you use the long text.  What is the reason for the requirement?  Perhaps there's another solution.

  • How to Use document.Lines.SetCurrentLine

    Hi there, due to an enormous amount of time spent on this issue, I thought I would share how to use the SetCurrentLine method as posted to me by SAP support:
    It seems very cumbersome, as I have now to do an extra Recorset look up to get all the lines if I want to get the correct index - but at least it works (hopefully).
    Daniel
    SUPPORTS MESSAGE ****
    the way the SetCurrentLine works is as following:
    You do not have to use neither the LineNum nor the VisOrder as your
    parameterfor the setCurrentLine method.
    The system will use the corresponding index (starting at zero)linked to
    that line when running a query on the database and sorting the lines by
    LineNum.
    #,,DocEntry,, Item ,,LineNum,,Price,,VisOrder
    1,,11669,, A1001,,,, 600,00,,
    2,,11669,, A1003,,2,, 3,00,, 2
    3,,11669,, A1005,,3,, 600,00,,1
    See example above, that is the result of querying the database on that
    sales order and sorting by LineNum.
    The order in which the items are displayed in the application is based
    on the VisOrder. In this example items are displayed A1001, A1005 amd
    A1003.
    In order to update Item A1005 I will need to create a recordset, query
    the database and then loop the recordset to find the corresponding item
    and then use that index from the recordset to set the value for the
    SetCurrentLine method. In the example above index 0 from recordset
    points at item A1001, index 1 points at item A1003 and index 2 points at
    A1005 so your code should use setCurrentLine(2) to update item A1005.
    If you try to use LineNum (3 in this case) you will get an error message
    as index 3 does not exist in the recordset collection ( only 3 items
    with indexes 0,1 and 2). If you use visOrder 1(for item A1005) then the
    system will update item A1003 as 1 is the index for A1003 in the
    recordset.
    END OF SUPPORTS MESSAGE ********

    Hi Curtis,
    Your situation sounds a little different to mine, in that I know the LinNum of the documentline that I need to update - that is what the lineNumber variable is...
    To update all the rows, I guess you would just iterate through all the lines sequencially (ie starting at 0 and ending at document.lines.count:
    for(int i = 0; i < doc.Lines.Count; i++)
        doc.Lines.SetCurrentLine(i);
        // do your thing here...
    How do you know what lines you want to update??
    Dan

  • Tcode FV50: How to find long text in FI Document line item Before Saving.

    Hi,
    How to find long text in FI Document line item.
    During Parking of the FI document through Tcode FV50 i m giving the some text in the long text not in the text field.
    I would like to validate the Long Text Before Saving in user exit "U300" under  the  "Sunstitution" .
    Please anybody can be help me out where exactly this long text is going to be stored or in which internal table or memory id.
    Please give me the answer as soon as possible .
    Note:- Read_Text function module is not useful. Because Read_text useful after saving document.

    Hi Amit,
    In application area FINANCIAL ACCOUNTING , go for node LINE ITEM. Here create a step & maintain the prerequisite as per your requirement & in the check you can mention the code or you can direct it to a custom program like ZFI_RGGBR000.
    Here while maintaining the check you will get structures BKPF & BSEG in which you will get the desired field you are looking for.
    Just try to explore in your system how the other validations are maintained.
    After you are done with all your code, you have to run the regeneration program RGUGBR00.
    Here utmost care should be taken while running regeneration program, you should select all the checkboxes in the selection screen except  GENERATE SETS, GEN SUBSTN ROUTNS IN ALL CLNTS  & TRACE PROG. GENERATE CALLS .
    Hope this make your doubt clear.
    Regards
    Abhii

  • How to read long text in Document line item

    Hi,
    How to read long text in FI Document line item.

    Use Read_text function module.
    you need to pass
    ID
    LANGUAGE
    NAME
    OBJECT   to the function moduel
    To find the Text id name language and object these are the following steps. Example: FB02
    1. goto FB02, Enter Document number
    2. from menuselect Goto>Header-->header Text..... New window will be displayed 
    3. select the Header Text. here you can see all the text. 
    4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper. 
    5. in the Next window you will find Text Name. Text ID, Language. etc...
    Regards,
    Lalit Mohan Gupta.

  • Posting A Park document of year 2005 in 2007( Error message no. FP 041)

    Hi All
    I have a parked document in year 2005 and know the user want the same to post in 2007. while changing the header(posting date and making as 01.01 2007) through T.code MR44.
    I am getting the following error.
    Changing of document number or fiscal year not possible here
    Message no. FP 041
    Please let me know whether i can post a parked document of 2005 in 2007.
    or any way to rectify the same.
    regards
    Ramesh

    How can we change a parked document's fiscal year?
    I parked a document in fiscal year 2011, period 01. now I want to post it in fiscal year 2010, period 12.
    When I use FBV2 to change header information, it shown up an error message:
    Changing of document number or fiscal year not possible here
        Message no. FP041.
    How can I do now?
    Thanks.

  • Remove symbol # for long text in document line item

    Dear Experts,
    I enter some information in the long text field in document line item. For the area that I use "Tab" button, system will display as # symbol. Therefore when we print the information, the output will include the #### symbol which is not correct.
    Please help.
    Thanks.
    -Syaban-

    Dear Gaurav Aggarwal,
    Thanks for the reply, can you guide me the step to perform the suggested solutions? currently, we are using ECC6.
    Thanks.
    syaban

  • Wbs in customer/vendor and gl document lines during initial balance upload

    Hi gurus,
    Can we enter wbs in customer/vendor and gl documents lines during upload of opening balance upload?
    What is the impact of this?? Do we need to run project settlement on 1st day after go live to get data in cost center from ar, ap and gl????
    Thanks

    Hi Mohit,
    Why do you want to udpate WBS element for vendor and customer line items. Basic concept of said cost object (WBS element) is transfer values to Fixed assets or GL accounts or any other cost objects like cost center ,Internal order,sales order like that.
    You can update WBS element for all fixed expenses based on settlement rule and allocation types,which you created in customization and assigned cost elements or cost elment group over there. You can update WBS elements for said line items settle after opening balance update.  Please note ,it may not possible to update WBS element for vendor and customer line items.
    Basic cocnept of WBS element is cost collector ( You may use to collect revenue also as per nusiness processes) ,collects the cost from various resources and settle to said above objects. Vendor and customer balances are balance sheet accounts,which can settle through payments.
    Regards
    ManiKumar

  • Customer Invoice/Billing Document  Line Item Details

    I have be trying to get the line item details incuding Description, Qty, Ea pricing, etc., for an invoice for several days.   I am successfuly able to us the RFC FI_DOCUMENT_READ  to get a plethora of data back in several tables,  but none that contain the details I need.  I can see the informationI need usinf VF03 and the Document Number.  
    Here is the call I am making (Output tables defaulted in the .net connector wsdl file)
                Dim sAWORG As String = ""
                Dim sAWREF As String = ""
                Dim sAWSYS As String = ""
                Dim sAWTYP As String = ""
                SapBillingProxy1.Fi_Document_Read("", _
                     Me.txtDocNumber.Text, _
                    "VBRK", _
                    "MPMP", _
                    sAWORG, _
                    sAWREF, _
                    sAWSYS, _
                    sAWTYP)
    Am I asking for the wrong information or ??? 
    Please help or point me in the right direction.
    Thanks in advance for the help!

    Hi,
    If you are looking for Billing document line item details and if you have range of sales document reference numbers try using 'BAPI_BILLINGDOC_GETLIST' function module.It is remote call enabled.
    Regards,
    Sreekanth

  • PO item text is copied to the Financial Document line item text

    A user have requested that the PO item text is copied to the Financial
    document line item text, to aid them in analysis of the GR/IR account.
    is there any solution to implement this ?

    There is no standard setting for this requirement. Check with your ABAP team for this.

Maybe you are looking for