Add  Delivery Note

Hi All
I'm try to add  Delivery Note via DI API and getting error
Error Code= -10
Error Message = "[DLN1.ItemCode][line: 1] , 'Do Not Use - On Hold -'"
Can any one plz help me in this regard...
Thanks in Advance

Hi,
One of the items in the delivery has been put "On Hold". From the error message, apparently the first item.
You need to either uncheck the "On Hold" check box in the item master data in the SBO client, or you can write code to check and see that an item is not On Hold, before you add it to the document.
Regards,
Johan Hakkesteegt

Similar Messages

  • How to Add Delivery Note based on sales Order

    How to add a delivery note based on sales order.
    say i have a order no. 10 and linenumber 0 to 3.
    each time i book with order no 10 and line no.3,i need to add to delivery note.
    i also in need of adding just one Header and Multiple lines(Header for order Number - 10 and multiple lines for each Booking ).
    How can i achieve this.

    Hi
    You can search the samples....C:\-->Program files->SAP----->SDK->Samples->DiAPI----->OrderandInvoice...
    Here invoice is added for a particular sales order.....the same can be done for delivery.....
    Hope it helps

  • How to add Delivery Note to RSEG in verified and already posted invoice

    I have verified and posted an invoice against a purchase order (before the goods receipt).  Now the goods receipt has been done I would like to be able to link this goods receipt with this verified invoice. As far a I know It would be enough if i was able to modify field XBLNR in table RSEG, but as the invoice is already posted the system doesn't allow it.  How should I proceed?
    Thanks in advance.
    Luis Álvarez.

    Hi Luis,
    You can do the following.
    1.- Go to MIR4 with your document.
    2.- Select "Follow-On documents" button.
    3.- In the next screen, select the "Change mode" button.
    4.- Now, select the "Display document header" button (it is the hat icon).
    5.- Finally, you can change your "Reference" field.
    I hope this help.
    Cheers,
    SP

  • Cannot add a delivery note with an item with serialnumbers via DI Server

    I'm using a web service to add delivery notes via DI Server. my code works for items that do not need serialnumbers or batchnumbers and even for those that need batchnumbers.
    but if I try to add an item with serialnumbers, I'm getting the following error:
    [DLN1.WhsCode][line: 0] , 'Item 'A00004' with system serial 0 is not in stock.'
    in the soap request I put the InternalSerialNumber, Location and BaseLineNumber. Because the error message tells me something about system serial, I've also added the SystemSerialNumber to the soap request. But then I'm getting another error:
    Failed to execute command.
    does someone know, what I'm doing wrong?

    Hi,
    i'm getting the same error when trying to add a delivery/invoice.
    "[INV1.WhsCode][line: 0] , 'Item 'xxxx' with system serial 2 is not in stock"
    its started just after upgrade to 2005 SP1 PL4 and i tried to upgrade to PL7 with no success. do someone else have the same issues?
    thanks
    Moty

  • Add ordered quantity to delivery note idoc desadv01 with user exit

    Hi,
    I am using the IDOC DESADV01 to output electronic delivery info when a user PGIs on a delivery note.
    The problem is I need some extra data like the original order qty, this exists in field VBAP-KWMENG
    So I think I would need to extend the idoc and do some kind of user exit to populate the value into the new idoc field.
    Unfortunately I have no experience with this, can anybody advise if its the correct way and how to get started?
    With thanks
    Rob.

    I apologies our system is totally different based on that I suggested.
    But current I guess you have to extend idoc.
    Below link is helpful for extending idoc.
    Let me know if still if you face any problem.
    http://www.intelligententerprise.com/channels/applications/feature/archive/kasturi.jhtml
    Thanks,
    Narayan

  • Error while Adding a Delivery Note with Barcode

    When i add the deliverynote , i get the following error :
    Error Code : -10 : Document can not be added: Base line item has been updated, re-transmitting the document data from the base document .
    or
    Access violation error
    This happens only when i assign a barcode to the item in the Item Master Data ( Eg : ITM001 is assigned a barcode ) .This works fine when the barcode is not assigned to the item .
    What is the cause of this error ?
    Obj := IDocuments(Company.GetBusinessObject(oDeliveryNotes));
    Obj.CardCode         := 'B1010';
    Obj.Lines.Add;
    Obj.Lines.BaseType   := bodt_Order;
    Obj.Lines.BaseEntry  := 100;
    Obj.Lines.BaseLine   := 0;
    obj.Lines.ItemCode := 'ITM001';
    Edited by: senthil kumar on Dec 2, 2009 1:04 PM

    Hello,
    I had the same problem. This occurs. when you change the barcode between sales order and delivery note, and YOu are issuing the Delivery note by DI API.
    To do:
    - Open Sales Order
    - OverWrite in the lines the barcode to the same as Material Master Data
    - Update sales order
    Issue delivery note.
    SAP Note number: 1314220
    Regards
    János

  • SAP standard Report-PO, delivery Note, Bill of lading,Header txt,GR/GI slip

    Dear Firends,
    Kindly tell me the SAP standard Report which give the details of
    Po number, delivery Note, Bill of lading, Header text and GR/GI slip no.
    Thanks in advance.
    Regards,
    william

    Hi,
    You can get all these fields in MB51 report by selecting the relavant fields in the selection variant. If any of the required fields are not available than you can add those in img -going tothe Inv Mgt-Reporting - Define field selection for material document list.
    Dhruba

  • Delivery Notes Generation Via Pick List

    Am trying to generate delivery notes off pick tickets and i can't find any code example. I now came up with the following code but am having issues when items are in multiple Bin Locations.
    Public Sub Sales2Delivery() '(ByVal OrderID As String)
            Dim OrderID As String = ""
            Try
                Using connection As New SqlConnection(StaginConn)
                    'Dim command As New SqlCommand("SELECT DocEntry from ORDR with (nolock) WHERE NumAtCard = '" & OrderID & "'", connection)
                    Dim command As New SqlCommand("SET DATEFORMAT DMY; select distinct top 5 o.DocEntry, o.NumAtCard from ordr O with (nolock) join RDR1 R with (nolock) on R.DocEntry = O.DocEntry join OPKL P with (nolock) on P.AbsEntry = R.PickIdNo where u_shipstate = 'Delivered' and CAST(O.docdate as date) >= '30/04/2014' and P.Status = 'Y';", connection)
                    connection.Open()
                    Dim reader As SqlDataReader = command.ExecuteReader()
                    ' Call Read before accessing data.
                    While reader.Read()
                        Dim BusinessOrders As Documents = DirectCast(vCompany.GetBusinessObject(BoObjectTypes.oOrders), Documents)
                        Dim BusinessDelivery As Documents = DirectCast(vCompany.GetBusinessObject(BoObjectTypes.oDeliveryNotes), Documents)
                        Dim orders As Documents = BusinessOrders
                        orders.GetByKey(Convert.ToInt32(reader(0)))
                        OrderID = Convert.ToString(reader(1))
                        Dim Delivery As Documents = BusinessDelivery
                        Delivery.CardCode = orders.CardCode
                        Delivery.CardName = orders.CardName
                        Delivery.NumAtCard = orders.NumAtCard
                        'Delivery.DocNum = orders.DocNum
                        Delivery.HandWritten = BoYesNoEnum.tNO
                        Delivery.Series = 8
                        Delivery.DocDate = DateTime.Today
                        Delivery.DocDueDate = DateTime.Today
                        Delivery.TaxDate = DateTime.Today
                        Delivery.Address = orders.Address
                        Delivery.Address2 = orders.Address2
                        Delivery.Comments = "Based on Sales Order #" + orders.NumAtCard & "."
                        Delivery.DocCurrency = orders.DocCurrency
                        Delivery.DocDueDate = orders.DocDueDate
                        Delivery.DocObjectCode = SAPbobsCOM.BoObjectTypes.oDeliveryNotes
                        Delivery.ShipToCode = orders.ShipToCode
                        Dim lines As Document_Lines = orders.Lines
                        'If (count > 0) Then
                        '    lines.Add()
                        '    lines.SetCurrentLine((lines.Count - 1))
                        'End If
                        Dim oPickList As PickLists = DirectCast(vCompany.GetBusinessObject(BoObjectTypes.oPickLists), PickLists)
                        oPickList.GetByKey(orders.Lines.PickListIdNumber)
                        For i As Int32 = 0 To (lines.Count - 1)
                            If i > 0 Then
                                Delivery.Lines.Add()
                                Delivery.Lines.SetCurrentLine(i)
                            End If
                            ' Set the Current Lines on the order
                            orders.Lines.SetCurrentLine(i)
                            Try
                                oPickList.Lines.SetCurrentLine(i)
                                Delivery.Lines.BaseEntry = oPickList.Lines.OrderEntry
                                Delivery.Lines.BaseLine = oPickList.Lines.OrderRowID
                                Delivery.Lines.Quantity = oPickList.Lines.PickedQuantity
                                Delivery.Lines.BaseType = DirectCast(SAPbobsCOM.BoObjectTypes.oOrders, Integer)
                                Delivery.Lines.BinAllocations.BinAbsEntry = oPickList.Lines.BinAllocations.BinAbsEntry
                                Dim rs As SAPbobsCOM.Recordset = vCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                rs.DoQuery("select itemcode, price, dscription from RDR1 R where R.LineNum = " & oPickList.Lines.OrderRowID & " and R.PickIdNo = " & oPickList.Lines.AbsoluteEntry)
                                While (rs.EoF <> True)
                                    Delivery.Lines.ItemCode = rs.Fields.Item(0).Value.ToString 'orders.Lines.ItemCode
                                    Delivery.Lines.UnitPrice = CType(rs.Fields.Item(1).Value.ToString, Double) 'orders.Lines.UnitPrice
                                    Delivery.Lines.ItemDescription = rs.Fields.Item(2).Value.ToString 'orders.Lines.ItemDescription
                                    rs.MoveNext()
                                End While
                                rs = Nothing
                            Catch ex As Exception
                                Continue For
                                My.Computer.FileSystem.WriteAllText(_LogPath, ErrDetails.ToString, True)
                            End Try
                        Next
                        If Delivery.Add() <> 0 Then
                            ErrDetails.AppendLine(" Unable to create Delivery note for Order: " & OrderID & " <br /> " & vCompany.GetLastErrorCode() & ":" & vCompany.GetLastErrorDescription())
                        Else
                            ErrDetails.AppendLine("Successfully created Delivery note for Order:" & OrderID) ' & " as requested by " & UserEmail & ".")
                        End If
                        orders = Nothing
                        Delivery = Nothing
                        BusinessOrders = Nothing
                        BusinessDelivery = Nothing
                        My.Computer.FileSystem.WriteAllText(_LogPath, ErrDetails.ToString, True)
                    End While
                    'orders = Nothing
                    'BusinessOrders = Nothing
                End Using
            Catch ex As Exception
                ErrDetails.AppendLine(" Error generating Delivery note for Order: " & OrderID & " <br /> " & ex.ToString())
                My.Computer.FileSystem.WriteAllText(_LogPath, ErrDetails.ToString, True)
            Finally
                If Not String.IsNullOrWhiteSpace(ErrDetails.ToString) Then
                    My.Computer.FileSystem.WriteAllText(_LogPath, (ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "Errors encountered while registering data on " & System.DateTime.Now.ToString("F") & ".Errors:" & ChrW(13) & ChrW(10) & Me.ErrDetails.ToString), True)
                Else
                    My.Computer.FileSystem.WriteAllText(_LogPath, (ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "Application Ran successfully on " & System.DateTime.Now.ToString("F") & "."), True)
                End If
            End Try
        End Sub
    The Error message am getting is 1470000368 - The quantity allocated to bin locations must be positive.

    Am getting this error now is
    "1470000341 - Fully allocate item "1017494" to bin locations in warehouse "Isolo". Issue is we have items in multiple Bin locations and the items have been picked via the pick ticket. Is it also possible to generate the delivery note off the Pick List.
    The new code am using is
        Public Sub Sales2Delivery() '(ByVal OrderID As String)
            Dim OrderID As String = ""
            Try
                Using connection As New SqlConnection(StaginConn)
                    'Dim command As New SqlCommand("SELECT DocEntry from ORDR with (nolock) WHERE NumAtCard = '" & OrderID & "'", connection)
                    Dim command As New SqlCommand("SET DATEFORMAT DMY; select distinct top 5 o.DocEntry, o.NumAtCard from ordr O with (nolock) join RDR1 R with (nolock) on R.DocEntry = O.DocEntry join OPKL P with (nolock) on P.AbsEntry = R.PickIdNo where u_shipstate = 'Delivered' and CAST(O.docdate as date) >= '30/04/2014' and P.Status = 'Y' and o.DocStatus = 'O';", connection)
                    connection.Open()
                    Dim reader As SqlDataReader = command.ExecuteReader()
                    ' Call Read before accessing data.
                    While reader.Read()
                        Dim BusinessOrders As Documents = DirectCast(vCompany.GetBusinessObject(BoObjectTypes.oOrders), Documents)
                        Dim BusinessDelivery As Documents = DirectCast(vCompany.GetBusinessObject(BoObjectTypes.oDeliveryNotes), Documents)
                        Dim orders As Documents = BusinessOrders
                        orders.GetByKey(Convert.ToInt32(reader(0)))
                        OrderID = Convert.ToString(reader(1))
                        Dim Delivery As Documents = BusinessDelivery
                        Delivery.CardCode = orders.CardCode
                        Delivery.CardName = orders.CardName
                        Delivery.NumAtCard = orders.NumAtCard
                        'Delivery.DocNum = orders.DocNum
                        Delivery.HandWritten = BoYesNoEnum.tNO
                        'Delivery.Series = 8
                        Delivery.DocDate = DateTime.Today
                        Delivery.DocDueDate = DateTime.Today
                        Delivery.TaxDate = DateTime.Today
                        Delivery.Address = orders.Address
                        Delivery.Address2 = orders.Address2
                        Delivery.Comments = "Based on Sales Order #" + orders.NumAtCard & "."
                        Delivery.DocCurrency = orders.DocCurrency
                        Delivery.DocDueDate = orders.DocDueDate
                        Delivery.DocObjectCode = SAPbobsCOM.BoObjectTypes.oDeliveryNotes
                        Delivery.ShipToCode = orders.ShipToCode
                        Dim lines As Document_Lines = orders.Lines
                        'If (count > 0) Then
                        '    lines.Add()
                        '    lines.SetCurrentLine((lines.Count - 1))
                        'End If
                        Dim oPickList As PickLists = DirectCast(vCompany.GetBusinessObject(BoObjectTypes.oPickLists), PickLists)
                        oPickList.GetByKey(orders.Lines.PickListIdNumber)
                        For i As Int32 = 0 To (lines.Count - 1)
                            If i > 0 Then
                                Delivery.Lines.Add()
                                Delivery.Lines.SetCurrentLine(i)
                            End If
                            ' Set the Current Lines on the order
                            orders.Lines.SetCurrentLine(i)
                            Try
                                oPickList.Lines.SetCurrentLine(i)
                                Delivery.Lines.BaseEntry = oPickList.Lines.OrderEntry
                                Delivery.Lines.BaseLine = oPickList.Lines.OrderRowID
                                Delivery.Lines.Quantity = oPickList.Lines.PickedQuantity
                                Delivery.Lines.BaseType = DirectCast(SAPbobsCOM.BoObjectTypes.oOrders, Integer)
                                'Dim rs As SAPbobsCOM.Recordset = vCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                                'rs.DoQuery("select itemcode, price, dscription from RDR1 R where R.LineNum = " & oPickList.Lines.OrderRowID & " and R.PickIdNo = " & oPickList.Lines.AbsoluteEntry)
                                'While (rs.EoF <> True)
                                Delivery.Lines.ItemCode = orders.Lines.ItemCode
                                Delivery.Lines.UnitPrice = orders.Lines.UnitPrice
                                Delivery.Lines.ItemDescription = orders.Lines.ItemDescription
                                '            rs.MoveNext()
                                '            End While
                                'rs = Nothing
                            Catch ex As Exception
                Continue For
                My.Computer.FileSystem.WriteAllText(_LogPath, ErrDetails.ToString, True)
            End Try
                        Next
                        If Delivery.Add() <> 0 Then
                            ErrDetails.AppendLine(" Unable to create Delivery note for Order: " & OrderID & " <br /> " & vCompany.GetLastErrorCode() & ":" & vCompany.GetLastErrorDescription())
                        Else
                            ErrDetails.AppendLine("Successfully created Delivery note for Order:" & OrderID) ' & " as requested by " & UserEmail & ".")
                        End If
                        orders = Nothing
                        Delivery = Nothing
                        BusinessOrders = Nothing
                        BusinessDelivery = Nothing
                        My.Computer.FileSystem.WriteAllText(_LogPath, ErrDetails.ToString, True)
                    End While
                    'orders = Nothing
                    'BusinessOrders = Nothing
                End Using
            Catch ex As Exception
                ErrDetails.AppendLine(" Error generating Delivery note for Order: " & OrderID & " <br /> " & ex.ToString())
                My.Computer.FileSystem.WriteAllText(_LogPath, ErrDetails.ToString, True)
            Finally
                If Not String.IsNullOrWhiteSpace(ErrDetails.ToString) Then
                    My.Computer.FileSystem.WriteAllText(_LogPath, (ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "Errors encountered while registering data on " & System.DateTime.Now.ToString("F") & ".Errors:" & ChrW(13) & ChrW(10) & Me.ErrDetails.ToString), True)
                Else
                    My.Computer.FileSystem.WriteAllText(_LogPath, (ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "Application Ran successfully on " & System.DateTime.Now.ToString("F") & "."), True)
                End If
            End Try
        End Sub

  • 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.

  • B1 Error with Item Batches and Delivery notes generation

    Hi Experts
    I am getting the following error
    SAPB1 error: (-10) [DLN1.WhsCode][line: 0] , 'The selected quantity of batch/serial numbers is greater than the open quantity.'
    When I try to generate a Delivery note based on information provided in a EDI file
    The EDI file contains item code, quantity, batches, batch quantities. I am able to generate the delivery however in certain instances I get the above error message.
    I am using IBOLT software to import the sales information into a delivery note in SAP.
    I am using SAP B1 2007
    Thanks
    Anthony Mendes

    Dear Mr Mendes,
    Obviously there is an error related to the warehouse on the first line of the document. Considering the error message I reckon that the information imported refer to a warehouse were there is not enough qty in stock and with batches.
    I would recommend to test the issue without using the add on and see if you can add the missing batches through the application (inventory - item management - batches - complete mode).
    If you can it means that the issue relates to the add on and therefore something must be changed in its code.
    If you have an issue in the application, please run the select query related to batches that you can find in note n. 1250867 and if that query retrieves results, please log a message.
    Regards,
    Marcella Rivi
    SAP Business One Forums Team

  • SOs,AR Invoices,and Delivery Notes have empty "Logistics" Tab

    Hi,
    As the title says Sales Orders,AR Invoices,and Delivery Notes have empty "Logistics" tab "Ship To" and "Bill To" windows - the Ship to and Bill To addresses are filled in the BP Master Data but they do not populate the logistics tabs Ship To and Bill To windows in these documents?
    Just to let you know that this is for only for new Business Partners as the old BPs seem to populate the logistics window automatically.
    Any ideas ?
    Thank you,
    MB
    Edited by: Matthew Brigley on Aug 13, 2010 11:53 AM

    Hi Matthew,
    The ST/BT address fields retain the information at the time the document was added. If there is no address then at the time the document was added, the address was set up.
    You can update the fields after the document is added for some of them (the address field will be white; grey means you can't update the field) - click in the ST/BT drop-down. If there is no option available, check the BP's address(es) to make sure there is an address set up. If you do add an address, close the document and re-open; the address should be available.
    If there is no address in the drop-down and there is an address on the BP record, check other transactions to see if it's BP-specific or all documents are not picking up the BP address info.
    Heather

  • Can you copy the Temperature in Delivery Note to Bulk Shipment document?

    Is there a way to copy the temperature inputted in the "Qty in Alternate UOM" tab in the item details of the Delivery Note to the Bulk Shipment document during the Change Loading confirmation process?
    One of our process requirements is to be able to copy the Material temperature and test temperature parameters, among others, from the delivery note to the Shipment document during O4G1 (change loading confirmation). We can only access until the Delivery Note, and then an automation in the system takes over, hence we cannot make changes in O4G1.
    What happens here now during O4G1 is the system does not look to the delivery note for whatever temperatures have been entered, but rather it looks back at the O3DEFAULTS table. The problem with that is, during the day, some temperature information can be updated, while O3DEFAULTS is updated perhaps only once a day.
    Is there a configuration setting that I can check?
    Thanks.

    Hi there,
    I do not think that there is standard way to copy additional quantities (Qty and temp data) from outbound delivery doc but I think you can do this thru custom developement like implementing BADI and add new tab "Qty in Alternate UoM" and get the data from LIPSO2 table. We have applied same approach on our TSW Nomination to display some additional data outside standard process.
    Hope this may help.
    Regards,
    RS

  • Adding Purchase Delivery Note with SerialNumbers via DI Server

    I try to add Purchase Delivery Notes via DI Server. It already works for items that do not need serial or batch numbers. But if I try to add a PDN with an item that needs such numbers, I'm getting an error that the line of the item cannot be added without these numbers.
    Then I tried to add SerialNumbers to my request, but I am still getting the same error.
    The xml template for the SerialNumbers part looks like this:
    <SerialNumbers>
    <row>
      <SystemSerialNumber />
      <ManufacturerSerialNumber />
      <InternalSerialNumber />
      <BatchID />
      <ExpiryDate />
      <ManufactureDate />
      <ReceptionDate />
      <WarrantyStart />
      <WarrantyEnd />
      <Location />
      <Notes />
      <BaseLineNumber />
    </row>
    </SerialNumbers>
    Can someone explain me, how to use it?
    What are the mandatory fields?
    What is <BaseLineNumber>? Is it the line number of the item in the purchase delivery note?
    Do I have to include <SystemSerialNumber> or will this number be generated automatically by SBO?

    Hi Nico,
    you should use the SDK Help Center to determine the mandatory fields...
    When creating an incoming document (Purchase Delivery Note) with serial numbers using the DI API I assign the InternalSerialNumber property only and this works.
    The only Mandatory field when creating an outgoing document is SystemSerialNumber which is the unique key for a serial number...
    As a side note, I am still experiencing some strange behaviour trying to use the DI API to create documents using serial numbers.  I am in contact with SAP regarding this but am getting very slow responses...
    Daniel

  • 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

  • Double entry of same delivery note during GR

    Dear experts,
    I want system to restrict user from making double GR against same delivery note number.
    Plz suggest me the solution.
    Can you tel me whether any user exit is available for the same & how to fulfill this requirement.
    Awaiting for ur valuable guidance....
    Thanks & Regards,
    Subhash

    Hi
    U can achive this by use of user exit
    check if u can apply following user exit in for MIGO
    MBCF0002
    MBCF0005
    u need to check same with help of abaper
    generally we can add user exit for trnx in CMOD code
    Vishal...

Maybe you are looking for