cancel
Showing results for 
Search instead for 
Did you mean: 

Allocating batches in Sales Order fails after deleting line (ODBC -2028)

Former Member
0 Kudos

Hi all,

When i try to make an allocating batches in Sales Order i got this error

<b>'No matching records found (ODBC -2028)'</b>

with SBO 2005 SP 01 PL31

this is the scenario to reproduce the error

<b>1-</b>Create a Sales Order with 7 lines or more

exemple:

-LineNum---ItemCode

-


0--


A001----

-


1--


A002----

-


2--


A003----

-


3--


A004----

-


4--


A005----

-


5--


A006----

-


6--


A007----

<b>2-</b> Save the Sales Order

<b>3-</b> Delete from a Sales Order, Line with LineNum =3

then on the RDR1 this Sales Order we will have the following lines

-LineNum---ItemCode

-


0--


A001----

-


1--


A002----

-


2--


A003----

-


4--


A005----

-


5--


A006----

-


6--


A007----

<b>4-</b> Save the Sales Order

<b>5-</b> Last step make an allocating batches in this Sales Order with this Code

If oDocOrd.GetByKey(161) Then

' here we set line to number 3

oDocOrd.Lines.SetCurrentLine(3)

Dim sTest As String

sTest = oDocOrd.Lines.ItemCode

' allocating batches

oDocOrd.Lines.BatchNumbers.BatchNumber = "20090630 - F18001 - N532"

oDocOrd.Lines.BatchNumbers.Quantity = 1

Dim lerr As Integer

Dim cherr As String

Try

lerr = oDocOrd.Update

If lerr <> 0 Then

GetSBO.SingleSignOn.oCompany.GetLastError(lerr, cherr)

Throw New Exception(CStr(cherr))

End If

Catch ex As Exception

GetSBO.SingleSignOn.SBO_Application.MessageBox("Error:" & lerr & "," & cherr)

End Try

End If

Message was edited by:

KOUACHI Hamza

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Perhaps it helps you to set the focus on the batch with the following code:

oDocOrd.Lines.BatchNumbers.SetCurrentLine(0)
oDocOrd.Lines.BatchNumbers.BatchNumber = your batch number
oDocOrd.Lines.BatchNumbers.Quantity = your quantity

I faced a similar problem with batches in delivery notes and this helped me a lot.

Former Member
0 Kudos

Hi Dennis,

Thanks for your response

I have already tried this solution but i have always the same error (ODBC -2028) No Matching Records Found

it's realy strange when i create the sales order with a same ItemCode on 7 lines and i delete the LineNum=4

on this case the Allocating batches is OK

i think something it's not OK between the RDR1.LineNum and Batch Allocating

i hope someone can help us

Message was edited by:

KOUACHI Hamza

former_member185703
Active Contributor
0 Kudos

Hi Hamza,

While I suspect that it will be rather easy to reproduce the issue - I am not sure how much time (if possible at all) it will take to find a workaround...; I will try, but I can't promise anything. Sorry.

Most important at this stage is that you raise the issue to SAP Support - so that it could (hopefully) get fixed!

Regards,

Frank

Former Member
0 Kudos

Hi Frank,

i have already posted a message on the marketplace and i hope they will fix this error

thanks for your help, have a nice day

Hamza

former_member204969
Active Contributor
0 Kudos

It may be the same error referred in Note 1056519.

It is recently corrected in 2004C.

Answers (1)

Answers (1)

Former Member
0 Kudos

when i try to update the line quantity is OK but if i try to update the batch number or the batch quantity the update fails

Please can anyone help me !!