Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to clear batch number assignment

Hello experts,

We use DI API to re-assign Batch Numbers automatically in Sales Order.

When the assignment is wrong, how to clear the assignment in Sales Order by DI-API ?

I had tried to clear it via DTW.

There are no error message and no effect.

Can someone help me ?

It would be very appreciated.

Many thanks for your time in advance.

Best regards

Sharon

Tags:
Former Member
replied

Hi Sharon,

you have to set the quantity of the batchline to zero :

SAPbobsCOM.Documents oDoc = SBO_Company.GetBusinessObject(BoObjectTypes.oOrders);

if (oDoc.GetByKey(DOCENTRY))

{

                oDoc.Lines.SetCurrentLine(LINE);

                oDoc.Lines.BatchNumbers.SetCurrentLine(BATCHLINE);

                oDoc.Lines.BatchNumbers.Quantity = 0;

                if (oDoc.Update() != 0)

                {

                        error = SBO_Company.GetLastErrorDescription();

                }

}

else

      error = "Document not found";

regards,

Maik

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question