cancel
Showing results for 
Search instead for 
Did you mean: 

SAP .NET Connector 2.0 Soap Table is nothing

Former Member
0 Kudos

Hello,

I use Visual Studio .NET 2003 with the SAP .Net Connector 2.01. In the background is SAP miniWAS 6.2.

I build a little application that uses the "RFC_FUNCTION_SEARCH" RFC.

This works great.

But when I set the "UseSoap" Flag of the Destination Object to "True" there is also no error, but the Parameter "RFCFuncTable" is nothing after calling the RFC.

Any ideas?

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Any one know what I am doing wrong here:

private void Button1_Click(object sender, System.EventArgs e)

{

/* This code is trying to use the SOAP Protocol */

SAPProxy1 objProxy = new SAPProxy1();

SAP.Connector.Destination objDestination = new SAP.Connector.Destination();

SAP.Connector.SoapConnection objConnection = new SAP.Connector.SoapConnection();

objDestination.UseSoap = true;

objDestination.AppServerHost = "saphost.company.com";

objDestination.HttpPath = "/sap/bc/soap/wsdl11?services=";

//objDestination.HttpPath = "/sap/bc/soap/wsdl11";

//objDestination.HttpPath = "/sap/bc/soap/rfc";

objDestination.HttpPort = 1080;

objDestination.HttpProtocoll = "http";

objDestination.Username = "username";

objDestination.Password = "";

objProxy.Connection = SAP.Connector.Connection.GetConnection(objDestination);

BAPIMATRAS mat = new BAPIMATRAS();

mat.Sign = "I";

mat.Option0 = "CP";

mat.Descr_Low = MatDescText.Text;

bapimatrasTable.Add(mat);

try

{

objProxy.Z_Matreq_Material_Getlist(int.Parse(MaxRowsText.Text),"99", "001", "EN", PlantText.Text, SalesOrgText.Text,"",ref zmbuyer_NUMBERTable,ref zmlegacy_PARTTable,ref zmmanufacturer_PART_RANGETable, ref bapimatrasTable, ref bapimatramTable, ref bapireT2Table, ref zmmaterial_SEARCHTable, ref zmvendor_PART_NOTable, ref zmprdcat_TABTable);

}

catch(System.Net.WebException ex)

{

Label1.Text = ex.ToString();

}

//DataGrid1.DataSource = zmmaterial_SEARCHTable;

}

Message was edited by:

Kelly F

Message was edited by:

Kelly F

Former Member
0 Kudos

Hello again,

I have forgotten one information.

When I execute the "RFC_FUNCTION_SEARCH" with for example "xxxx" as search criteria I get the exception "No Function found".

When I execute with "RFC_*" I get no exception, but as mentionend before the table parameter is then nothing. Before calling the RFC the table parameter was set.

Thanks again.

reiner_hille-doering
Active Contributor
0 Kudos

Can it be that case that the function DOES return something, but that you don't see it in you windows forms application? Note that RFC and Soap works a bit different here: In RFC case, the table handed in during call is changed. In Soap case you get back a new instance. DataBinding is confused by this behavior, so you need to rebind your controls, e.g.

myDataGrid.DataSource = null;

myDataGrid.DataSource = this.myTab;

reiner_hille-doering
Active Contributor
0 Kudos

If the table is really Nothing, it can have to do with different XML encoding styles.

Make sure that

- You use NCo 2.0.1.

- That your system has a current Kernel.

Former Member
0 Kudos

Hello Reiner,

thanks for your reply.

The table is really nothing.

I am using .NET Connector 2.0.1.

What do you mean with Kernel. I use the SAP miniWAS 6.20.

The web service returns an object array as result. The first element is nothing.

If possible, I could send you my sample solution, so that you can verify the problem.

<b>Code with .NET Connector:</b>

Dim objProxy As New RFCFuncSearch

Dim objDestination As New SAP.Connector.Destination

Dim objTable As New RFCFUNCTable

Dim objConnection As New SAP.Connector.SoapConnection

objDestination.UseSoap = True

objDestination.AppServerHost = "localhost"

objDestination.HttpPath = "/sap/bc/soap/rfc"

objDestination.HttpPort = "8080"

objDestination.HttpProtocoll = "http"

objDestination.Username = "HENNE"

objDestination.Password = "INIT"

Try

objProxy.Connection = SAP.Connector.Connection.GetConnection(objDestination)

Catch ex As Exception

MessageBox.Show(ex.Message, "Fehler")

Return

End Try

Try

objProxy.Rfc_Function_Search("RFC_", "", "*", objTable)

Catch ex As Exception

MessageBox.Show(ex.Message, "Fehler")

Return

End Try

grdFunctions.DataSource = objTable

<b>Code without .NET Connector:</b>

Dim objWS As New FuncSearch.RFC_FUNCTION_SEARCHService

Dim objFunctions() As FuncSearch.RFCFUNC

Dim objFunction As New FuncSearch.RFCFUNC

objWS.PreAuthenticate = True

objWS.Credentials = New System.Net.NetworkCredential ("bcuser", "minisap")

objWS.RFC_FUNCTION_SEARCH("RFC_", objFunctions, "", "*")

MsgBox(objFunctions.ToString)

Former Member
0 Kudos

Hello Reiner,

where can I download the current Kernel version?

Thanks in advance.

CU