Skip to Content
author's profile photo Former Member
Former Member

Problem Creating Recipt for production by DIAPI

Hi,

when i adding Receipt for production by code

SAPbobsCOM.Documents oDocument = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry);

oDocument.DocDate = DateTime.Parse("01/11/07");

oDocument.Lines.SetCurrentLine(0);

oDocument.Lines.BaseType = 202;

oDocument.Lines.BaseEntry = 5;

oDocument.Lines.Quantity = 20;

oDocument.Lines.WarehouseCode="01";

oDocument.Lines.Add();

int k=oDocument.Add();

then it is generating error

"If one of the lines is referenced to production, then all lines should be referenced"

Please help....

Regards,

Lalit Narayan

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 01:36 PM

    Hi Lalit,

    The solution is: you should use the Lines.Add() function only if you want more then 1 line to receive!

    Thus, in your example you should NOT put the Lines.Add() since it will add a second line and when you make the GR, SBO checks its empty and gives the error associated to this new empty line.

    I had the same problem and realized that SBO objects works in a strange way ...

    Regards,

    Manuel Dias

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 01, 2007 at 05:43 AM

    Hi Lalit,

    Did u try adding the same document thru SAP try with the same values.

    Regards,

    Vasu Natari.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.