on 01-06-2015 11:09 AM
Hello Experts,
I am stuck at a place and need your guidance.
I need to add a business partner into SBO using XML(DI Server).
have a look at the code given below.
Plz let me know what is the issue, or where i am wrong.
Any inputs will be helpful.
private void ADDBP_Click(object sender, EventArgs e)
{
this.CreateSession();
try
{
string sCmd = @"<?xml version=""1.0"" encoding=""UTF-16""?>";
sCmd += @"<Envelopes>";
sCmd += @"<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">";
sCmd += @"<env:Header><SessionID>" + this.sessionId + "</SessionID></env:Header>";
sCmd += @"<env:Body>";
sCmd += @"<dis:AddObject xmlns:dis=""http://www.sap.com/SBO/DIS"" CommandID=""Add BP"">";
sCmd += @"<BOM>";
sCmd += @"<BO>";
sCmd += @"<AdmInfo>";
sCmd += @"<Object>oBusinessPartners</Object>";
sCmd += @"</AdmInfo>";
sCmd += @"<BusinessPartners>";
sCmd += @"<row>";
sCmd += @"<CardCode>" + bpcode.Text + "</CardCode>";
sCmd += @"</row>";
sCmd += @"<row>";
sCmd += @"<CardName>" + bpname.Text + "</CardName>";
sCmd += @"</row>";
sCmd += @"<row>";
sCmd += @"<CardType>" + bptype.Text + "</CardType>";
sCmd += @"</row>";
sCmd += @"</BusinessPartners>";
sCmd += @"<Document_Lines>";
sCmd += @"<row>";
sCmd += @"<TaxLiable>" + "tNO" + "</TaxLiable>";
sCmd += @"</row>";
sCmd += @"<row>";
sCmd += @"<WTLiable>" + "tNO" + "</WTLiable>";
sCmd += @"</row>";
sCmd += @"</Document_Lines>";
sCmd += @"</BO>";
sCmd += @"</BOM>";
sCmd += @"</dis:AddObject>";
sCmd += @"</env:Body></env:Envelope>";
sCmd += @"</Envelopes>";
//MessageBox.Show(sCmd);
string itemData = node.BatchInteract(sCmd);
MessageBox.Show(itemData);
MessageBox.Show("Businees partner Susscesfully Add In SAP Business One");
this.DisconnectSession();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
i attach snap which give me error...
Thanks
Nikunj
Hi Nikunj,
What Pedro Told You should Follow it once.
Also if you want to use it in the same code then you need to use the below code.
sCmd += @"<BusinessPartners>";
sCmd += @"<row>";
sCmd += @"<CardCode>" + bpcode.Text + "</CardCode>";
sCmd += @"<CardName>" + bpname.Text + "</CardName>";
sCmd += @"<CardType>" + bptype.Text + "</CardType>";
sCmd += @"<SubjectToWithholdingTax>" + "N" + "</SubjectToWithholdingTax>";
sCmd += @"</row>";
sCmd += @"</BusinessPartners>";
I am sure this will work for you.
Thanks,
Amit.
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 | |
7 | |
7 | |
6 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.