Delivery Document not getting closed

Hi Experts,
I am using 2007 B PL 08. I want to close the delivery document through SDK against which no Invoice or return is booked. it gives me error 'Internal error -5002 occured' when I try to close this document with following code.
Dim fd As SAPbobsCOM.Documents
  fd = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
         If fd.GetByKey(93) = True Then
                DelClose = fd.Close
                If DelClose <> 0 Then
                    oCompany.GetLastError(FErrCode, FErrMsg)
                    MsgBox(FErrMsg)
                End If
          End If
i even try following code to loop through the lines collection and close lines instead of closing header.
it gives me "you can not close rows in this type of document" error:
Dim fd As SAPbobsCOM.Documents
            fd = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
            If fd.GetByKey(93) = True Then
                For i = 0 To fd.Lines.Count - 1
                    fd.Lines.SetCurrentLine(i)
                    If fd.Lines.LineStatus <> SAPbobsCOM.BoStatus.bost_Close Then
                        fd.Lines.LineStatus = SAPbobsCOM.BoStatus.bost_Close
                    End If
                Next
                DelClose = fd.Update
                If DelClose <> 0 Then
                    oCompany.GetLastError(FErrCode, FErrMsg)
                    MsgBox(FErrMsg)
                End If
            End If
this used to work with 2005 B. Am I doing anything wrong?
Thanks in advance,
Binita

Hi Binita,
Closing the delivery at the header level works in the DI API in SBO 2007A (though it's not good practice as the correct method, as you know, would be to add a return linked to the delivery to return the goods to stock and update the GL). I can also do this via the SBO client (it warns me that there is no target document but I can choose to continue).
If you can close the delivery via the SBO client in 2007B then it sounds like a bug in the DI API.
Kind Regards,
Owen

Similar Messages

  • Delivery document not getting updated

    Dear Experts,
    Till date our client was using VL04 for creating DA for only domestic sales, now they
    are asking to provide facility to created DA for export shipment in VL04 and we have done customization for the same.
    Now there are two separate (delivery document number)  number ranges generated for
    domestic and export sales.
    Now my problem is :  delivery document number generated for export sales is not getting
    updated in database table VTRDI 
    Have any idea ??
    Please advice
    R.Karthik
    Edited by: Karthik R on Sep 30, 2009 5:31 PM
    Edited by: Karthik R on Sep 30, 2009 6:39 PM

    Hi Lakshmipathi  ,
    Thank you so much.....for ur valuable advice !!
    I have checked the table LIKP and LIPS ...and the export delivery number is getting saved
    in these two tables...
    But my problem is with creating shipment in VT01...as delivery number generated for export is not
    getting picked in VT01 but for normal domestic orders it is getting picked.
    I could not figure out where I went wrong??
    could you please guide me on this issue.
    R.Karthik
    Edited by: Karthik R on Oct 5, 2009 8:46 AM

  • Sales order not getting closed

    Hi,
    I am creating delivery document through SDK based on existing sales orders. it creates it with perfect quantity, tax , amount and doctotal values but the original sales order does not get closed contradictory to SAP's standard flow.it does shwo all the row-status as closed. but the document status remains open.
    what could be wrong? do i have to close it through SDK?
    Thanks,
    Binita

    Binta,
    As Petr said, i have added a SO in normal SAP UI without any addon, and copied it to Delivery and changed the Freight and added the delivery, in this case, the SO remains open.
    So I guess u can summarize that if any changes occur the SO would remain open?
    Hope it helps,
    Vasu Natari.

  • Delivery document not being picked while creating shipment document

    Dear All,
    Issue is regarding creation of shipment document.
    As i am creating shipment document in VT01N, am unable to get the delivery doc . ie., delivery document is not picked in shipment creation.
    I have created a sales order, picking is completed n saved, PGI not yet been done.
    Am unable to create a shipment document due to delivery document not being picked.
    i/p's will be of great help.
    with regards,
    Vijayashree

    Dear all,
    The issue is solved.
    As the Route was not picking in Sales Order so the delivery was not picked in shipment creation.
    Route determination setting was not correct.
    Regards,
    Vijayashree

  • Why SO Header not get closed automatically after all SO lines get closed?

    Hi all :
    Do you know the reason, why some SO Header still as Booked Status, even All the SO lines are already closed ?
    If I see the Workflow status the SO Header is in Status = Deferred and Activity = Wait
    And I can close it manually if I rewind the Activity in the Workflow, but I want to know why the SOs not get closed automatically.
    Thank you in advance
    Edited by: Daniel on Jan 18, 2011 8:41 AM

    Have you scheduled the concurrent request to use Workflow Background Processor to Process OEOH ? What is the frequency? Has it run after the lines got closed?
    Also, check the value of the WAIT attribute in the OEOH workflow? By default, it is set to close headers at the end of month.
    For more detail please see Note:141919.1 on Metalink.
    Also refer to metalink document # 397364.1 which details how to change the WAIT attributes.
    Hope this helps,
    Sandeep Gandhi

  • In VA01  In Schedule line Delivery date not getting populated

    Hello,
    We have developed enhancement for VA01 tcode.
    Depending upon the quatity entered for a material it should show one more item as free good.
    If quatity is 10 for a line item 10 then it should show item 20 by default same mateerial and quatilty as 1.We have done this it is working fine.
    But if we select free good item in our case it is 20 and click on schedule line item buttom all quaitity fields getting populated.but delivery date not getting populated for only free good.for line item 10 it showing properly.
    Can any one please suggest what i need to do in order to display delivery date for free good.
    Thanks in advance.
    Regards.

    Thanks for your response.
    Actually i have seen technical settings for that field.it is rv45a-etdat.this field has value till MV45AFZZ.seen in debugger.
    Looks like it is clearing some where after the above include.Any suggisitions welcome.Thanks again.

  • Import of photos is not working. Moreover 'photos' app is not getting closed, it says 'closing all libraries'. Even it is stopping shutdown/restart of my mac.

    Import of photos is not working. Moreover 'photos' app is not getting closed, it says 'closing all libraries'. Even it is stopping shutdown/restart of my mac.

    Next time you open the photos application hold down both of the keys suggested and then launch the application in the usual way. If you do this you will be presented with the opportunity to repair your library.

  • In EBS document not get auto clear Algorithms 11

    In Electronic bank statment  document not get  clear automatically while batch run.
    I update check no to payment document.  even though it is not get auto clear.
    in OT51 assign Interpretation Algorithms 11 011:(Outgoing check: Check number not identical to document number)
    why it is not get  auto clear with check number.

    011 = Outgoing check: Check number not identical to document number
    012 = Outgoing check: Check number identical to document number
    The "document number" in the descriptions is the payment document number - the FI doc that cleared the invoice.  If you use the payment document number as the check number - and thus that is the number the bank includes in the bank statement - then you would use algorithm 012.  If you create a check in the check register that is a different number than the payment document - and the check number is the number in the bank statement - then you would use algorithm 011.
    Search SAP Help for a document titled "Interpretation Algorithms".  This document includes descriptions of all the standard interpretation algorithms.
    Regards,
    Shannon

  • DriverManagerXAConnection is not getting closed.Toplink 9.0.4.5 OC4J 10.1.2

    DriverManagerXAConnection is not getting closed.
    Toplink is acquiring connections from two pools OracleConnectionPooledDataSource
    and XAConnectionpool. The connection of PooledDatasource is getting released
    but the DriverManagerXAConnection is not getting released.
    The oc4j output shows.
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@d042d7 to pool (Pool size: 1)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@702936 to pool (Pool size: 2)
    [java] null: Releasing connection com.evermind.sql.DriverManagerXAConnection@1c0db6a to pool (Pool size: 3)
    I saw a thread in oc4j forum
    Get and close connections many times in an EJB transaction drains pool
    which says that this issue is resolved, but I am using toplink 9045 and oc4j 1012
    and the problem still persist, also I cannot find the bug 3330123 which is
    mentioned in that link on metalink.
    Does toplink uses two different connection pools for reading and writing respectively
    when used with External Transaction Controller ?
    If yes then how this two different pools be configured.
    Any help is appreciated.

    Hello,
    In the forum posting you mentioned, bug: 3330123 I think was a red herring as it was an internal bug that was never able to be verified.
    The post though mentions that a Tar:3793784.996 was opened. This tar was linked to bug:3674906 which was created to deal with the issue that calling ds.getConnection() max-connections*10 times, OC4J throws SQLException (timeout).
    The problem was that each getConnection call was returning a new logical connection, even though they would share the same physical connection if in the same transaction context. This was changed so that there is no limit on the number of logical connections.
    The release logging messages you are seeing are a left over that doesn't seem to have been looked at as a probelm in the bug. I believe they can be ignored - the logical connections are held on to by the container transaction and will only released when this transaction is commited/rolledback.
    As for pooling configuration, I suggest looking at the sessionbean demos that use OC4J as examples of how it should be configured. TopLink will use separate pools for reading/writing if configured.
    Best Regards,
    Chris Delahunt

  • Controlling Document Not Getting Posted

    Dear All,
    We have a peculiar scenario of Controlling Document not getting posted. Any pointers on wat could be the issue will be highly helpful.
    Scenario:
    We have an interface which posts an accounting document.
    Dr. Expense
    Cr. Balance Sheet.
    The Cost Center is supplied thru the interface and FI document and Profit Center Document is posted without any issues. However, CO document is not generated, not sure wat could be the issue. We have performed the basic checks. Also, for the same expense account, we observe some postings have gone into CO where are some didnt'. The difference between documents posted with corresponding CO and documents without corrsponding CO posting is only the "Transaction Key". When we maintain blank Transaction key.. the system posts CO document, when transaction key is "WRX" for that specific GL the system doesn't post.
    Not sure why Standard SAP behaves like that. Please advice wat items i need to check to resolve
    this.
    regards
    Diwakar

    Hello,
    Make sure in OBYC, for key WRX, you have maintained the GL accounts.
    Regards,
    Ravi

  • Profit Center Document not getting generated when direct FI doc is posted

    Dear Experts,
    Profit Center Document not getting generated when direct FI doc is posted. However CO Document is generated for Line Item 1 mentioned below.
    Accounting Entry
    Line 1 -Debit Expense ( Cost Center) 1000
    Line 2 - Credit Bank                             1000    
    Advance Thanks
    Sanjai

    Hi,
    Pls check profit center configuration.... Some config might have missed.....
    Use the t.code 1KE1 For analysing the profit center configuration.
    Regards,
    RAM
    Edited by: Ram000 on Oct 7, 2011 10:45 AM

  • Divestitature document not getting reversed at receiver group

    Hi
    We have transferred some cons Unit at the upper level of hierarchy under higher cons group,but facing issue of divestitature docuemnt not getting reversed at receiver group,
    This is a vertical upward transfer and have used OC logic to avoid goodwill/gain calculation
    Can some one help me why divestiture document is not getting reversed at receiver group
    Regards
    Sunit

    Hi
    Thanks for you reply,divestiture accounting was done only after doing all necessary change in both receiver and sender group,
    defined FCEP and used OC logic in receiver group,however there are three error in COI task due to imbalance entry will it have anmy impact on document not getting reversed.
    Regards
    Sunit

  • TCP Socket connection in CLOSE_WAIT status and not getting closed

    I am facing an issue with the TCP socket connections not getting closed and they are in CLOSE_WAIT status for ever.
    As a part of batch process in our application, emails are sent with 4 embedded images. These images are downloaded from 3rd party site with IP say "UUU.XXX.YYY.ZZZ"
    The images are embedded to email as follows
    1. An URL object is created with the site url.
    URL urlPhoto = new
    URL("http://UUU.XXX.YYY.ZZZ/email/photos.jpg");
    2.     The image cid is created with the URL object and the image name
    HtmlEmail htmlEmail = new HtmlEmail();
    String cid1 = htmlEmail.embed(urlPhoto,
    "photo.jpg");
    3.     The image cid is added to the email template by replacing the ${cid1} and the email is sent.
    <td valign="top">
                   <img src="cid:${cid1}" width="279" height="274">
              </td>
    When a mail is sent, 4 new TCP connections are opened and are put in CLOSE_WAIT status for ever. For every mail sent 4 new connections are opened. In UNIX there is an upper limit on the number of open file handles (defaults to 1024) at any point of time. The open TCP connection has the underlying socket in CLOSE_WAIT status and is not getting closed at all. When the upper limit (1024) is reached the batch process is throwing the following exception and terminates.
    Caused by: com.inet.tds.ap: java.net.SocketExceptionjava.net.SocketException: Too many open files
    at com.inet.tds.am.a(Unknown Source)
    at com.inet.tds.TdsDriver.a(Unknown Source)
    at com.inet.tds.TdsDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at com.hcomemea.batchprocess.dataaccess.database.BaseJdbcDao.openConnection(BaseJdbcDao.java:106)
    ... 12 more
    When I run the command lsof in UNIX which list the open file handles in the system
    $ /usr/sbin/lsof -p 22933 -i | grep CLOSE_WAIT
    java 22933 build_master 297u IPv6 129841943 TCP integration.com:47929->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 298u IPv6 129841947 TCP integration.com:47933->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 299u IPv6 129841950 TCP integration.com:47936->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    java 22933 build_master 300u IPv6 129841970 TCP integration.com:47952->UUU.XXX.YYY.ZZZ:http (CLOSE_WAIT)
    ���list of 935 connections similarly�
    I tried 2 solutions
    1. Got the HttpURLConnection from the URL object and invoked disconnect method on the same. But it doesn�t work.
    2. Ran the batch process java program with the parameter �Dhttp.keepAlive=false to close the underlying connection but didn�t help.
    I need the underlying sockets to be closed and not put in CLOSE_WAIT status after sending the mail.
    Is it the problem with the embed method of HtmlEmail object not closing the underlying socket connection.
    If anyone has faced this issue before, kindly let me know the possible solutions for the same ASAP.
    Thank you,
    Ramesh G

    This sounds more like a problem due to connection pooling at middle tier/application server.
    If that has been ruled out, then you might to enable DCD or set expiry time on the server.

  • Custom screen window not getting closed !

    I have designed a screen and calling that using call screen XXXX starting at 15 5. Sreen does load up. Upon clicking close button(X mark) on the top right side, window is not getting closed.
    I have two more buttons OK and CANCEL in screen, which I designed, on clicking them screen does behave properly,
    I searched in SDN but couldnt get much help.
    Any idea what am missing ??
    Thanks & Regards
    Himayat.

    Hi Gautham,
    I already have this code in place,
    CLEAR v_ok_code.
      v_ok_code = sy-ucomm.
      CASE v_ok_code.
        WHEN 'CNCL'.
          REFRESH it_input.
          LEAVE TO SCREEN 0.
          WHEN 'TSAVE'.
          PERFORM update_table.
        WHEN OTHERS.
      ENDCASE.
    The thing is that generally for closing(X mark button on top), we dont do any explicit coding. I see some strange behaviour.

  • Field FKSTA- Billing status of delivery-related billing documents not getting updated

    Hi Experts,
    I have a requirement wherein I need to fetch the FKSTA - Billing status of delivery-related billing documents into the datasource 2lis_11_VASTI. I have checked a lot of threads on this topic but have not found a concrete solution yet.
    I have checked the settings in vov7 and vov8 and everything seems to be in place. I have also checked in table VBUP, when I filter based on field FKSTA = 'C', it shows me the outbound delivery document nos. But when I use the related sales document, it shows me blank values. VBUK as well doesn't show any values for field FKSTK.
    I would like to know how and where I can identify the 'billing status of delivery- related' document.
    I can see in VBUP table that if I enter the sales document no. related to the delivery document, it does not show the correct status.  I believe that the statuses should ideally get updated to the underlying VBUK and VBUP tables. Is there any way to update and align them?
    Is there a workaround, a similar field that i can use for datasource enhancement that will give me the correct values?
    Appreciate any help I can get on this as it is urgent.
    Thanks,
    AM

    Hi,
    You are correct that stauts is updated in table VBUK and VBUP.
    However, a sales order does not determine a billing status for delivery related billing, field
    VBUP-FKSTA is only determined for delivey.
    So, it is correct behavior that VBUP-FKSTA = BLANK when searching VBUP with
    VBUP-VBELN = sales order number.
    Just because of above reason, you will not find billing status field in VA03 -> goto header/item;
    you could only find billing status field for delivery in VL03N -> status overview.
    It seems that you are trying to find out sales orders that have been fully deliveried and fully billed, am I right? As far as I know, there is no directly table/field/tcode that could meet your requirement.
    You could consider following workaround:
    firstly, get a list of deliveries that have been fully billied(search VBUP with VBUP-FKSTA = C or search VBUK with VBUK-FKSTK = C);
    Secondly, using these deliveries to search table VBFA to find out related sales orders.
    Hope this helps.
    Best regards,
    Crystal

Maybe you are looking for

  • Carriage Returns / Line Breaks & PDF

    I have a requirement to display a customers address in 1 column of a PDF report. The address is stored in the RPD as Address1, Address2, etc. etc. I use the answer of the question "Carriage Returns / Line Breaks" as a basic startup. ( Question Regist

  • How to enable a disabled iPad?

    my brother entered the wrong password on my iPad and it got diabled and it says to connect to itunes. But the computer i have synced the ipad to is not working and i have no idea how to enable my iPad. Does anybody know what i can do for this?

  • Problem with running spool

    Hi, I created a script to grab the data from a view in database and export to cvs file. However, the column head name cannot be exported. Here is my code: set NEWPAGE 0 set SPACE 0 set LINESIZE 10000 set FEEDBACK Off set PAGESIZE 0 set verify off set

  • Tax code V0 does not exist for jurisdiction code IN00

    hi mm when i am creating a purchase order After creating the PO when i go to invoice and enter tax code V0 and jurisdiction code i face the error Tax code V0 does not exist for jurisdiction code IN00 Message no. FF718 Diagnosis You have entered tax c

  • Body and Attachments missing when running JavaMail  from Jboss.

    When I send an email from a Web service running on Jboss I get an email with recipients and subject but I do not get the body or the attachments. However, when I use the same code and run outside of the server environment everything works as expected