cancel
Showing results for 
Search instead for 
Did you mean: 

Create Purchase Request

10-08-2023 3:54 PM
ramco1917 Participant
905 views 3 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi

How we can create Purchase Request using c#

Thanks

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi ramco_1917,

There are many ways for creating the connection:

oCompany = new SAPbobsCOM.Company();
oCompany.SLDServer = "SLDServer:40000";
oCompany.Server = "DBSERVER";
oCompany.CompanyDB = "DBNAME";
oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2019;
oCompany.UserName = "manager";
oCompany.Password = "manager";
int C = oCompany.Connect();

Or, you can use Single Sign-On approach for connection. Kindly refer to the SAP Business One SDK Sample in the following folder:

C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM UI DI\CSharp\HelloWorld

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi ramco_1917,

You can use the Documents object to create the Purchase Request.

You need to initialize as below:

SAPbobsCOM.Documents oPRQ = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseRequest);

After that, you can set the other properties as per your requirement.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

ramco1917
Participant
0 Likes

Hi Ankit

How i will create connection to Sap B1 in c#.

Thanks