on 09-16-2014 3:29 PM
Hi All ,
I'm new here and i need help.
I need to be able to insert sales order data to SAP B1 using DI API.
Actually i can insert sales order SAP B1 using DI API and when i log in SAP i found the sales order created via DI API but the quantity in OITW and OITM table does not change.
Do I have to substract the quantity in OITW and OITM or sap will make the adjustment itself and how.
Any help would be very much appreciated.
Hi,
Maybe you could add a delivery too, so the standard sap update the quantity automatically
Regards, Alessandro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric
Thank’s for your answers.
If I have understand your last answer, you propose to set a values for SerialNumbers properties
and BatchNumbers properties this action will allow to "reserve (allocated) the goods.
I have a question, perhaps it is a stupid question, but I don’t found which is the value to be affected in SerialNumbers and / or BatchNumbers ?
Regards.
Hi Eric,
Sorry, I don’t understand your suggestion.
Below, the part of the code use to add the sales order line:
vOrder.Lines.SetCurrentLine (vOrder.Lines.Count - 1)
vOrder.Lines.ItemCode = “000025”
vOrder.Lines.ItemDescription = “TEST”
vOrder.Lines.Quantity=1
vOrder.Lines.BatchNumbers ==> Which is the value to be affected ?
vOrder.Lines.SerialNumbers ==> Which is the value to be affected ?
vOrder.Lines.Add
Regards
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
Hi Samy,
When you create a SO only the Committed quantity is changed.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your responses.
Sorry I have expressed incorrectly my question from the allocated of the quantity at
the stock tables, below the steps which I have realized to verify if the creation of the sales order via DI-API is correctly realized.
Step 1 : Found sales order created via DI-API
Step 2 :
Check if the quantity validated is reserved in the : selected batches table in the Batch Number Selection Form
==> But when i created directly the sales order via SAP B1, and when I check the selected
batches in the Batch Number Selection Form in SAP, I found the quantity validated.
My question, why the selected batches in the Batch Number Selection Form is empty when I create the sales order via DI-API and how resolved this problem.
Hi Samy,
I remind to have worked on this one (for sure for a Customer) but I don't remind if it was also to answer a question on the forum.
Basically, on the Documents_Lines property of the Sales Order (type of Documents) you have two properties, which are collections: SerialNumbers and BatchNumbers. By using them, you will be able to "reserve" effectively the goods.
Regards,
Eric
Hi Eric
Thank’s for your answers.
If I have understand your last answer, you propose to set a values for SerialNumbers properties
and BatchNumbers properties this action will allow to "reserve (allocated) the goods.
I have a question, perhaps it is a stupid question, but I don’t found which is the value to be affected in SerialNumbers and / or BatchNumbers ?
Regards.
Hi samy,
Welcome!
I suggest you to open SAP application and make manual entry check stock and all. The same thing applicable by posting via DI API also.
Thanks & Regards,
Silambu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Silambu,
I disagree on this one... And Ad is correct: functionally an order has to have no impact on the stock, neither on the G/L.
If you do manual transactions to modify the stock, when the order is going to be converted in Delivery / Invoice the stock will be updated again, so the stock operation will have to be posted twice.
Personally I woud prefer to know why the stock needs to be modified when an order is posted... And all in all, this is more a consultancy question than an SDK one.
Regards,
Eric
Hi Eric,
I mean, if samy is making entry manually he come to knows whether the stock is affecting or not.
An order does not change the quantities in stock.
When you create a delivery/invoice (from order) the stock is changed accordingly.
When you create a SO, only the Committed quantity is changed.
Thanks,
silambu
Hi Samy,
An order does not change the quantities in stock.
When you create a delivery (from order) the stock is changed accordingly.
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.