Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8975

Re: How to insert sales order in SAP B1 using DI API with updating the quantity (inventory) in the various tables of stock

$
0
0

Hi,

 

When you add document you first have to check if the item in the document row have sufficient batchNumber and batchquantity, if you have this quantityBatch add the document via DI normally

 

But in the lines you have to set the exat batchnumber and batcquantity for each item.

 

maybe this help you

 

For i = 0 to orderrow.count -1 do

oOrd.Lines.SetCurrentLine(i)

oOrd.Lines.ItemCode=....

oOrd.Lines.Price=...

....

......

   j=0

  

'''''Repeat until item quantity is satisfy by batch quantity(you can have 1 batcnumber or more)

    For batchnumberofItem in (OBTNjoinOBTQwithqnty>0)  do

       oOrd.Lines.BatchNumbers.SetCurrentLine(j)

       oOrd.Lines.BatchNumbers.BatchNumber = BatchNumber

       oOrd.Lines.BatchNumbers.Quantity = Quantity

       oOrd.Lines.BatchNumbers.Add()

       oOrd.Lines.Quantity = oOrd.Lines.Quantity + oOrd.Lines.BatchNumbers.Quantity

       j+=1

     next batchnumberofItem

 

oOrd.Lines.Add()

 

Next i

 

 

Regards, Alessandro


Viewing all articles
Browse latest Browse all 8975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>