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.

Similar Messages

  • 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

  • Can't add a goods-issue with more than one item and one is serial managed.

    Hi,
    We are trying to issue more than one item to a production order using the DI API.  If none of the items is serial managed, they all are accepted and the goods-issue Add is successful.  If one the items is batch-managed, the goods-issue Add is also successful.  I am able to add the goods-receipt if I it contains only one item and it is serial-number managed.  However, if I’m issuing more than one item and one or more of the items is serial number managed, then the DI API will not add the goods-issue.  The error message that appears refers to an item that is not among the items being issued.  The message is:
    -10: (IGE1.WhsCode)(line: 3), ‘Item ‘A00006        ‘ with system serial 1 is not in stock.’
    Again item A00006 is not even in the group of items being issued.
    The code I am using for the serial number part is:
    With oGoodsIssue.Lines.SerialNumbers
              .SystemSerialNumber = rs.Fields.Item("SysSerial").Value
              .ManufacturerSerialNumber = rs.Fields.Item("MfrSN").Value
              .InternalSerialNumber = rs.Fields.Item("IntrSerial").Value
              .SetCurrentLine(n)
              .Add()
              rs.MoveNext()
              n += 1
    End With
    The rs is a recordset that the code is looping through as the serial numbers are being added.
    The error message does not occur during this code.  It occurs when it tries to add the full goods-receipt.  Does anyone have any idea how I can fix this?
    Thanks,
    Mike
    Edited by: Mike Angelastro on Mar 31, 2008 8:43 AM

    Hi Mike,
    Try to do the ".Add" only if you need it. Doing a ".add" without assignation may cause the error you have.
    I guess your n variable start at 1 or 0, so you could put code like this :
    With oGoodsIssue.Lines.SerialNumbers
    if n = 0 then (or 1, also I don't the correct syntax of your programming language)
    .Add()
    end if
    .SystemSerialNumber = rs.Fields.Item("SysSerial").Value
    .ManufacturerSerialNumber = rs.Fields.Item("MfrSN").Value
    .InternalSerialNumber = rs.Fields.Item("IntrSerial").Value
    .SetCurrentLine(n)
    rs.MoveNext()
    n += 1
    End With
    HTH
    Jodérick

  • How can I disable POST GOODS RECEIPT button in transactions VL31N/VL32N .

    Hi ,
    How can I disable POST GOODS RECEIPT button in VL31N/VL32N . 
    Its because, we wanted to use VL06I  to do PGR insted of VL32N.
    Thanks in advance.
    Rays

    Hi,
    if you have a look at program SAPMV50A then you can see that routine cua_exclude_dynamic is used to disable buttons dynamically. If you are on ECC6.0 then you can use implicit enhancement point to exclude code WABU_T which corresponds to "Post Goods Receipt". You can simply add the following lines at the end of this routine using implicit enhancement point.
    IF sy-tcode EQ 'VL31N' OR sy-tcode EQ 'VL32N'.
      PERFORM cua_fcode_allow USING 'WABU_T' no.
    ENDIF.
    Cheers

  • How can I disable POST GOODS RECEIPT button in transactions VL31N/VL32N via Authorization or Role Level.

    How can I disable POST GOODS RECEIPT button in transactions VL31N/VL32N via Authorization or Role Level, There is a requirement from my client  and i propose two methode
    1- Creation of Ztcode ZVL32N and do changes ABAP program level
    2- Disablement via Authorization/Role level - but how can i find the auth object/ Authorization corresponds to POST GOODS RECEIPT button in VL32N

    I think you can make use of SHD0 - Transaction variant to achieve this. You can make it as grayed out while recording steps in SHD0.

  • How can you add a where clause using "OR" with applied ViewCriteria?

    [JDeveloper 10.1.3 SU4]
    [JHeadstart 10.1.3 build 78]
    I am using JHeadstart, but have a question probably more in the ADF area. On the JHeadstart forum I asked:
    "I am overriding JhsApplicationModule's advancedSearch in order to be able to search in childtables. I created transient attributes, display those in advanced search and in the overridden method I check if any of these are filled by the user and create a where clause like 'EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> AND <another column in childtable> LIKE '<value supplied by user>)'. I add this whereclause using ViewObject.setWhereClause.
    So far so good and it works. However, if the user selects 'Result matches any criteria', combining setWhereClause and the normal advancedSearch QueryByExample implementation using ViewCriteriaRow do not provide the desired result, since the ViewCriteria and the setWhereClause are AND-ed together, which is fine if the user selects the (default) "Results match all criteria" (everything is AND-ed) but not the "Result matches any criteria", since then every criterium is OR-ed together, except for the setwhereclause criteria and the set of ViewCriteriaRows, they are AND-ed.
    I looked if I could specify that a WhereClause will be OR-ed to existing applied ViewCriteria, but no luck. Do I have to rewrite also advancedSearch's ViewCriteria implementation and write an entire setWhereClause implementation to be able to "OR" every criterium? Or any other suggestions? Can I look at the entire Where clause and rewrite it (after applyCriteria and setWhereClause are called on the VO)?
    Toine"
    Sandra Muller (JHeadstart Team) told me today: "This sounds like a JDeveloper/ADF issue that is not related to JHeadstart. The question is: how can you add a where clause using "OR" if there are already one or more ViewCriteria applied?
    To simplify the test case, you could create a simple ADF BC test client class in a test Model project without JHeadstart (in the test class, use bc4jclient + Ctrl-Enter), in which you first apply a few ViewCriteriaRows to a View Object and also add a where clause.
    Can you please log a TAR at MetaLink ( http://metalink.oracle.com/ ), or ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html ? (This what I am doing now ;-))
    Thanks,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting"
    Anyone knowing the answer or am I asking for an enhancement?
    Toine

    Hi,
    Can you SET your whereclause as follows ?
    ('Y' = <isAnd>
    and EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> AND <another column in childtable> LIKE '<value supplied by user>))
    OR ('N' = <isAnd>
    AND EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> OR <another column in childtable> LIKE '<value supplied by user>))
    )

  • 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

  • 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

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

  • I can remove add trusted devices are used in addition to my password

    i can remove add trusted devices are used in addition to my password in appleid

    Hi hoang32,
    Thanks for visiting Apple Support Communities.
    It sounds like you are wondering about removing or adding trusted devices to use with two-step verification for your Apple ID.
    You can use these steps to remove or add a trusted device:
    As long as you still have your Recovery Key and remember your Apple ID password, you can sign in and add a new trusted device to your account. You can also remove any devices you may have lost, sold, or given away.
    Go to My Apple ID (appleid.apple.com), select "Manage your Apple ID," and sign in.
    On the Verify Your Identity screen, select "Unable to receive messages at any of your devices?"
    In the pop-up window, enter your Recovery Key.
    Then, under "Edit your Apple ID," select Password and Security > Trusted devices > Manage.
    Remove the device you no longer wish to use to verify your identity.
    Either verify another device already listed, or select "Set up Find My iPhone" to add a new trusted device to your list.
    From:
    Apple ID: Can't sign in with two-step verification - Apple Support
    For more help with two-step verification, see the Frequently Asked Questions:
    Frequently asked questions about two-step verification for Apple ID - Apple Support
    Sincerely,
    Jeremy

  • How can I add a percssion instrument using creative sound bank mang

    I have Creative Sound Blaster Li've 24bitHow can I add a percossion instrument using creative sound bank manger. I have a sound font for the Tabla which is an eastern percossion instrument. I want to use it in my MIDIs, But I don't know how. I use the creative sound bank manger and have no proplem with it, but I can't add a percssion. what should I do?

    The link will look similar to
    myPage.php?ID=myVariable

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

Maybe you are looking for

  • JNDI Lookup in OC4J *AND* Tomcat 5 (not either/or)

    I've been struggling to get a web application to deploy and run correctly on Tomcat 5.x. I couldn't ADF to look up the Datasource I'd set up in the Tomcat configs. After reading this forum post: Problem deploying BC4J Toy Store app on Tomcat 4 I was

  • Z10 will not charge & with new Battery will not turn on

    I have have had my Z10 about a month now, I am gernerally happy with it as a work phone which is similar to my private Iphone5. Unfortunately the Battry life has been reducing on a weekly basis to around 4 hrs between charges. Now it is dead and will

  • Trying to Update Acrobat 8 on Off-Line Machine

    I have a computer with Acrobat 8 Pro installed, this computer does not have an internet connection and due to the environment can NEVER be connected to the internet.  I am trying to install the updates for this product, which I have downloaded and do

  • BOM and PDS in integration model

    Hi, All!! Could you help me colleagues? I try to create integration model in ECC (transacion CFM1), but at choice PDS or BOM the system gives out the message: "Integration model contains object types not valid for this APO release" How to transfer in

  • ORACLE 8에서의 ORA-1578 조치 방법(UPDATE)

    제품 : ORACLE SERVER 작성날짜 : 2003-06-12 Oracle 8에서의 ORA-1578(Data Block Corruption) 조치 방법 <사전에 알아두어야 할 사항> # Oracle 8의 ROWID 1. FORMAT : OOOOOOFFFBBBBBBSSS * OOOOOO - data object number 로서 물리적인 segment의 id를 의미 * FFF - row가 위치한 datafile의 relative datafil