Invoice status is "Closed" after posting from Partial Delivery Notes

Hi everyone,
My add-on posts PARTIAL draft documents to posted delivery notes without reference to a Sales Order up to invoices. I've noticed that after invoice posting, my document (invoice) status was closed while my delivery notes document is open. Should'nt my invoice status still open? Please tell me if I am missing something on my code below. Thanks in advance!
public SAPbobsCOM.Documents PostDeliveryReceipts(SAPbobsCOM.Company company, SAPbobsCOM.Documents draft, ref int result)
SAPbobsCOM.Documents delivery = (SAPbobsCOM.Documents)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes);
delivery.HandWritten = SAPbobsCOM.BoYesNoEnum.tYES;
delivery.DocDate = draft.ShipmentDate;
            delivery.DocDueDate = draft.ShipmentDate;
            delivery.CardCode = draft.CardCode;
            delivery.CardName = draft.CardName;
            delivery.NumAtCard = draft.NumAtCard;
            delivery.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items;
for (int i = 0; i <= draft.Lines.Count - 1; i++)
                draft.Lines.SetCurrentLine(i);
                //components of a bom
                if (draft.Lines.TreeType != SAPbobsCOM.BoItemTreeTypes.iIngredient)
delivery.Lines.ItemCode = draft.Lines.ItemCode;
                    delivery.Lines.Quantity = draft.Lines.Quantity;
                    delivery.Lines.WarehouseCode = draft.Lines.WarehouseCode;
                    delivery.Lines.VatGroup = draft.Lines.VatGroup;
                    delivery.Lines.UnitPrice = draft.Lines.UnitPrice;
                if (i != draft.Lines.Count)
                        delivery.Lines.Add();
return delivery;

hello, friend.
in addition to what the others have said, please check your customer master, particularly in the Sales Area Data > Shipping tab.  look at the partial deliveries.  there may have been settings that tell the system if a delivery has been created with reference to the sales order, the order will be completed even if the quantity is only partially delivered.  if the entry in the 'partial delivery per item' field is 'B', then this will explain your situation.
this can also be manually set in the sales order, so you have to take a look at the order as well, at item level.
regards.

Similar Messages

  • Sales order status showing Completed, after I do partial delivery

    Dear All, Good morning
    I'm Creating an order for 5 quantities and creating a delivery for 2 Qty',
    my problem here is the sales order status is showing complete and I'm unable to create a delivery for the remaining Qty.
    I've checked with the Copy controls for OR - LR(T.code: VTLA) , for your reference I'm showing it below,
    FOR HEADER
    Target delivery type    LF     Outbound Delivery
    From SalesDoc Type      OR     Standard Order
    Order requirements     001    Header
    Combination requirmt   051    Combination
    Header Data            001    Header
    Header Data Ext. Sys   0
    Handling Units         000
    Copy Item Number is not CHECKED
    FOR ITEM
    Target delivery type    LF     Outbound Delivery
    From SalesDoc Type      OR     Standard Order
    Order requirements     001    Header
    Combination requirmt   051    Combination
    Header Data            001    Header
    Header Data Ext. Sys   0
    Handling Units         000
    Update Document Flow is CHECKED & Positive/Negative Qty
    Please its urgent.
    Thanks & Regards

    hello, friend.
    in addition to what the others have said, please check your customer master, particularly in the Sales Area Data > Shipping tab.  look at the partial deliveries.  there may have been settings that tell the system if a delivery has been created with reference to the sales order, the order will be completed even if the quantity is only partially delivered.  if the entry in the 'partial delivery per item' field is 'B', then this will explain your situation.
    this can also be manually set in the sales order, so you have to take a look at the order as well, at item level.
    regards.

  • Some AR Invoice status are Closed but some AR invoice status are Open-Print

    Hi,
    I have seen some AR Invoice status are Closed but some AR invoice status are Open-Printed.
    There are any reason for this.
    Regards,
    Mzian

    Hello Mizan - if you add an AR Invoice and it immediately and automatically goes to "closed" status, then you have a big system problem on your hands.  There is no way SAP B1 should automatically close an AR Invoice unless someone has done a manual reconciliation or has created an AR Credit Memo or has made a payment or has closed/cancelled the AR Invoice manually.
    Call your SAP Partner or SAP Support immediately!!!
    Regards - Zal

  • Creating Invoice from a Delivery Note using SDK

    Hi,
    I am working on SAP 2005 A Patch 4 with SQL 2000 SP 4. I am using VB.NET (VS2005). I am trying to create a Invoice from a Delivery note which is created based on a Sales order.
    I am getting the following error
    Error occured while saving Invoice: 0 - '15' is not a valid value for field 'BaseType'. The valid values are: '-1' - '',  '0' - '',  '23' - 'Sales Quotation',  '17' - 'Sales Order',  '16' - 'A/R Returns'
    The Code that i used to create the invoice is as follows
    Dim oInvoice As SAPbobsCOM.Documents
            oInvoice = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
            oDelivery = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
            Try
                If oDelivery.GetByKey(iDlvNo) = True Then
                    sTaxCodes = sTaxCode
                    oInvoice = pcompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
                    oInvoice.CardCode = oDelivery.CardCode
                    oInvoice.SalesPersonCode = oDelivery.SalesPersonCode
                    oInvoice.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items
                    oInvoice.DocumentSubType = SAPbobsCOM.BoDocumentSubType.bod_None
                    oInvoice.Address = oDelivery.Address
                    oInvoice.ShipToCode = oDelivery.ShipToCode
                    oInvoice.Address2 = oDelivery.Address2
                    oInvoice.JournalMemo = "Invoice - " & oDelivery.CardCode
                    oInvoice.Comments = "Based on Delivery  " & oDelivery.DocNum
                    oInvoice.PaymentGroupCode = oDelivery.PaymentGroupCode
                    oInvoice.DocDueDate = Now.Month & "/" & Now.Day & "/" & Now.Year
                    For iRowNo = 0 To oDelivery.Lines.Count - 1
                        If iRowNo > 0 Then
                            oInvoice.Lines.Add()
                        End If
                        oDelivery.Lines.SetCurrentLine(iRowNo)
                        oInvoice.Lines.ItemCode = oDelivery.Lines.ItemCode
                        oInvoice.Lines.Quantity = oDelivery.Lines.Quantity
                        oInvoice.Lines.Rate = oDelivery.Lines.Rate
                        oInvoice.Lines.BaseType = SAPbobsCOM.BoAPARDocumentTypes.bodt_DeliveryNote
                        oInvoice.Lines.BaseEntry = iDlvNo 'DocEntry of Delivery Note
                        oInvoice.Lines.BaseLine = iRowNo
                        oInvoice.Lines.TaxCode = sTaxCodes
                    Next
                    iReturnValue = oInvoice.Add()
                    If iReturnValue <> 0 Then
                        pcompany.GetLastError(iReturnValue, sErrorDescription)
                        Throw New Exception("Error occured while saving Invoice: " + _
                                           iErrorNo.ToString() + " - " + sErrorDescription)
                    Else
                        MessageBox.Show("Invoice created succesfully")
                    End If
                End If
    Since in the error message it has specified that i have given the BaseType as Delivery which has a value of 15 i changed that from bodt_DeliveryNote to bodt_Order which has a value as 17.
    When i tried creating the invoice again it gave the error
    Error occured while saving Invoice: 0 - Target item number does not match base item number.  [RDR1.TargetType][line: 2]
    I am not able to proceed further ... can any one help me
    thanks in advance
    Ganesh

    Greetings,
    I am having a similar problem, only I'm doing it as suggested in Louis' reply.  In fact I copied that code and tried it.  It's giving me a 2028 error with no description.
    I had been doing it slightly differently and the error I was getting was 5002 "Item no. is missing [INV1.ItemCode][line 2]"  I don't have 2 lines and I'm certain I have an item code.  The numbers I'm putting in for baseentry & baseline are absolutely in the table and the order is open.
    Here is that code:
            oDNUpd = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
            oDNUpd.CardCode = CardCode.Text
            oDNUpd.Lines.BaseEntry = CInt(SalesOrder.Text)
            oDNUpd.Lines.BaseLine = CInt(baseline.Text)
            oDNUpd.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
            oDNUpd.Lines.Add()
            lretcode = oDNUpd.Add
    I'm using SBO 2005 patch 7 (and the new dll).  I have similar code doing a stock transfer and it's working fine.
    Thanks for any suggestions you can offer
    John

  • Invoice status to third party system from sap

    Hi All,
    Could you please suggest me either to use functional module or bapi or badi so that i can send the invoice status from SAP to third party sytem.
    Thanks in advance for the response

    Hi,
    Invoice status can be sent to an external system based on IDOC or through an interface with proper program.
    For IDOC related stauts message do refer the below it may help you ..
    Electronic Data Interchange - EDI - ERP SCM - SCN Wiki
    Do refer the below OSS Notes to know the exist and badi in LIV.
    1156325 - BAdIs in the Logistics Invoice Verification environment

  • How to restrict the excess quantity delivery from the delivery note ?

    Dear All,
    As we know we make the delivery note with the reference of sales order so ordered quantity will be copied in the delivery note automatically. At the time of picking we can reduce the delivery quantity and make the partial delivery.
    But for example I have the sales order of quantity 5 and I make the delivery with refernce of same Sales order so my delivery quantity comes 5 and now if I make the quantity 7 instead of 5 in delivery note only and do the picking of 7 quantity yet system is allowing me then PGI is also possible. It means I delivering excess good than the ordered quantity. Which should not happen to make the cycle full proof.
    I dont what setting is required to avoid this major error. please Gurus Reply soon.
    regards,
    Vojas

    Hi,
    Use t-code 0VLP, select your item category which u determining in delivery >>> Go to details>>>in fron of Min/Max Qty put option B
    Check minimum qty   --- B (Situation rejected with an error message)
    Check overdelivery  --- B (Situation rejected with an error message).
    When user try to change qty,system will give error.
    Kapil
    Edited by: Kapildev Farakte on Dec 28, 2009 10:33 AM

  • Partial delivery not allowed for a STO

    Hi Gurus,
    We wanted to restrict the system so that it should not create deliveries with partial quantity for a STO. The delivery should be creaated if there is enough stock to fulfill the STO otherwise it should not create a delivery.
    I set the partial delivery indicator in customer master for teh receiving plant but still it is allowing partial delivery. ANy clue? Is there any otehr setting we need to do?
    Thanks for responce in advance.
    KHAN

    Hi
    I think that you have had your question answered so if you are happy with this can you please award points if you want to but mainly can you please mark your question as answered so that it is easier to navigate around the open questions in the forum as the number of pages are growing and growing and it takes too long to go through everything especially if a satisfactory answer has already been given and people like me who want to help will give up and so some people may not get any help.
    Thanks for this
    Frenchy.

  • Session not closing after redirecting from BSP View

    Hi All,
    I am trying to redirect to a new application (WD ABAP) from an existing BSP View by using
    CALL METHOD runtime->server->response->redirect( url = lv_url1 ).
    The session still exists in SM04 after redirecting but I want the BSP session be closed.
    Any pointers to how this can be done??
    "navigation" global object is not recognized in the View it seems because I was thinking of using
    navigation->exit (url).
    navigation->response_complete().
    but it gave complie errors.
    Awaiting your suggestions..
    Thanks and Regards
    Avinash

    Please have a look at the BSP application SYSTEM => page => sessionexit.htm

  • Why is inventory count Doc's status still active after posting difference

    Thanks,
    Linda

    Sounds like inventory management.. I found document is still active through MI02 after I am done with posting difference through MI20.
    Here is what I did,
    MI31 create inventory count sheet (100000207)for warehouse
    M104 Enter inventory count
    Mi11 recount for some items in 100000207
    Mi20 post difference
    Question: why 100000207 is still active since I alreay completed posting difference? Now the only option I have to deactive is to delete it, however when I am trying to do so, system give me a warning sign saying deletion will errase the evidence to posting difference. Is there any steps I missed so 10000207 is still active?
    thanks,
    Linda
    Edited by: LindaSAP on Dec 2, 2009 5:00 PM

  • How to do order status should be completed even with partial delivery?

    Hi,
    My requirement is i have sales order for 5 units.
    Delivery will be done for 3 units.
    I need the sales order status to be completed after delivery.
    I have tried with completion rule in item catagery'Item is completed with first reference'
    Still the status in document flow is order 'being processed'
    Can any body help me out
    regards,
    Reddyy

    Hi Reddy
    If your requirement has to be fulfilled then assign reason for rejection at item level for all line items after doing delivery .Then the item will be closed with 3pcs only .And when you check the document flow then the sales order will be closed
    NOTE : No need to change the completion rule at the item category level
    Regards
    Srinath

  • Invoking http post from BPEL is not passing parameters

    Hi,
    I have a simple BPEL process where I am trying to send an xml string in a request
    parameter to a servlet. Servlet is pretty simple. It just prints the request parameters and returns. But problem is that I am not getting any request
    parameters when I am using http post but everything works fine when using
    http get.
    Enclosed is the wsdl that I am using.
    Any information will be of great help
    Thanks
    Rajesh
    <?xml version="1.0" encoding="utf-8"?>
    <definitions
    targetNamespace="http://xmlns.oracle.com/OISService"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:client="http://xmlns.oracle.com/OISService"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >
    <types>
    <xsd:schema elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/OISService"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <xsd:element name="header">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="status" type="xsd:string"/>
    <xsd:element name="description" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="responsedata" type="xsd:string"/>
    </xsd:schema>
    </types>
    <message name="SendDataToOISRequestMessage">
    <part name="xmldata" element="client:responsedata"/>
    </message>
    <message name="SendDataToOISResponseMessage">
    <part name="payload" element="client:header"/>
    </message>
    <portType name="SendDataToOIS">
    <operation name="process">
    <input message="client:SendDataToOISRequestMessage"/>
    <output message="client:SendDataToOISResponseMessage"/>
    </operation>
    </portType>
    <binding name="SendDataToOIS" type="client:SendDataToOIS">
    <http:binding verb="POST"/>
    <operation name="process">
    <http:operation location="/Class1"/>
    <input>
    <mime:mimeXml part="xmldata"/>
    <mime:content type="text/xml"/>
    </input>
    <output>
    <mime:mimeXml part="payload"/>
    <mime:content type="text/xml"/>
    </output>
    </operation>
    </binding>
    <service name="SendDataTOOISService">
    <port name="SendDataToOIS" binding="client:SendDataToOIS">
    <http:address location="http://localhost:8888/j2ee/servlet"/>
    </port>
    </service>
    <plnk:partnerLinkType name="SendDataToOIS">
    <plnk:role name="SendDataToOISProvider">
    <plnk:portType name="client:SendDataToOIS"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>

    In the bpel you can make a http-binding instead of the default soap-binding.
    Maybe this can help you making the call to the servlet/jsp.

  • Account Merge- Closed Booked  Opportunities from Child Account not merged

    Hello There
    We are using  SAP CRM 5.2 when We try to merge Accounts, Child Account is merged to Parent Account
    but the Opportunities on child Account with Status "Closed- Booked" and "Closed- Lost" are not moving to the Parent Account , Any inputs is much Appreciated.
    Thanks
    Mani

    Okay, I just tried a couple of PWs that were associated with my ole Apple ID (discontinued email).  Got an error message that I've tried more than 2 times with an incorrecct ID and states that I will need to retrieve my PW before continuing to use the iTunes store.
    I suspect that if I use the forgot PW option that a new temporary PW will be sent to my old, discontinued email account that I no longer have access to.
    What now?

  • Zip data posted from client does not show up correctely at Server

    The java client post GZip'd data to the Webserver. The webserver for some reason shows the first 10 bytes correctly. Not sure what I am overlooking
    Also get java.io.EOFException: Unexpected end of ZLIB input stream
    public class GetPost {
         public String line;
         public String inputLine;
    public static void main(String[] args) throws Exception {
              GetPost r = new GetPost();
                   r.postURL("User","pass");
    // public Reverse { }
    public static byte [] zip(String data)
    throws IOException
    byte[] incomingBytes = data.getBytes();
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    GZIPOutputStream zip = new GZIPOutputStream(baos);
    for (int i = 0; i < incomingBytes.length; i++)
    zip.write(incomingBytes[i] & 0xFF);
    zip.close();
    byte[] uncompressedBytes = baos.toByteArray();
    return uncompressedBytes;
    public static String unzip(byte [] dataBytes)
    throws IOException
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ByteArrayInputStream bios = new ByteArrayInputStream(dataBytes);
    GZIPInputStream unzip = new GZIPInputStream(bios);
    int in = unzip.read();
    while (in != -1)
    baos.write(in);
    in = unzip.read();
    unzip.close();
    return new String(baos.toByteArray());
    public String postURL( String t1 , String t2 ){
    try {
              String data1="h";
    URL urlpost = new URL("http://192.168.15.4:8080/result.html");
         URLConnection conn = urlpost.openConnection();
         conn.setDoOutput(true);
         GZIPOutputStream gz = new GZIPOutputStream(conn.getOutputStream());
         byte [] kkkk=zip(data1);
         String uuu=unzip(kkkk);
         System.out.println("XXXXX" + uuu );
         for (int i=0; i< kkkk.length ; i++){
              Byte jj= new Byte(kkkk);
              System.out.println("LLLL " + " " + i + " " + jj );
         int t= kkkk.length;
         System.out.println("IIII" + t);
         int x= data1.getBytes().length;
         gz.write(kkkk);
         gz.finish();
         gz.close();
         // Get the response
         BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
         while ((line = rd.readLine()) != null) {
         // Process line...
         System.out.println ("The line is " + line );
         } catch (Exception e) {
              return line;
    The client output is
    LLLL 0 31
    LLLL 1 -117
    LLLL 2 8
    LLLL 3 0
    LLLL 4 0
    LLLL 5 0
    LLLL 6 0
    LLLL 7 0
    LLLL 8 0
    LLLL 9 0
    LLLL 10 -53
    LLLL 11 0
    LLLL 12 0
    LLLL 13 -25
    LLLL 14 6
    LLLL 15 107
    LLLL 16 -111
    LLLL 17 1
    LLLL 18 0
    LLLL 19 0
    LLLL 20 0
    Server output is correct only for the first 10 bytes
    LLLL 0 31
    LLLL 1 -117
    LLLL 2 8
    LLLL 3 0
    LLLL 4 0
    LLLL 5 0
    LLLL 6 0
    LLLL 7 0
    LLLL 8 0
    LLLL 9 0
    LLLL 10 -53
    LLLL 11 0
    LLLL 12 0
    LLLL 13 -25
    LLLL 14 6
    LLLL 15 107
    LLLL 16 -111
    LLLL 17 1
    LLLL 18 0
    LLLL 19 0
    LLLL 20 0

    FYI - I got it to work ... I was gzip it twice... here is what worked
    import java.io.BufferedReader;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.URLEncoder;
    import java.util.zip.*;
    import java.io.OutputStreamWriter;
    public class WorkingCopyOfGetPost {
         public String line;
         public String inputLine;
    public static void main(String[] args) throws Exception {
              WorkingCopyOfGetPost r = new WorkingCopyOfGetPost();
                   r.postURL("User","pass");
    // public Reverse { }
    public static byte [] zip(String data) throws IOException {
         byte[] incomingBytes = data.getBytes();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         GZIPOutputStream zip = new GZIPOutputStream(baos);
         for (int i = 0; i < incomingBytes.length; i++){
              zip.write(incomingBytes[i] & 0xFF);
         zip.close();
         byte[] uncompressedBytes = baos.toByteArray();
         return uncompressedBytes;
    public static String unzip(byte [] dataBytes) throws IOException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ByteArrayInputStream bios = new ByteArrayInputStream(dataBytes);
         GZIPInputStream unzip = new GZIPInputStream(bios);
         int in = unzip.read();
         while (in != -1){
              baos.write(in);
              in = unzip.read();
         unzip.close();
         return new String(baos.toByteArray());
    public static ByteArrayOutputStream zip1(String data) throws IOException {
              byte[] incomingBytes = data.getBytes();
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              GZIPOutputStream zip = new GZIPOutputStream(baos);
              for (int i = 0; i < incomingBytes.length; i++){
                   zip.write(incomingBytes[i] & 0xFF);
              zip.close();
              //byte[] uncompressedBytes = baos.toByteArray();
              return baos;
    public String postURL( String t1 , String t2 ){
         String data1="t";
         try {
              /* byte [] kkkk=zip(data1);
              for (int x=0;x<20;x++){
                   System.out.println("Byte Array Values " + x + kkkk[x] );
              ByteArrayOutputStream bo= zip1(data1);
              byte [] AAA=bo.toByteArray();
              for (int x=0;x<21;x++){
                   System.out.println("Byte Array Values " + x + " "+ AAA[x] );
              URL urlpost = new URL("http://192.168.15.4:8080/result.html");
         URLConnection conn = urlpost.openConnection();
         conn.setDoOutput(true);
         System.out.println( "The size of the byteArrayOutputstream " + bo.size() );
         bo.writeTo(conn.getOutputStream());
         // GZIPOutputStream gz = new GZIPOutputStream(conn.getOutputStream());
         // System.out.println("rrrr " + kkkk.length);
         // gz.write(kkkk);
         //gz.finish();
         //gz.flush();
         bo.flush();
         // String s=unzip(kkkk) ;
         //System.out.println("s " + s);
         // Get the response
         BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
         while ((line = rd.readLine()) != null) {
         // Process line...
         System.out.println ("The line is " + line );
         rd.close();
         bo.close();
         } catch (Exception e) {
              return line;
    }

  • Create a delivery note after an advance invoice is paid

    Suppose that the use of an advance invoice is that you deliver items to your client only after your client has paid the price for these items in advance.
    Now assume the following situation:
    1.
    You book an advance invoice.
    2.
    You wait until the amount of this advance invoice is paid by your client, i.e. until you are informed by your bank on the receipt of a payment.
    3.
    You book the receipt of payment in SAP.
    4.
    After this the status of the advance invoice is set to closed by SAP.
    5.
    This document status makes it unpossible to create a delivery note related to the advance invoice - the only way is to create a seperate delivery note without any relation to the original advance invoice.
    My question: Did I get the situation right? In this case I would say that the behaviour of SAP is erroneous - or are there any implicite reasons for this design decision?
    Any idea to come along with this?
    Thanks for your help!
    Frank.

    My question was too hasty.
    As I wrote in step 4 of my initial message after booking of payment in SAP the advance invoice is closed - this is correct.
    But my conclusion in step 5 is not correct in total:
    It is correct that you cannot create a delivery note as a sequel document to the advance invoice using "copy to" in the advance invoice form, since the advance invoice is already closed -
    but you can create a sequel delivery note document using "copy from" in a delivery note form related to the already closed advance invoice!
    Hence my question is obsolete!

  • Creating an invoice from a delivery does not closes the delivery.

    I am creating an invoice using DI. The invoice is based on an already existing delivery note.
    The delivery is manually created from SBO. When I'm creating the invoice I transfer all items and expenses from the delivery to the invoice.
    case 1. The delivery has no freight defined.
    When the invoice is created the delivery is automatically closed
    case 2. The delivery has some freight
    When the invoice is created the delivery remains open even though the invoice contains everything in the delivery, including the freight.
    'Copy to' from this delivery opens an invoice with no items - only the freight is filled.
    Currently I explicitly close the delivery using the Close method.
    Is this correct?
    Is it normal for the base document to remain open if the target document imports everything?
    Thanks,
    Svilen

    Hi Svilen,
    My experience with getting a delivery note to automatically close when I create an invoice against it is that the base document information on each line item on the invoice must be set to point at the delivery note (base document).  You are probably already doing this on your line items and that's why it closes when there is no freight.  But freight items have "base" fields too, and they have to point back to the freight item on the delivery note.   Are you setting the base doc info on the invoice freight lines?
    The following code worked for me (although this example is for sales order to delivery, it is the same thing for deliveries to invoices):
                    Dim ix As Short
                    Do Until ix = vso.Expenses.Count
                        vso.Expenses.SetCurrentLine(ix)
                        If vso.Expenses.ExpenseCode = _FreightExpCode Then
                            If vso.Expenses.Status = bost_Open Then
                                vDN.Expenses.BaseDocEntry = SODocEntry 'added 1/5/7 jc
                                vDN.Expenses.BaseDocLine = vso.Expenses.LineNum
                                vDN.Expenses.BaseDocType = SAPbobsCOM.BoAPARDocumentTypes.bodt_Order
                            End If
                            Exit Do
                        End If
                        ix += 1
                    Loop
    I'm looping through the target (order) document's freight records to find the matching one that I know is on it - you might be processing all - but then I load the sales order base docentry, base doc line# & base doc type to the delivery note freight line item.
    When getting this done, my source documents close OK.  In fact, I think they close even if the totals don't match on each record - just so long as every source doc record is pointed to by a target doc record.
    HTH

Maybe you are looking for

  • Error while importing Adaptive Web Service Model in WDJ

    Hello, We are getting following error while trying to import any web service using Adaptive WS model in WDJ. Error in loading WSDL file.Check the error log for more details. Log file shows following error message. !ENTRY com.tssap.util 4 0 Mar 05, 20

  • How to load multiple flat files

    Hi, I am new to ODI 10, I have one requirement where I need load flat files containing the folder size11GB. I want to load them all in a single instances with using of single data server, single physical schema and single logical schema. How can we d

  • String index out of range 12348

    hI, While creating external datasource i am getting error string index out of range 12348 thanks

  • Recommendation Request: Best flatbed scanner for use with Mac and iPhoto?

    I have a flatbed scanner that Mac doesn't recognize. It's 9 years old, does a great job, but only works with Windows. Period. Don't ask what model or anything, I've already done the research, it's hopeless. MOVING ON... I'm tired of BootCamping to Wi

  • Functional module Or BAPI

    Hello Guys, At my Client The Condition of table MSEG is not good, Now I have to create a report for Material wise Stock againest Production Order No. Is There any Functional Module Or BAPI Is available which provide me the Stock with respect to Mater