cancel
Showing results for 
Search instead for 
Did you mean: 

Date deviates from permissible range

Former Member
0 Kudos

hi all,

I need help for sales order entry.

When I enter sales order entry then I get the error.

Error Is:

Date deviates from permissible range

My Code is :

Document doc = new Document();

_OrdSer = new OrdersService();

doc.Address = "ab";

doc.AgentCode = "ab";

doc.CardCode = "pmgweb2";

doc.CardName = "PMG Web Store Test Cust";

doc.DocDate = DateTime.Parse("2008-02-11");

doc.DocDueDate = DateTime.Now.Date;

//doc.TaxDate = DateTime.Parse("2008-02-11");

doc.DocType = DocumentDocType.dDocument_Service;

doc.DocumentStatus = DocumentDocumentStatus.bost_Open;

doc.BaseAmount = 1000;

doc.DocCurrency = "USD";

doc.DocNum = 1;

doc.HandWritten = DocumentHandWritten.tYES;

MsgHeader msgHeader = new MsgHeader();

msgHeader.SessionID = _SID;

msgHeader.ServiceName = MsgHeaderServiceName.OrdersService;

msgHeader.ServiceNameSpecified = true;

_OrdSer.MsgHeaderValue = msgHeader;

DocumentDocumentLine[] d = new DocumentDocumentLine[1];

d[0] = new DocumentDocumentLine();

d[0].ItemCode = "9786306243753";

d[0].ItemDescription = "abc";

d[0].UnitPrice = 10;

d[0].Quantity = 4;

d[0].SerialNum = "1";

d[0].LineNum = 0;

d[0].BaseLine = 1;

d[0].ItemDetails = "abdc";

d[0].TaxCode = "0";

DocumentDocumentLineSerialNumber[] dl = new DocumentDocumentLineSerialNumber[1];

dl[0] = new DocumentDocumentLineSerialNumber();

dl[0].SystemSerialNumber = 1;

dl[0].BaseLineNumber = 1;

dl[0].BatchID = "01";

d[0].SerialNumbers = dl;

DocumentDocumentLineBatchNumber[] db = new DocumentDocumentLineBatchNumber[1];

db[0] = new DocumentDocumentLineBatchNumber();

db[0].BatchNumber = "01";

db[0].Quantity = 4;

d[0].BatchNumbers = db;

doc.DocumentLines = d;

_OrdSer.Add(doc);

Please Help Me.

thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rob Moretti ,

You have to check date formate in SAP B1 and also check date formate in control panel > Regional and language settings.

Thanks,

Former Member
0 Kudos

Rob,

1st try to add the same sales order with out coding, with the same values. Add it directly frm the SAP UI, and then check for the result.

I guess the problem is in the posting periods and settings related to it, actually there is one setting that tell if we can post documents with earlier dates, plz check that setting.

Vasu Natari.