Goods Receipt PO - addition thru DI API

Dear All,
I am using DIAPI for developing an addOn. In that I am adding record into Goods Reciept PO using oPurchaseDeliveryNotes business object.
I am attaching my coding for your reference.,
=========================================================================
Dim oInvGenEntry As SAPbobsCOM.Documents
oInvGenEntry = vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
oInvGenEntry.CardCode = "V002"
oInvGenEntry.HandWritten = tNO
oInvGenEntry.DocDate = "19/02/2008"
oInvGenEntry.Lines.SerialNumbers.SystemSerialNumber = 111                    oInvGenEntry.Lines.SerialNumbers.ManufacturerSerialNumber = 222                    oInvGenEntry.Lines.SerialNumbers.InternalSerialNumber = 333
oInvGenEntry.Lines.SerialNumbers.BaseLineNumber = 0
oInvGenEntry.Lines.SerialNumbers.SetCurrentLine(i)
oInvGenEntry.Lines.SerialNumbers.Add()
        oInvGenEntry.Lines.ItemCode = oItems.ItemCode
        oInvGenEntry.Lines.ItemDescription = oItems.ItemName
        oInvGenEntry.Lines.WarehouseCode = "01"
        oInvGenEntry.Lines.Currency = CurrencyComboBox.SelectedItem
        oInvGenEntry.Lines.Price = CDbl(PriceText.Text)
        oInvGenEntry.Lines.Rate = 2
        oInvGenEntry.Lines.ShipDate = Now
        oInvGenEntry.Lines.Quantity = CDbl(QuantityText.Text)
        oInvGenEntry.Lines.DiscountPercent = CDbl(DiscountText.Text)
        oInvGenEntry.PaymentGroupCode = -1
        oInvGenEntry.DocTotal = 1
       RetVal = oInvGenEntry.Add()
       If RetVal <> 0 Then
                   MsgBoxLabel.Text = ErrCode & " " & ErrMsg
       end if
=========================================================================
When i am executing the above code i am getting error as below
[PDN1.WhsCode][line: 1] , 'P001 cannot be released from stock without a full selection of serial/batch no.'
I am able to add items without serial no. But I want a solution to add  items with serial no.
Please help me to resolve this issue.
thanks
regards,
Benjamin Rosary.B

I am presuming your SAPB1's connections is correctly. This C# sample works for me. In this case "P00128" and "ART0334" are CardCode, ItemCode respectively in my company;
Console.WriteLine("Connection established, the company is: " + oCompany.CompanyName);
SAPbobsCOM.Documents documents = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);
documents.CardCode = "P00128";
documents.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO;
documents.DocDate = DateTime.Today;
documents.DocDueDate = DateTime.Today;
documents.Lines.ItemCode = "ART0334";
documents.Lines.ItemDescription = "Art";
documents.Lines.WarehouseCode = "01";
documents.Lines.Currency = "USD";
documents.Lines.Price = 10.0;
documents.Lines.ShipDate = DateTime.Today;
documents.Lines.Quantity = 1.0;
documents.Lines.DiscountPercent = 0.0;
documents.Lines.BatchNumbers.Quantity = 1;
documents.Lines.BatchNumbers.ManufacturerSerialNumber = "SerialNumber";
documents.Lines.BatchNumbers.InternalSerialNumber = "SerialNumber";
documents.Lines.BatchNumbers.BatchNumber = "SerialNumber";
documents.Lines.BatchNumbers.SetCurrentLine(0);
documents.Lines.BatchNumbers.Add();
int resp=documents.Add();
if(resp != 0)
     Console.WriteLine("ErrorCode:" + oCompany.GetLastErrorCode());
     Console.WriteLine("Description:" + oCompany.GetLastErrorDescription());
oCompany.Disconnect();

Similar Messages

  • Can't add a goods receipt using 8.8 DP API.

    Hi,
    I'm having a problem adding a goods receipt using the 8.8 DI API.  It's not based on any document like a PO or production order.  It needs one line.  Here is my code:
                If ItemExists(ItemCode) Then
                    If TotalTime > 0 Then
                        With oGoodsReceipt
                            With .Lines
                                .ItemCode = ItemCode 
                                .Quantity = TotalTime
                                .UnitPrice = GetItemPrice(ItemCode, GetDefPriceList())
                                .WarehouseCode = Warehouse
                                With .UserFields.Fields
                                    .Item("U_NB_EmpID").Value = CStr(EmpID)
                                    .Item("U_NBS_BaseType").Value = ObjectType.ProductionOrder
                                    .Item("U_NBS_BaseEntry").Value = GetDocEntryFromDocNum("OWOR", PdONum)
                                    .Item("U_NBS_BaseLine").Value = PdOLine - 1  'One less than what the user sees on the PdO form.
                                End With
                                If .Count > 0 Then
                                    Err = oGoodsReceipt.Add()
                                End If
                                If Err Then
                                    oCompany.GetLastError(Err, ErrMsg)
                                    Throw New Exception("Function: ReceiveLabor - Error. " & ErrMsg)
                                Else
                                    NewDocEntry = oCompany.GetNewObjectKey
                                End If
                            End With
                        End With
                    Else
                        'Returning Labor
                    End If
                Else
                    Throw New Exception("Function: ReceiveLabor - Error. Item '" & ItemCode & "' is not in the item master.")
                End If
    The error message from SAP Business One is:  "[IGN1.WhsCode][Line: 1], 'Item no is missing'"
    I'm using SP: 00 PL: 04.
    The code looks like it ought to work.  Any ideas?
    Thanks,
    Mike
    Edited by: Mike Angelastro on Jan 4, 2010 10:03 AM

    I solved the problem.  The warehouse was not the correct one.

  • Goods Receipt PO Error

    Hi,
    I had code that add a good receipt PO with the DI API that works with SAP 2004 and 2005.
    Now, with SAP 2007, I receive this error when adding a goods receipt po with a product managed by serial number.
    -10 You should use existing serial/batch numbers for this document type
    or
    -10 Blank string are not allowed  in row 1(in unique field)
    Thank you for your help
    Jodérick Picard

    Hi,
    It seems to be a version problem. At that time, using another version solved the problem, or at least told us that the problem was the version used.
    HTH

  • Auto Goods Receipt posting in ECC using VL32N

    Hi ,
    We have a situation where in we have to post Goods receipt in ECC thru inbound IDOC with reference to  SNC - ASN.
    Till now we thought of using MBGMCR  - Message type with Idoc type : MBGMCR03.
    As MBGMCR uses BAPI - MB_GOODS_MOVEMENT - It calls in transaction : MB01 to post goods receipts.
    Which is the real problem - here we are posting goods receipts against SNC- ASN  number by passing this ASN number into E1EDP20 segment field LIFEX  but in the VBLEN field this BAPI is considering Material document number - Which in turn is not  updating inbound delivery document flow after goods receipt is posted.
    we have noticed same  inbound delivery is been considered multiple times for Goods receipts - because the inbound delivery document flow is not getting updated -  Which is the issue.
    Can any one used an IDOC (inbound ) in ECC to post Goods Receipt (101 movement ) which uses VL32N transaction.
    And is it a BAPI or any other thing ?
    Would appreciate your help.
    Regards,
    Mahesh

    We have used Message type : WMMBXY with an enhancement to user exit to mark status of inbound delivery to complete after entire quantity of Inbound delivery has been received.
    Thanks,
    Mahesh

  • Goods Receipt by DI API - Tax Data is Missing

    Hi all,
    When I add new document Goods Receipt by DI API then I have error : Tax data is missing.
    fragment my code : l
    pobranie = ((SAPbobsCOM.Documents)(SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)));
         pobranie.Reference2 = dr["RefNum"].ToString();
         pobranie.DocDate = DateTime.Now.Date;
         pobranie.DocDueDate = DateTime.Now.Date;
         pobranie.TaxDate = DateTime.Now.Date;
                                pobranie.Lines.ItemCode = dr["ItemCode"].ToString();
                                pobranie.Lines.Quantity = double.Parse(dr["Qty"].ToString());
                                pobranie.Lines.UnitPrice = (double)decimal.Parse(dr["Price"].ToString());
                                pobranie.Lines.Currency = dr["Currency"].ToString();
                                pobranie.Lines.AccountCode = dr["AcctCode"].ToString();
                                pobranie.Lines.WarehouseCode = dr["WhsCode"].ToString();
    dr - datareader in C#     
    I try to add line pobranie.Lines.TaxOnly = SAPbobsCOM.BoYesNoEnum.tYES or tNO it does't in proof
    Where is problem ?                
    THANKS a lot for your help
    Tomasz Derus

    Tomas, what support pack are you on?  There was a problem with the Material DI load.  The first 2 OSS Notes were in Support pack 14.  The third is coming in Support Pack 15.  Loading OSS NOTE 1265114 should fix your issue.
    Jayden
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1121867
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0001234550
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0001265114

  • Creating a Good Receipt PO via DI API No matching records found (ODBC -2028)

    Hi,
    I trying to create a Good Receipt PO via DI API.  It is working when the user I used to log in to SAP via the DI API is a Professional User but when I changed it to a Limited Logistics User, I'm receiving the No matching records found (ODBC -2028). I have already added the SDK Tools license to that user but still I'm receiving that error.
    So is it that the DI API will only work with a Professional User license or I can still use a Limited Logistics User?

    HI J S L,
    I get same error when I use different user that I just now add the SDK Tools without restarting the database server.  But previous user that I added SDK Tools before restart, no error.
    Today
    User 1 - add SDK Tools, no restart, error
    Last Wednesday
    User 2 - add SDK Tools, no restart, error
    Today - database server restarted this morning
    User 2 - no more error
    Both User 1 and 2 are Limited Logistics User.
    Best regards,
    Dennis

  • Copy data from a UDO form to Goods Receipt PO using UI API

    Hi, all
    I tried to copy data from a UDO form to Goods Receipt PO using UI API through following codes.
    It works fine while copying to a Item-type Goods Receipt PO.
    But when the doctype is set to service, I got errors.
    I use for-loop to copy two items, Description and LineTotal, into the matrix of Goods Receipt PO form, but both failed.
    any suggestion?
    Edited by: Chao-Yi Wu on Aug 25, 2009 5:50 AM

    Hi  Chao-Yi Wu ,
    SBO_Application.ActivateMenuItem("2306")
    Dim oFormGR As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm
    Dim omtxIQC, omtxGR As SAPbouiCOM.Matrix
    Dim oedIQC, oedGR, oed As SAPbouiCOM.EditText
    Dim ocbIQC, ocbGR As SAPbouiCOM.ComboBox
    oFormGR.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE
    oedIQC = oFormIQC.Items.Item("13").Specific
    oedGR = oFormGR.Items.Item("4").Specific
    oedGR.Value = oedIQC.Value
    oedIQC = oFormIQC.Items.Item("21").Specific
    oedGR = oFormGR.Items.Item("24").Specific
    oedGR.Value = oedIQC.Value
    oedIQC = oFormIQC.Items.Item("edComments").Specific
    oedGR = oFormGR.Items.Item("16").Specific
    oed = oFormIQC.Items.Item("3").Specific
    oedGR.Value = oedIQC.Value + ", Goods Recript PO:" + oed.Value
    ocbIQC = oFormIQC.Items.Item("cbDocType").Specific
    ocbGR = oFormGR.Items.Item("3").Specific
    If ocbIQC.Selected.Value = "I" Then
         ocbGR.Select(0, SAPbouiCOM.BoSearchKey.psk_Index)
    Else
         ocbGR.Select(1, SAPbouiCOM.BoSearchKey.psk_Index)
    End If
    omtxIQC = oFormIQC.Items.Item("mtx_0").Specific
    For i As Integer = 1 To omtxIQC.RowCount
    omtxGR = oFormGR.Items.Item("38").Specific
           If ocbIQC.Selected.Value = "I" Then
                oedIQC = omtxIQC.Columns.Item("c_ItemCode").Cells.Item(i).Specific
                oedGR = omtxGR.Columns.Item("1").Cells.Item(i).Specific
                oedGR.String = oedIQC.String
                oedIQC = omtxIQC.Columns.Item("c_AQty").Cells.Item(i).Specific
                oedGR = omtxGR.Columns.Item("11").Cells.Item(i).Specific
                oedGR.String = oedIQC.String
                oedIQC = omtxIQC.Columns.Item("col_19").Cells.Item(i).Specific
                oedGR = omtxGR.Columns.Item("14").Cells.Item(i).Specific
                oedGR.String = oedIQC.String
       Else  
    omtxGR = oFormGR.Items.Item("39").Specific
               oedIQC = omtxIQC.Columns.Item("c_Descrp").Cells.Item(i).Specific
               oedGR = omtxGR.Columns.Item("1").Cells.Item(i).Specific
               oedGR.String = oedIQC.String
               oedIQC = omtxIQC.Columns.Item("col_16").Cells.Item(i).Specific
               oedGR = omtxGR.Columns.Item("12").Cells.Item(i).Specific
               oedGR.String = oedIQC.String
      End If
                Next
    for items the matrix is 38 and for service the matrix is 39
    Rgds
    Micheal

  • PO Goods Receipt with Serial / Batch number with DI API

    I am creating PO Goods Receipt with DI API. This works fine. But when i have items with serial numbers and batch numbers in the same PO, then i am getting either of the following errors:
    1. [OITM]Item has no serial number management
    2. [OIBT] Invalid Item Code.
    I debugged the code and the values i set seems to be correct. I am using VB.Net and SAP 2004 with Patch 23.
    Thanks
    Anand

    Anand,
    When you are working with a Serialized item in the first scenario, have you tested working with the item in the Business One application itself?  Have you tried to have the system assign a serial number for the item when issuing a Goods Receipt?  Do you get the same issue through the Business One interface.  With respect to working with Batches, have you setup the Batches for inventory items through the Business One interface yet?  If you have not setup Batches, this would be why you would not have any data in the OIBT table.
    HTH,
    Eddy

  • DI API - Goods Receipt (OIGN) - HOWTO Set Price List ?

    Hi everyone,
    I want to create a Goods Receipt Document via DI API
    Documents doc = (Documents)cmp.GetBusinessObject(BoObjectTypes.oInventoryGenEntry);
    I set doc.DocDate of the document header,
    and doc.Lines.ItemCode, doc.Lines.Quantity of document lines
    In some cases, SAP does not allow me to add the document, namely when an item does not have a price...
    In SAP GUI there is a possibiliy to set a price list (instead of "Last Purchase Price")
    the related field in Database (OIGN) is "GroupNum"
    My question is now - How can i set this variable "GroupNum" via DI API? Documents contains no property for doing this??
    (I already looked at SDK Docu relating GetItemPrice, PriceLists but i didnt really found what i m looking for).
    Best regards

    Are you serious ?
    They use this property to change the Price List of a Goods Receipt ?
    I mean I understand that this is a Marketing Document but the lack of a property for disctinct values like Price List
    is not that good.

  • Add Goods Receipt using DI API

    Hi all,
    I want to add a new Goods Receipt using DI API, for each of the lines:
            oBatchReceipt.Lines.SetCurrentLine(1)
            oBatchReceipt.Lines.ItemCode = "ItemA"
            oBatchReceipt.Lines.WarehouseCode = "WH01"
            oBatchReceipt.Lines.Quantity = 1000
    instead of entering the unitcost of the item, i want to enter the line total.
    (unitcost or oBatchReceipt.Lines.Price is commented out)
            'oBatchReceipt.Lines.Price = costUnit
            oBatchReceipt.Lines.LineTotal = 1563
    so, when the Goods Receipt is added, there is no error popped up, but the total of created Goods Receipt is 0 (zero).
    I want to use the LineTotal instead of Price. Using the SBO system UI, user can enter quantity and linetotal and sytem will automatically calculate the price. But using DI API, i dont think it works because someone from forum says that LineTotal is NOT read/write property as written in SDK documentation.
    Anyone knows about this issue?
    Thanks.
    Cheers'
    erwine

    Hi Erwine Sukardy ,
                                   For eg.  you have used  an item  named as  " ItemA". Please go to the "Item Mater Data " . Set the unitprice as you required .Then no need to enter unitprice at line level using DIAPI .
                                If unitprice exists in item master data then . It will automatically calculates the LineTotal.
                          Hope it helps....,
    Best Regards
    V.Rangarajan

  • Auth error while post good receipt thru vl02n

    Hi,
    During Post good receipt thru t-code vl02n i am facing error as - "You have no authorization for this transaction with movement type 653"
    In the role i have given auth for vl01n,vl02n and vrre
    So pl guide to resolve this issue

    Hi
    please perform the transaction again. On error type /osu53 in transaction window. System will open new session and you will get details of Missing Authorizations. Give it to your Basis person to grant those missing objects.
    enjoy
    Atul

  • Requirement to maintain additional serial number during Goods Receipt

    We have a requirement to maintain an additional field external serial number while doing Goods Receipt for a PO using movement type 101. This requirement is in addition to the create serial number
    automatically. Which is enabled already.
    Can anybody please let me know how to take care of this requirement.
    Regards,
    Chandra Kumar

    BADI available MB_MIGO_BADI to take care of the requirement for additional custom field

  • Error - Addition of Batch wise GRPO thru DI API

    Dear All,
    I am facing the error "Can not release the item with selection of Batch/Serial" while adding the GRPO thru DI API.
    When I add only 1 line in GRPO with Batch Details thru coding,GRPO added successfully. But when there are more than 1 line then i get the above mentioned error.
    Edited by: anuj singh on May 7, 2011 11:31 AM

    Please show us your code, it's difficult to know the exact cause without seeing it.

  • UI API: Poor performance in Goods Receipt (PO) while inserting rows

    Hi all,
    we wrote small procedure, where we import some data from .txt file into Good Receipt (PO) document. There is no many infos there, we fill only these columns in GR matrix:
    ItemCode, Quantity, Warehouse
    For inserting data into document's row we use this code:
    oItCdCol.Cells(lRow).Specific.Value = Trim(sItm)
    oQtyCol.Cells(lRow).Specific.Value = Trim(sQty)
    oWHSCol.Cells(lRow).Specific.Value = Trim(sWHS)
    lRow = lRow + 1
    but with more than 30 lines in import file the performance is very poor, with cca. 300 lines it takes many hours. The GoodReceipt form is during import freezed of course.
    We use SBO2005 SP01 Patch 22. Is there performance problem with documents generally in this patch or something else?
    Thanks in advice.
    Kind regards
    Libor Mego.

    Are you working with Visual Basic 6 or Visual Basic from Visual Studio?.
    If you response VS, then try to use directly
    oItCdCol.Cells(lRow).Specific.Value = sItm.<b>Trim</b>()
    There is not the same througputh with olders function versus the newest.
    My recomendation is the same from Microsoft, "enjoy" always to use the Class routines like Trim, Integer.parse, <object>.ToString, ....

  • Goods receipts with GTIN barcode thru RF

    Hello Experts,
    In order to perform Goods receipts with a custom RF transaction, we need to scan the material number and PO number on the pallet that is sent by vendors.these barcodes are external barcodes from the vendor. Our vendors are using GTIN codes on the pallets, is it possible to scan these barcodes with RF solution ? is that involved some custom code in the RF development, where these barcode type is supported by SAP system?
    Thanks in Advance

    Hello,
    Based on my understanding below are my answers.
    Your question: is it possible to scan these barcodes with RF solution ?
    Asnwer: Yes. Through RF Gun you can scan and get the details
    Your Question: is that involved some custom code in the RF development,
    Answer: Yes. Because this GR is based on the GTIN scan number.
    You Question: where these barcode type is supported by SAP system?
    Answer: You can see in SPRO: LE: Mobile Data Entry: BarCode. where you can give the Bar code type.. Generally now a days Most Gtin numbers are UPC/EAN128 type.
    Coming to the process What my understanding is.... you need to have custom RF Z TCode (Program) required to sacn and process based on material and PO number.
    You can do GR directly by using functional module for VL01n/MiGO if WM is required then use functional module to create TO and confirm module to confirm....
    All i can say is anything you can so through costume program that can be assigned to RF menu management screen.
    hope i answer your questions based on my understanding.....
    thanks.
    tkreddy

Maybe you are looking for

  • Mac OS X Mountain Lion Boot Drive Issues

    Dear Apple Users, This is my first post here on the Apple Support Communities, so kindly forgive me if I'm repeating a previously asked question. I'd like to create a Mac OS X Mountain Lion USB Boot Drive and of course I already have it installed on

  • How do I import video from a Sony DSC-HX100V Camera into iPhoto

    How do I import video from a Sony DSC-HX100V Camera into iPhoto? . . . i can see all the photos but the videos are not visable (I also connected the SD card with a USB Sony SD Card Reader - again only the photos are accessible - no video files are sh

  • Acrobat 7 is not saving digital ID files

    Hello, I've searched ALL over and can't find anything relevant.  I am using Adobe Acrobat 7 Pro for digital signatures.  Recently it started to prompt me for a digital ID whenevr trying to sign a document.  I go into the security settings, select a d

  • Mount scan problems with Norton AntiVirus 10.1

    Autoscan freezes when I mount iPod in dock, connected to my iMac via a firewire connection. Autoscan will not respond to eject or cancel scan. When I eject the iPod in iTunes, the iPod screen continues to read "Do Not Disconnect". Any similar experie

  • Query execute() API goes for inifinite wait (Hang)

    Hi I am using BDB XML 2.4 in Fedora core-4. when I execute xquery update operation followed by FLWOR get query, the execute() API goes for infinite wait. We have tried setting NOWAIT flags to see if it waits for lock, but the program is in INFINITE w