on 01-28-2015 5:11 AM
Hi experts,
I am stuck at an error while adding Sales order using B1WS. Find the below attached code. Also attached the screenshot for the error.
Plz help me out asap. any suggestions will be helpful.
I have tried using Doc total and doc total specified true but still the system shows the document total needs to be zero or greater then zero.
kindly help.
CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ItemService;
using OrdersService;
using BusinessPartnersService;
public partial class SalesOrderDemo : System.Web.UI.Page
{
LoginService.LoginService lgvsrv = new LoginService.LoginService();
OrdersService.OrdersService ordsrv = new OrdersService.OrdersService();
BusinessPartnersService.BusinessPartnersService bpservice = new BusinessPartnersService.BusinessPartnersService();
ItemService.ItemsService iservice = new ItemService.ItemsService();
string licenceServer = "192.168.100.205:30000";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
login();
MySample.GlbData.Sessionid = txtLoginSessionID.Text;
}
protected void btnSalesOrder_Click(object sender, EventArgs e)
{
OrdersService.MsgHeader oHeader = new OrdersService.MsgHeader();
oHeader.SessionID = MySample.GlbData.Sessionid;
oHeader.ServiceName = OrdersService.MsgHeaderServiceName.OrdersService;
oHeader.ServiceNameSpecified = true;
ordsrv.MsgHeaderValue = oHeader;
BusinessPartnersService.MsgHeader oheader = new BusinessPartnersService.MsgHeader();
oheader.SessionID = MySample.GlbData.Sessionid;
oheader.ServiceName = BusinessPartnersService.MsgHeaderServiceName.BusinessPartnersService;
oheader.ServiceNameSpecified = true;
bpservice.MsgHeaderValue = oheader;
OrdersService.OrdersService myso = new OrdersService.OrdersService();
BusinessPartnersService.BusinessPartner mybp = new BusinessPartnersService.BusinessPartner();
OrdersService.DocumentParams docparams = new OrdersService.DocumentParams();
// docparams.DocEntry = 656;
//docparams.DocEntrySpecified = true;
OrdersService.Document dcc = new OrdersService.Document();
DateTime dt = DateTime.Now;
dcc.DocDueDate = dt;
dcc.DocDueDateSpecified = true;
dcc.CardCode = txtBPCode.Text;
// dcc.DocTotal = 20;
// dcc.DocTotalSpecified = true;
OrdersService.DocumentDocumentLine dline = new OrdersService.DocumentDocumentLine();
dline.ItemCode = txtItemCode.Text;
dline.Quantity = 2;
dline.QuantitySpecified = true;
// dline.UnitPrice = 10;
// dline.UnitPriceSpecified = true;
ordsrv.Add(dcc);
}
protected void login()
{
string SessionID;
lgvsrv = new LoginService.LoginService();
SessionID = lgvsrv.Login
(txtDBServer.Text,txtDBName.Text,LoginService.LoginDatabaseType.dst_MSSQL2008,true,txtCompanyUserName.Text,txtCompanyPassword.Text,LoginService.LoginLanguage.ln_English,true,licenceServer);
txtLoginSessionID.Text = SessionID;
}
}
Snap :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pedro,
thank you so much .. it solved the issue. but if you can please let me know what function it is? Is it a kind of Array or something?
Also we are trying to insert an image into a UDF in SAP. If you can plz help.
I referred to a thread here, which says that I need to regenerate the wsdl file and then use it again. But while generating the wsdl file I am facing the error. I have pasted the error below.
kindly help.
Please correct me if I am doing any wrong thing.
thanks,
Ravi.
Hi Ravi,
What that is doing is creating an array with all the lines in it and attaching that array to your document. Simply put it is adding the rows of the document.
Your second question should be made in a separate thread according to SCN Rules of Engagement. I'll answer it, but next time please open a new thread.
I don't know why that error is coming up, but it's complaining that the Recordset.xsd could not be found because part of it's path couldn't be found. Check that the file is in the directory you pointed out, and sometimes it helps not having any spaces in the directories.
Please close this thread when possible.
Best regards,
Pedro Magueija
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.