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

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

  • Goods Receipt using Inbound Delivery with reference to Outbound Delivery

    Here is our scenario that we need help finding a solution:
    1.  Multiple Intracompany POs created
    2.  On the confirmations tab of the POs, we have u201CInbound Deliveryu201D Selected because the items need to be received in with Handling Unit management.
    3.  We have the Order Combination box checked on the shipping tab to allow 1 delivery to be created for multiple purchase orders.
    4.  We create only 1 Outbound Delivery for only available items on various purchase orders.
    5.  Due to being handling unit managed, we need to receive the items using an inbound delivery.
    Problem:  We need to find a solution to easily enter an outbound delivery number which will allow us to receive only the parts that were shipped (issued), via the inbound delivery process. 
    If we remove the confirmation control key, we can complete a Goods Receipt for Outbound Delivery in MIGO u2013 but is there a way to complete a goods receipt using an inbound delivery with reference to an Outbound Delivery?
    Thank you for the help.

    Hi,
    You can work with Inbound delivery created via IDOC Triggered from Outbound Delivery, this will carry the HU Data as well. Please refer this wonderful note, which will explain you a lot of things,  Note 1119073 - FAQ: Automatic inbound delivery creation for stock transfers
    There are other notes also available for Inbound delivery creation with HU in STO, please browse the notes, if you find any difficulty.
    Regards
    Chandra Shekhar

  • Posting goods receipt  using transaction MB1C

    Hi
    When I  posting goods receipt  using transaction MB1C , I am getting following error
    Account  310000 for Transo/event key BSX is a A control Account.
    Please tell me the solution for this error.
    kalai.

    Dear Suriya,
    If your issue is still un-resolved, Just try with:
    T. Code: FS00
    Key-in your G/L Account - 310000 & Company Code, in respective fields; go to
    Tab: Create/bank/interest
    Here, you will find a Box: Post automatically only. Enable the box (check-mark the box) for GR/IR clearing account.
    Jope, this may help in some ways.
    Best Regards,
    Amit.
    Note: In continuation to others' suggestion, I'll also suggest to consult FI-Personnel, at your end.

  • Add Sales Opportunity using DI API

    Hello Friends,
        I am trying to add Sales Opportunity using DI API.I want to set Potential amount using DI API So I set MaxLocalTotal but while compiling code its give error.Its Read only.
    If I add without potential amount than its gives me error  "Potetial Amout is missing"
    What should I do??
    My Code is 
                   SAPbobsCOM.SalesOpportunities vSOpp;
                    vSOpp = (SAPbobsCOM.SalesOpportunities)globals1.oCompany.GetBusinessObject  (SAPbobsCOM.BoObjectTypes.oSalesOpportunities);
                    vSOpp.CardCode = txtBPCode.Text;
                    if( txtCntctPerCode.Value!="")
                    vSOpp.ContactPerson = Convert.ToInt32(txtCntctPerCode.Value);
                    vSOpp.OpportunityName = txtOppName.Text;
                    vSOpp.SalesPerson = Convert.ToInt32(ddlSEmp.SelectedValue);
                   //vSOpp.WeightedSumLC = Convert.ToDouble(txtPotAmt.Text);
                    vSOpp.MaxLocalTotal = Convert.ToDouble(txtPotAmt.Text);       
                   culture = new CultureInfo("en-US", true);
                    currentprovider = CultureInfo.CurrentCulture;
                    dt1 = DateTime.ParseExact(txtSDate.Text, "dd/MM/yyyy", culture);
                    vSOpp.StartDate = dt1;
      if (vSOpp.Add() != 0)
                        //ResultMessage1.ShowFail("Failed to add a Activity");
                        globals1.oCompany.GetLastError(out nErr, out errMsg);
                        if (0 != nErr)
                            ResultMessage1.ShowFail(globals1.oCompany.GetLastErrorDescription());
                            globals1.oCompany.Disconnect();
                            return;
                    else
                        ResultMessage1.ShowSuccess("Activity added Successfully");
    Please help me to solved this problem.
    Thanks & Regards,
        Swati

    Hi folks,
    I'm facing the same problem. This issue concerns DI API of SAP Business One 8.8 (my version is SP 00 PL 11) in particular.
    I've used the 2007 version so far and even though the MaxLocalTotal field in Sales Opportunity object is read-only, by writing the same value in the field with the same name on the last Opportunity Line I obtain the right value in the header.
    In this version of the API, that field seems to be mandatory instead.
    Does anyone have any suggestion? Thank you in advance.

  • Close a Goods Receipt using DIAPI

    Hello averyone, I tried to find some information about this issue and manage to found some related information about closing transactions using the DIAPI.
    Thought, I need more specific information, can anyone tell me if it's posible to close a Goods Receipt using DIAPI? I need to close some of them using code so the user doesn't have to right click and select the Close option.
    Thanks in advance,
    Mariana Mazzero

    Hi,
    did you try with the Close method of the Documents object?
    you lookup for the object key then simply call Close().
    this is the sdk help example in vb6, it's on Orders but I hope it works on Good Receipt, too:
    Sub CloseDocument()
        Dim RetVal As Long
        Dim ErrCode As Long
        Dim ErrMsg As String
        Dim vOrder As SAPbobsCOM.Documents
        Set vOrder = vCmp.GetBusinessObject(oOrders)
        'Retrieve the document record to close from the database
        RetVal = vOrder.GetByKey("55")
        If RetVal <> 0 Then
            vCmp.GetLastError ErrCode, ErrMsg
            MsgBox "Failed to Retrieve the record " & ErrCode & " " & ErrMsg
                Exit Sub
        End If
        'Close the record
        RetVal = vOrder.Close
        If RetVal <> 0 Then
            vCmp.GetLastError ErrCode, ErrMsg
            MsgBox "Failed to Close the record " & ErrCode & " " & ErrMsg
        End If
    End Sub
    Hope this helps

  • Goods receipt using DTW

    Hi Experts
    I wasnt to be able to do a goods receipt using DTW. Please note that i DONT want to do a goods receipt for a customer
    Instead of manually doing a goods receipt through inventory> inventory transactions> Goods receipt (where there is no customer involved) i want to do a DTW import due to the volume
    Can some one tell me which upload spread sheets i need to use.
    I have looked at the SAP template under the that on the given template the customer code field is mandotary. AS mentioned above i do not want to use customers
    Thank you
    Kind Regards
    Apsara

    Hi Apsara.....
    I think something is wrong with the Goods Receipt OIGN template. Because it is purely for Stock not have concern with Business Patner.
    I would suggest you to create new template from Maintain Interface in DTW.....
    For How to Create Template unsing DTW please refer this link.......
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=64258757
    Regards,
    Rahul

  • Error while creating a Foreign Currency Receipt using Create_Cash API

    Hi,
    I am working on AR Receipts converison in R12 and trying to create cash receipts using AR_RECEIPT_API_PUB.CREATE_CASH.
    Receipt gets created successfully when the currency_code is USD. Receipt Method i am passing is 'Manual Receipt'.
    When the currency_code is not USD (EUR in my case), I am passing the values for p_exchange_rate_type and p_exchange_rate_date.
    But the API Errors out without creating the foreign currency receipt giving the Error: AR_RAPI_RCT_MD_NAME_INVALID.
    When i was trying to look at the API for this error, I dont see this error at all in the API. I see an error with the name 'AR_RAPI_RCPT_MD_NAME_INVALID' but nothing shows up for the error 'AR_RAPI_RCT_MD_NAME_INVALID' ('P' missing in 'RCPT'). I dont know where this error is getting invoked from?
    I am not sure why the API is erroring out for foreign currency receipt saying Receipt Method Name is Invalid. But it works fine for currency_code USD having the same Receipt Method Name.
    Any help would be highly appreciated.
    Thanks in advance.
    Regards,
    Kesava

    Hi Anil,
    Thankyou so much for the response. The issue has been fixed.
    There was a configuration missing on the existing bank account setup. On the Account Information Tab, ‘Multiple Currencies Allowed’ was checked, but on the Account Controls Tab, Receivables Controls/’Multiple Currency Receipts’ was not checked.
    I have ensured that both of them are checked and I am now able to create multiple currency receipts.
    Appreciate your help.
    Thanks,
    Kesava Chunduri

  • Create goods receipt using bapi fm

    hi friends,
                  i am geetha, i having a problem like while creating the goods receipt .
       create a goods receipt without purchase order using the tcode MB1C , I NEED EXACT  BAPI function module  to create agoods receipt.
    my fields are :
                         posting date
                          goods receipt issue slip number
                          movement type
                          matnr
                          quantity
                          units of measure
                           plant
                          storage location
    can you please suggest me the bapi  fm and describe the fm
    regards
    geetha.

    follow these links
    [link1|http://abap.wikiprog.com/wiki/BAPI_GOODSMVT_CREATE]
    [link2|Re: How to use bapi 'BAPI_GOODSMVT_CREATE'  in program?;
    Regards,
    SAPient

  • Reciving goods receipt using DTW

    HI All,
    we want to receive 10,000 serialized items using goods receipt PO using dtw. did any one tried using DTW. can you help us out how to do it.

    Hello,
    It is depending from SAp b1 Patch level and version. To book GPRO it is not a problem. In Older versions  of b1 2007 (pl 46,49) it had a bug to SN and Batches: somehow if a bacth/SN was applied 2-3 times in a document, it has fallen.
    Now it is ok.
    You need 3 files:
    1. document header
    2. document lines
    3. SN-s for document lines referenced to the line position.
    Regards
    János

  • Label printing at Goods Receipt using SMARTFORMS and Zebra software

    Hi Experts,
    Upon designing a functional design for the printing of labels upon goods receipt and a re-print through MB90 I would like to understand the procedure on how the label gets printed. From what I understand the following steps are done:
    A label is designed in the Zebra application tool.
    The file is downloaded from the application and uploaded into SAP
    A SMARTFORM is created in SAP and assifned to a new output type.
    The new output type is assigned to the Zebra Printer.
    Is there any need for an abap program to be written, if so when and what is its purpose?

    Output Type WEE1 uses sap print program  SAPM07DR.
    Can the following data fields be retrieved from this program:
    Material Number (MSEG-MATNR)
    Bin Number (MSEG-LGPLA)
    Material Description (Feed (MAKT-MATNR) Get (MAKT-MAKTX))
    Supplier Name: Feed (MSEG-MBLNR) get (MSEG-EMLIF)
    MSEG-EMLIF=LFA1-LIFNR
    Feed (LFA1-LIFNR) get (LFA1-NAME1)
    Supplier Material Number: Feed (EKPO-EBELN) get (EKPO-IDNLF)
    PO number and Item: Feed (MSEG-MBLNR) get (MSEG-EBELN) and (MSEG-EBELP)
    GRN Date: Feed (MKPF-MBLNR) get (MKPF-BLDAT)

  • The total goods movement status not changed after goods receipt using MIGO

    Dear gurus:
    when i use T-code MIGO doing goods-receipt against Inbound delivery, the total goods movement status don't changed. i tryed VL32N to do goods receipt, and the status changed.
    how can i do to make the status change when i receive goods in MIGO against inbound delivery?
    best wishes,
    David

    Hi,
    If your MM is integrated with WM (SU mgt or HUM) you have to post the GR with Inbound delivery.
    Amit

  • Posting Goods Receipt using DTW

    Hi Experts
    I am using DTW to post around 9000 Goods Receipt documents and I am having trouble getting the items to post at the correct price.   Each time I try to post SAP B1 (2007A) uses the Last Purchase Price price list even though I have a different item cost in the DTW document.
    I am using 2 .txt file for the header and rows respectively.  The header contains:
    RecordKey     DocDate     DocDueDate     TaxDate     Comments     Reference2
    The rows contain:
    RecordKey     LineNum     ItemCode     WarehouseCode     Quantity     Price
    How can I instruct using the DTW to post at the price in the txt file rather than defaulting to a system price list please?
    Thanks
    Geoff

    Hi,
    Instead of filling in the Price column, put your value in the UnitPrice colum (shows PriceBefDi in row 2).
    That will then give you that price instead of the price list price.
    Regards,
    Adrian

  • Good Receipt using BARCODE

    Hi,
    we want to make good receipt (gate entry MIGO) thru BARCODE.
    what setting are required in MM and ABAP Please reply it is urgent
    Any help will be rewarded.
    Regards
    shakir

    Hi
    Thanks for your help
    we are going to take service from expert for barcode.
    I will reply my experience
    and share with the forum.
    Also looking help from forum
    regards
    shakir

Maybe you are looking for

  • Reading a non-english character

    Hi, I have a trouble with reading a non-english character from a html page. I'm taking the word from the html page, and compare it with itself, like this string.equals("BİTTİ") but it returns false. is it possible to correct this?

  • Can't update OS to latest version - get error message

    I was getting some advice/suggestions for this problem (see below) from the imac section of Communities, and after several attempts did not work, a contributor suggested posting to the iphone forum. ( I don't know how to cross link) Problem: With my

  • I have two computers connected to my iTunes. but it won't sync. My new computer won't take the songs already on my iPod or give me the new songs on the computer. What do I do?

    I tried figuring out the icloud thing but all my settings are set to "on" so it should sync but it isn't... and plugging my ipod into my new computer doesn't change anything. The computer won't pick up the songs on the ipod and the ipod won't pick up

  • DVD will not start up?

    I insert the disk I wan't to play, and the iMac  Super Drive will not start. It accepts the dvd. makes noise like it wants to start, but then makes a winding sound, stutters a few times, then makes the sound as if a dvd was re-inserted, but then it g

  • Install Error 1714

    I currently have Adobe Acrobat 6.0 Standard on my PC running Windows XP.  I want to upgrade and have downloaded the trial version of Adobe Acrobat 9.0 Pro.  During the install I received "Error 1714" "The older version of Adobe Acrobat 9 Pro cannot b