on 2015 Feb 24 5:44 AM
Hi everyone,
I'm creating a third party system that will insert Sales Order data using DI API to SAP B1...
I need to know if insert the data in table ORDR, is it automatically inserting the data in RDR1.?
this is my sample code.
Dim oSO As SAPbobsCOM.Documents
oSO = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
'set value
oSO.CardCode = "12345"
oSO.CardName = "Phoenix"
oSO.NumAtCard = "05314"
lRetCode = oSO.Add()
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MessageBox.Show("Error: " & sErrMsg & "; Code: " & lErrCode)
End If
Request clarification before answering.
Hi Weynard Lleva,
No your code is not inserting the data in line:
For Inserting the data at line:
oSO.Lines.ItemCode = ItemCode;
oSO.Lines.Quantity = Quantity;
oSO.Lines.UnitPrice = Price;
oSO.Lines.TaxCode = TaxCode;
oSO.Lines.DiscountPercent = DiscountPercent;
Hope it helps.
Thanks & Regards
Ankit Chauhan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Weynard,
Yes... All fields are not exposed in DIAPI. This is the limitations.
Also Cancelled field is updated automatically, once you will Cancel a document.
SAPbobsCOM.Documents oSO = (SAPbobsCOM.Documents)SBO_Company.GetBusinessObject(BoObjectTypes.oOrders);
oSO.GetByKey(3619); // 3619 is the DocEntry of a Sales Order.
oSO.Cancel();
the above sample will update the CANCELLED field automatically.
Hope it helps.
Thanks & Regards
Ankit Chauhan
Hi Weynard,
Mandatory fields cannot be mentioned in one time. It also depends on your company settings.
But normally the main fields are which Edy Simon has explained.
For more test, you can check by opening SAP B1. The fields that give you the error when you use SAP directly, also need to filled while using DIAPI.
Hope it helps.
Thanks & Regards
Ankit Chauhan
Hello,
I'm using this code
oSO.Lines.DiscountPercent = 0;
but when my app send the order to SAP, this field discountpercent has another different value, I don't from where
What am I missing ?
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 30 | |
| 27 | |
| 21 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 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.