Goods Receipt PO - GetByKey error

Hello,
I have added a user button on Goods Receipt PO. When I click the button I read the document number of the receipt (idocnum). With this number I want to find the correct receipt in the object:
oGRPO = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);
bool bRetCode =  oGRPO.GetByKey(idocnum);
But bRetCode is false, meaning that it couldn't find the document. Why?
Thank you,
Irina

Hi Irinia,
You must use the docentry and not the docnum in the getbykey.
You can use query on opdnto get the docenty
Select docentry from opdn where docnum=9999
Regards
Ad

Similar Messages

  • Goods Receipt unchecking causing error

    Hi Gurus,
    I need your help.
    The scenario is
    "I am trying to uncheck "Goods Receipt" flag in the Delivery Tab of PO line item. The material is NLAG one . While saving the PO, I am getting the error message "GR mandatory for PO  item 00010 . No entry in GR Check Table".  What config change I have to do?
    Thanks,
    Kumar

    If it is NLAG material, then the PO should have an account assignment. is that the case?
    you usually receive this message if there is no account assignment which means SAP posts to a stock account.
    NLAG should not do this my nature, but NLAG is just a name, even for this material type one can flag quantity management for a certain plant in customizing of material type attributes. check if this was done.

  • Cannot post Goods receipt in MIGO Error message"Field Business Area requird

    Hai
    I am posting Goods Receipt ( MIGO) with Reference to Purchase Order its having 47 Line item material. When i will doing Goods Receipt with rreference to po number its triggered error message in :Message No F5808 Field business Area is a Required  field for G/L account 1180 300000 . for only particular line item 47 material shown error..
    i checked all the settings in MM Automatic determination And G/L element, field variants, posting keys.. but everything configured profer settings..why particulat materail it shown error? how to resolve this error?

    Hi Thiru,
    A somewhat late aswer, but it might be helpfull for other users with the same problem. You can solve this problem by assigning the division/valuation area to the business area. Follow the path below to execute this:
    SPRO - enterprise controlling - Consolidation - Integration: preparation for consolidation - Preparation in the sender system - Further settings for Business Area Consolidation - Materials Management - Assign Division/Valuation Area to Business area.
    Under Enterprise structure -  Assignment - Logistics General, you will find a similar function. First execute option 1 or 2 here and then execute option 3. This makes it work as well, exept that it will not be recorded in a proper transport. The first option I gave for assigning is properly transportable.
    Greetings,
    Sjaak van den Berg
    Magnus Technology Consultants
    Edited by: S. van den Berg on Aug 14, 2009 1:09 PM
    Edited by: S. van den Berg on Aug 14, 2009 1:10 PM

  • Goods receipt Purchase Order error (MIGO_GR)

    Hi
    I'm trying to save this transaction but it is giving me an error message.
    The message comes up as -
    *" User ******** already processing Purchasing document **************"
    This message has been there for 5 hours now
    We have tried few things but this document is stuck somewhere and we don't have this document number is our system.  Is there anything I can do to find out what happened?
    Thanks and regards

    HI,
    whenever if you have opened same document or link to that document then you will get this error
    or before Posting if SAP stops or reset happens than you will get this errors.
    Please go to SM12  if you have authorisation , or any user who is having Authorisation for SM12 and select the User who has done this transaction and blocking is happend then delete all the items in that screen.
    Go back and now do the Transaction what you want to do it will Post.
    with regards
    Shrinivas gangoor

  • Error while posting goods receipt

    Hi All,
    I am getting error message while posting goods receipt.
    The error says posting only possible 2007/06.....
    Thanks in advance
    kumar

    Go to MMPV give your company code and the period and the fiscal year and execute.
    Regards'
    Navin

  • Error in Posting Goods Receipt

    Hi Experts,
    I am getting the following error when i am posting a goods receipt.
    Syntax error in validation prerequisite "VALLGAP", step ""
    Message no. GB 033
    Diagnosis
    A syntax error was found in validation VALLGAP during the ABAP code generation. The error concerns the validation prerequisite.
    System Response
    An ABAP code is not generated for this Boolean statement and the statement is evaluated as FALSE (in ABAP include GBTAFFIE).
    Procedure
    Correct validation VALLGAP (step ) using validation maintenance.
    I am a functional guy, i don't have any coding knowledge. Please help.

    Hi,
    Check if there is a validation VALLGAP in transaction GGB0. If there is, then this validation is not correct.
    Hope it helps.

  • Error while Goods receipt for rework order.

    Dear all,
    I have created one Rework order through TC CO07.
    While doing Goods Receipt it gives Error Msg as following.
    "No valid order items exist for order 200000203"
    Message no. C6008
    Regards
    Atul

    Dear,
    There is only confirmation CO11N for the rework order. And good reciept MB31 for main order.
    There is no GR for rework order. Once you confirm rework order,you need to do the GR for the balance qty of  main order or parent order.
    And you need to priliminary settlement of rework order first in CO8B, hence the cost will be moved to parent order, then you settle parent order in KO88.
    Hope clear to you.
    Regards,
    R.brahmankar

  • Issue in goods receipt

    Daear All,
    while doing goods receipt getting the error message : Acct. 200510 for trans./event key BSX, postable directly.
    the same in goods issue also.
    please help me on this.
    Best Regards,
    Venkat.

    The tick mark is already is there.
    By,
    Venkat.

  • Posting Goods Receipt Problem

    Dear All
            During Posting Goods Receipt, Systems showing error msg " Account determination for entry INT BSX_____     ______ 3000 not possible,
      so i used TCode OBYC and OMWD  for account determination, but it again showing same error msg,
    How to solve this, can anyone heip me.
    Thanks

    in obyc chect the posting rule of BSX
    generally it should be valuation class and gl account
    that is valuation class should be only tick
    i think in ur case both are tick
    so just tick valuation class in rules of BSX
    and make the entry on
    3000 and gl account
    also check what is the plant in PO
    and in OMWD give 0001 val grouping code
    if u do this i think ur issue will be solved

  • Subcontracting- Good Receipt Problem

    Dear All,
         In Subcontracting, when Posting Good Receipt, the systemshowing error msg " The G/L Account 891000 does not exist in company code.
    so i tried Tcode FS00, but it asking G/L Account, how can i create it, can any one help me.
    Thanks

    First of all check in FS00 whether the g/l account is present in any of your other company codes.If yes then copy the same for your present company code....
    If you have only one company code then you or your FI person has to create it through FS00........
    Regards,
    Indranil

  • No grid values for PO 4500000002 00010; goods receipt not possible

    Dear Experts
    I have been configuring AFS, 1st I create Charactreristic for Size and Colour, 2nd assigned it in MM01. And create PR and PO. When I Goods receipt the following error occured.
    "" No grid values for PO 4500000002 00010; goods receipt not possible
    Message no. 8J658 ""
    But I can see the grid like the below mentioned in MIGO screen "Grid Value " field
    I have mentioned One size and three colours
    Grids like
             Size
    Grn       S
    Blu       S
    Yell      S
    Pls help me.
    Thanks
    Rajakumar.K

    In PO item level go to Delivery shcdule tab and over there you have to select the grid value
    Hope u clear

  • Error adding Goods Receipt PO based on Purchase Order

    I am working on an add-on that was working against a 2005A version of SAP Business One and I am upgrading it to run against a 2007A Company (PL41)
    I am receiving strange errors when testing the add-on.
    I can add a Purchase order not based on a Goods Receipt PO without any problems but as soon as I specify a base type, entry and line I get either -1 General Error, or the Tried to Read/Write Protected Memory Error.  The error I receive seems to arbitrarily change between the two.
    I have read a few notes on the forums about this but none of them have proven useful in solving my problem.  I have checked the DI-API version on my PC and it is definitely using 8.0.177.0 which matches the version of SBO that I am running.  I have re-installed the DI etc without any success.
    The following is the code snippet which I am using to test:  I have verified that the referenced purchase order is open, contains the correct item, customer etc
    int iResult = -1;
    string sResult = string.Empty;
    string sOutput = string.Empty;
    try
    sOutput += Environment.NewLine + "Connecting to company...";
          sbocoy = new SAPbobsCOM.Company();
          sbocoy.Server = "<insert server name here>";
          sbocoy.CompanyDB = "<insert database name here>";
          sbocoy.LicenseServer = "<insert server name here>:30000";
          sbocoy.UseTrusted = true;
          sbocoy.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005;
          sbocoy.UserName = "manager";
          sbocoy.Password = "<inser sap user here>";
          iResult = sbocoy.Connect();
          sOutput += Environment.NewLine + "Connected";
          SAPbobsCOM.Documents PO = (SAPbobsCOM.Documents)sbocoy.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders);
          SAPbobsCOM.Documents GoodsReceiptPO = (SAPbobsCOM.Documents)sbocoy.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);
          sOutput += Environment.NewLine + "Get Purchase Order";
          PO.GetByKey(1402);
          sOutput += Environment.NewLine + String.Format("DocNum: {0}; DocEntry: {1}; ItemCode: {2}; LineNum: {3}", PO.DocNum, PO.DocEntry, PO.Lines.ItemCode, PO.Lines.LineNum);
          GoodsReceiptPO.CardCode = PO.CardCode;
          GoodsReceiptPO.CardName = PO.CardName;
          GoodsReceiptPO.Lines.ItemCode = PO.Lines.ItemCode;
          GoodsReceiptPO.Lines.ItemDescription = PO.Lines.ItemDescription;
          GoodsReceiptPO.Lines.Quantity = 1.0;
          GoodsReceiptPO.Lines.BaseType = int.Parse(PO.DocObjectCodeEx); // If I comment out this and the next two lines the document will add
          GoodsReceiptPO.Lines.BaseEntry = PO.DocEntry;
          GoodsReceiptPO.Lines.BaseLine = PO.Lines.LineNum;
          sOutput += Environment.NewLine + "Adding Goods Receipt...";
          iResult = GoodsReceiptPO.Add();
          sResult = sbocoy.GetLastErrorDescription();
          sOutput += Environment.NewLine + string.Format("Result [{0}] {1}", iResult, sResult);
    catch (Exception ex)
    sOutput += string.Format(Environment.NewLine + "Exception: {0}{1}SBOError: {2}", ex.Message, Environment.NewLine, sbocoy.GetLastErrorDescription());
    The results when I try and reference the purchase order are:
    Connecting to company...
    Connected
    Get Purchase Order
    DocNum: 301396; DocEntry: 1402; ItemCode: SEANTESTITEM; LineNum: 1
    Adding Goods Receipt...
    Exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    If I comment out the 3 lines that reference the base document the Goods Receipt Adds and the following is the output...
    Connecting to company...
    Connected
    Get Purchase Order
    DocNum: 301396; DocEntry: 1402; ItemCode: SEANTESTITEM; LineNum: 1
    Adding Goods Receipt...
    Result [0]
    The above code will work correctly if we base a Delivery Note on a Sales Order so it appears to be specifically related to the Purchasing Documents.
    Edited by: Sean Archer on Feb 2, 2009 2:23 PM

    Hi Ganesh,
    Thank you for the reply.
    I ran the add-on against another database and it is working.
    I also verified that the document was failing to create if done via the Data Transfer Workbench so it would appear the issue affects the DI-API irrespective of add-on.
    I will need to do more testing to confirm whether this is a bug with PL41 of 2007A or a corrupt database as you suggest.
    Cheers,
    Sean

  • Error trying to use multiple lines from a PO in a Goods Receipt PO

    I get the following error when I try to add 2 lines from a PO to a single Goods Receipt PO (code below):
    -5002 One of the base documents has already been closed  [PDN1.BaseEntry][line: 1]
    I can create the Goods Receipt PO if I use 1 line or lines from multiple PO's???
                   SAPbobsCOM.Documents poReceipt2 = (SAPbobsCOM.Documents)_diApi.SboCompany.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes);
                   poReceipt2.CardCode = "ALL";
                   poReceipt2.DocDueDate = DateTime.Now;
                   poReceipt2.Lines.Quantity = 5;
                   poReceipt2.Lines.ItemCode = "HAMSHA";
                   poReceipt2.Lines.BaseEntry = 11;
                   poReceipt2.Lines.BaseLine = 0;
                   poReceipt2.Lines.BaseType = 22;
                   poReceipt2.Lines.Add();
                   poReceipt2.Lines.Quantity = 5;
                   poReceipt2.Lines.ItemCode = "LAMFIL";
                   poReceipt2.Lines.BaseEntry = 11;
                   poReceipt2.Lines.BaseLine = 1;
                   poReceipt2.Lines.BaseType = 22;
                   poReceipt2.Add();
    Any help is appreciated!
    Thanks,
    Daniel

    Hi Louis, thanks for the post...
    However the PO document that I am refercing definately has both lines open, if I use 1 of those lines it works fine, but the error occurs if I use 2 lines from the same PO.  I am also definately using the docentry not the docnum for the GetByKey() method.
    Can anyone run the same basic logic through the DI API?  That is create a PO with 2 lines on it, then run the code as above to make a Goods Receipt PO and reference the 2 lines from the 1 PO document?  (It works if I add multiple lines referncing lines from multiple PO docs??)
    Thanks,
    Dan
    Message was edited by: Daniel Archer

  • Error in creation of purchase materials/Goods receipt against PO(FI-MM)

    Hi All,
    While processing FI - MM integration iam facing below errors,request to guide me with same
    1) While creation of purchase materials
    Valuation class 7920 not allowed for material type Raw material Message no. M3180
    Diagnosis
    The combination of values you have entered is not defined in the system.
    Procedure
    Check your entries, and choose a valid value or combination of values with F4.
    I have crossed checked in t code OMSK valuation class 7920 exists.
    2) Goods receipt against PO:
    Number range for trans./event type WE in year 2014 does not exist Message no. M7562
    Diagnosis
    The number range for document number assignment has not been maintained in the year 2014 for the transaction/event type WE.
    Procedure
    Contact your system administrator.
    in second case i have maintained number ranges in OBA7,OMBT,still iam facing with the same issue
    Regards
    Santosh

    Hi Dev,
    Thanks for your reply...yea i have done the ground work before posting this query
    but bitt confused with the post i have come across..
    Problem was occurring due to the wrong updating of raw material instead of finished goods in  MM01 (CREATION OF PURCHASE MM)
    however i have over come my 2nd issue,hopefull will over come my 1st issue also
    Thanks a lot
    Santosh 

  • Error while doing goods receipt

    Dear All,
    against Po when i am doing Goods receipts (migo) i am getting this error, " G/L Account 379998 does not exisr in co COde"    and for this
    i went to FS00 and tried to create GL account for co code, for this i am getting error as" corporate group account 310100 not defined on group of chart account INT"
    Please Help
    Regards
    http://saphelp.hpage.com/
    http://saphelpone.blogspot.com

    Go to OB13, select the Chart of Account and execute.  There you can see a field "Group Chart of Accts"  under the tab "Consolidation".   Check with your FI people and find out whether this is the root cause of your error as I am not sure on this.
    thanks
    G. Lakshmipathi

Maybe you are looking for