on 01-11-2018 9:46 PM
I want to know, how to create/enter new sale order record usin SAP B1 DI API using vb.net.
1. How we get new document number and fill all required field of ORDR Table
2. How we add/post multiple lines in RDR1 Table.
Kindly guide what is required steps to generate document. Where changes required, how many other tables will be update.
Thanks
Waqar
Hi Waqar,
"1. How we get new document number..."
The system assigns a new document number at the moment you add the order. Upon success, you can query the system like this to get the new document number, for example to show to the user:
Dim oDoc As SAPbobsCOM.Documents
oDoc = oCompany.GetBusinessObject(BoObjectTypes.oOrders)
If oDoc.GetByKey(oCompany.GetNewObjectKey) Then MsgBox(oDoc.DocNum.ToString)
"...and fill all required field of ORDR Table"
The only required field is CardCode. All other fields will be filled according to the default settings in B1. Any other fields should only be determined when they deviate from the default setting.
"2. How we add/post multiple lines in RDR1 Table."
The system in B1 is that when you create a new document, it automatically has a first line. You then proceed to fill this line, if necessary you then add a new empty line which you then fill, etc. In pseudo code:
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Waqar,
"...you can share vb.net / c# sample code..."
As brendan.bell mentioned, once you install the SDK, you will get code examples for almost all operations, both in VB.NET and C#. Once you have written some code, and have more specific questions on how to do something, please post a new question here on SCN.
"...example only showing MSQL & MSSQL2005, but i have 2014..."
In your code, you need to connect to the company database. One of the steps is to determine the SQL version:
oCompany.DbServerType = BoDataServerTypes.dst_MSSQL2014
"...also guide me same logic work with HANA?"
To my knowledge, your code will also work with HANA. However, the sql syntax is different, and queries for MS SQL will not always work for HANA.
Regards,
Johan
Hi Waqar,
Firstly, have you checked in the SAP
C:\Program Files (x86)\SAP\SAP Business One SDK
There is a Help Folder with some help files
Second, there are also examples / samples in the same folder for various tasks to create documents in SAP.
In regards to document number, this is returned on successful posting of sat a sales order into SAP. You dont assign the number yourself.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
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.