Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help needed for working one code behind

Former Member
0 Likes
327

Hi, i am a newbie here. Doing my polytechnic final year project. I have problem with my coding. I am doing a page for company to register for my website and my code are below. I have errro for this line"weSBO.CreateCompany(strValues)". I says 'Argument not specified for parameter 'strValues' of public Function Create company(GetBlankRegisterDataSet As System.Data.DataSet, As String)As String," I not sure what is wrong with my coding can anybody help.

MY code below

Protected Sub btnConfirm_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConfirm.Click

Dim weSBO As New weSBO.WebService

Dim strValues As String

strValues = "CardCode=" & lblCompanyID.Text

strValues &= "&CardName=" & lblCompanyName.Text

strValues &= "&Address2=" & lblAddress2.Text

strValues &= "&Address=" & lblAddress.Text

strValues &= "&email=" & lblEmail.Text

strValues &= "&Password=" & lblPassword.Text

lblValues.Text = strValues

lblMessage.Text = weSBO.CreateCompany(strValues)

End Sub

My webservice

<WebMethod(EnableSession:=True, Description:="Test Function: Use this method to create Company profile. ")> _

Public Function CreateCompany(ByVal GetBlankRegisterDataSet As DataSet, ByVal strValues As String) As String

Dim lngRetVal As Long

Dim strReturn As String = ""

Dim CardCode As String = ""

Dim oDocument As SAPbobsCOM.Documents

Dim oRecSet As SAPbobsCOM.Recordset

Dim oCompany As SAPbobsCOM.Company

Dim dtUserHeader As DataTable

Dim drUserHeader As DataRow

Try

'Set Connection parametres- (System, DB Name, SBO ide, SBO passowrd , DB ID, DB password)

SetConnectionParam("S10034719", "SBO_KWSaw_Local", "kwsaw", "kianwee", "sa", "kianwee")

If ConnectToCompany() Then

'// Initialize the Company Object.

oCompany = Session("g_CompanyConnection")

oDocument = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners)

oDocument.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items

dtUserHeader = GetBlankRegisterDataSet.Tables("UserHeader")

'Set values to the fields

If dtUserHeader.Rows.Count > 0 Then

drUserHeader = dtUserHeader.Rows(0)

'oDocumment.GetByKey(0)

'Set Values to the fields

oDocument.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Service

oDocument.CardCode = drUserHeader("CardCode")

oDocument.CardName = drUserHeader("CardName")

oDocument.Address2 = drUserHeader("ShipTo")

oDocument.Address = drUserHeader("BillTo")

oDocument.E_Mail = drUserHeader("E_Mail")

oDocument.Password = drUserHeader("Password")

'oDocument.DocDate = Format(drUserHeader("DocDate"), "yyyyMMdd")

' UserDefineField(UserDefineFieldName)

'oDocument.UserFields.Fields.Item("U_TicketNum").Value = drOrdHeader(InvoiceHeader.TicketNum)

End If

lngRetVal = oDocument.Add

'Check the result

If lngRetVal = 0 Then

oCompany.GetNewObjectCode(strReturn)

oRecSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

oRecSet.DoQuery("SELECT CardCode FROM OCRD WHERE CardCode ='" & strReturn & " ' ")

CardCode = oRecSet.Fields.Item("CardCode").Value

Else

Session("g_LastErrorMsg") = oCompany.GetLastErrorDescription

End If

Else

Session("g_LastErrorMsg") = "No record Found in data Set"

End If

Catch ex As Exception

Session("g_LastErrorMsg") = ex.Message

Finally

oDocument = Nothing

dtUserHeader.Dispose()

End Try

Return CardCode

End Function

My Webservice Dataset

Private Function GetBlankRegisterDataSet() As DataSet

Dim dsRegister As New DataSet("Register")

'DataTable

Dim dtRegisterHeader As DataTable

dtRegisterHeader = dsRegister.Tables.Add("RegisterHeader")

' Define the columns

With dtRegisterHeader

.Columns.Add("CardCode", GetType(String))

.Columns.Add("CardName", GetType(String))

.Columns.Add("Phone1", GetType(String))

.Columns.Add("Address2", GetType(String))

.Columns.Add("Address", GetType(String))

.Columns.Add("E_Mail", GetType(String))

.Columns.Add("Password", GetType(String))

End With

Return dsRegister

End Function

2 REPLIES 2
Read only

Former Member
0 Likes
299

I guess you are in the wrong forum. This forum is for ABAP UI Programming. I'm not sure if you will find help here.

Regards,

Read only

naveen_inuganti2
Active Contributor
0 Likes
299

Hmmmmmmmmmmmm......

We are ABAPers...

Try any where alse..Mr. Kiran.,

Thanks,

Naveen.I