cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Conenctor problem fail!

Former Member
0 Kudos

Hi all

I am following the MS help for this:

ms-help://MS.VSCC.2003/SAP.NCO/NCOV2Docu/overview/Tutorial__Write_an_ASP_.NET_Client_Application_with_SAP_.NET_Connector.htm

-


The problem is that i am stuck at step 14 .. i try to drag and drop (SAPProxy1) proxy item from the SAP Toolbox to Webform1.aspx design surface .. but every time i do this, i get a message with a an EMPTY drop down list that says "Select SAPProxy1 Type to add to your Component or Form. If the desired type not appear in the list, make sure that the project has been compiled at least once"

Trust me when when i tell you that i did (Build --> Build Solution) like 10 times already .. but no hope .. the proxy is not going through the Webform .. please i need help ASAP ... and if some one can lead me to a graphical tutorial on using SAP Connector for Visual Studio .NET .. i really appreciate it

PS: You can download an attachment for a picture of this problem in

https://microsoft-sap.com/idealbb/view.asp?topicID=420&sessionID={431D9652-B34B-45C7-A392-FD4A236A8F...

i post it it there too

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

oh man!! ..now i see the "+" sign and 3 files appeared in the .sapwsdl file .. there was NOTHING to choose from in "Custom Tools" so i just type (SAPConnectorGenerator) as u said .. now i can drag and drop this thing into the webform.aspx .. one more question .. i changed the "build action" under SAPProxy1.sapwsdl to (Content) instead of teh default which was (None) .. should i leave it as none or content? i would procede with this .. meanwhile THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

reiner_hille-doering
Active Contributor
0 Kudos

> question .. i changed the "build action" under

> SAPProxy1.sapwsdl to (Content) instead of teh default

> which was (None) .. should i leave it as none or

> content? i would procede with this ..

It doesn't matter. This setting only has an effect if you build a Setup. "Content" means that the file would be included in the Setup as data file.

> YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

> THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

> THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

> THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

> THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU

You could give me some reward points (on the left side of my answer select "Problem solved")...

Former Member
0 Kudos

done

Answers (6)

Answers (6)

Former Member
0 Kudos

OK i finished all steps in the procedure .. and i got this error when i start the program:

-


SAP.Connector.RfcException: Missing R3NAME=... or ASHOST=... in connect_param in RfcOpenEx at SAP.Connector.Connection.Open() at SAP.Connector.SAPLoginProvider.OpenSAPConnection(Page p, String connstr, Boolean persist) at Test_ASP_Connector.SAPLogin2_aspx.Login_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\Test_ASP_Connector\SAPLogin2.aspx.vb:line 75

-


this happens when i enter the login name and password as the programs start ... if you see step (13) in the procedure the posted earlier .. what i did was drag and drop the nod i'm connecting to to the Saplogin.aspx .. however there is one already called destination1 .. any ideas?

reiner_hille-doering
Active Contributor
0 Kudos

It seems that the documentation is note quite accurate about step 13: You need to change the existing destination1 component to your requirements. This can be either done manually in the property grid. Or - the recommenden way - hold the "Shift" key and drag the server icon from the Server Explorer. This will modify the existing destination1 to the settings in the Server Explorer. If you accidently created a second destination in the login form, just delete it.

If you have - accidently - multiple login forms, you can delete all but one, but make sure that you find the one that you still have in the Web.config.

Former Member
0 Kudos

Hi,

I have been following the same tutorial (but using C#). Everything appears fine but when I type my login details into my form and press ENTER I get the following message:

<i>System.NullReferenceException: Object reference not set to an instance of an object. at SAP.Connector.SAPLoginProvider.OpenSAPConnection(Page p, String connstr, Boolean persist) at zapd2.SAPLogin1.Login_Click(Object sender, EventArgs e) in c:\documents and settings\duncana\vswebcache\chntgqs1_83\zapd2\saplogin1.aspx.cs:line 102</i>

Any ideas?

Thanks

reiner_hille-doering
Active Contributor
0 Kudos

I assume that the Destination (of type ConfigDestination) is no initialized correctly. You can hold shif key and drag your server to init it.

Or you enter all relevant properties by hand. Make sure that the "DestinationName" property is not empty.

Former Member
0 Kudos

I've tried that but no matter what I type in I get the error:

<i>

Object reference not set to an instance of an object</i>

I get this inside Visual Studio as well as when I try and run the web application.

I should add that I get this even if I enter the same destination name as that held against the server node. In addition the holding down shift and dragging the server node to init the config.destiation never seems to work for me.

This problem is really holding me up so I'd appreciate step by step instructions to get me going. Thanks very much.

What should be going in Destination Name ??

Former Member
0 Kudos

I forgot to mention something .. when i created the SAPProxy through (Project --> add new item -- > Sap Proxy Connector) when i click on Sap Proxy Connector .. then OK .. a message appear that say "The operation could no be completed" .. however i can see the SAPProxy.sapwsdl file in my solution explorer and i can operate with it .. just thought i should mention this to you

reiner_hille-doering
Active Contributor
0 Kudos

This explains a lot. Therefore the .sapwsdl file doesn't have the proxy generator assigned and no code is generated.

Please select the .sapwsdl file and go to property window. Find the "Custom Tool" property. Change it to "SAPConnectorGenerator" (without quotes). This should solve it.

Former Member
0 Kudos

- Yes the icons still there if i reopen the .sapwsdl

- When i click Right-click the .sapwsdl file .. There is no "Run as custom tool"!

- When i click the "Show all Files" button in the top of the Solution Explorer. there are os np "+" sign at the .sapwsdl and no 3 files "under" the .sapwsdl file.

- There is no SAPProxy5.vb

Former Member
0 Kudos

- in the .sapwsdl designer .. i dragged and drop (RFC_Customer_Get) to the .sapwsdl designer .. 3 icons appeared after .. and they are 1- rfc_customer_get 2- brfckna1 3- brfckna1Table .. and in the procedure .. it ask me to created 3 proxy field (and i set their properties as described in the procedure)

- Every thing <u>seemed</u> to be working fine untill i reached step 14.

reiner_hille-doering
Active Contributor
0 Kudos

And are the icons still there if you reopen the .sapwsdl designer?

Please also do the following thing:

-Right-click the .sapwsdl file and say "Run custom Tool".

- Check the "Output" window for error messages ("Custom tool error...").

- Click the "Show all Files" button in the top of the Solution Explorer.

- Check if the .sapwsdl file now has a "+" sign.

- There should be 3 files "under" the .sapwsdl file.

If there is a SAPProxy5.vb, please post the content.

Former Member
0 Kudos

Hi

i just wanted to ask .. did u refer to teh URL i posted regarding teh tutorial i followed? any way yo answer your questions ... your help is really appreciated.

- Yes i have the SAP Proxy in the same (ASP.NET) Project.

- I see (SAPProxy5.sapwsdl) in (Solution Explorer) .. there is no class

- I created 3 Proxy field as described in the tutorial

- I could not created (Dim myProxy as SAPProxy5) in my webform

reiner_hille-doering
Active Contributor
0 Kudos

Ah, it seems that threre is no code generated at all. Here some more questions:

- What do you see in the .sapwsdl designer? Some icons for methods?, Icons for structures and tables?, or only Proxy fields?

- What did you drag from the Server Explorer?

Former Member
0 Kudos

Here is the procedure that i'm following:

Procedure

1. In Visual Studio .net open a new Visual Basic or Visual C# “ASP.NET Web Application”

2. Enter a name for your web application and press ENTER to create an empty web application.

3. Create the layout of the ASP.NET form by dragging and dropping onto the “Webform1.aspx” the following controls from the “Web forms” section of the VS.NET toolbox.

· TextBox

· Button

· Datagrid

4. Add an SAP client proxy to your project as follows:

a. From the Project menu in Visual Studio .net, select Add New Item.

b. Select SAP Connector Proxy as a template and choose Open.

c. Switch to the VS .NET Server explorer.

d. Right-click on SAP Servers and select Add Server.

e. Complete the SAP logon information and choose ENTER.

f. The folders BOR and Functions appear. If not, recheck your logon information.

g. To add a function filter right-click on the functions filter and select Add functions filter.

h. Change the name of the function filter to customers and set the name filter to RFC_CUST*

i. Expand the function filter you just created and search for the remote function modules (RFMs) beginning with the letters “RFC_CUST” for example RFC_CUSTOMER_GET

j. Highlight the RFC_CUSTOMER_GET function module and drag and drop it to the design surface of SAPProxy1.sapwsdl. This is the proxy designer you added in step a. The message Fetching Data, loading data, please wait a second appears.

In the SAPProxy1.sapwsdl designer the following items RFC_CUSTOMER_GET, BRFCKNA1 and BRFCKNA1Table appear.

5. Save and compile your application by choosing Build Build Solution.

6. Switch to the VS.NET toolbox and drag three Proxy field components to the SAPProxy1 designer.

7. Set the properties as follows:

Name

Data type

CustNo

System.String (default)

CustName

System.String (default)

tblCust

BRFCKNA1Table

8. Link the proxy fields created in step 6 to the parameters of the method RFC_CUSTOMER_GET as follows:

a. Select the RFC_CUSTOMER_GET method in SAPProxy1 designer and open the Parameters property by clicking on the two dots to the right of it.

b. Set the parameters default values as follows:

Parameter / Member

Default value

Kunnr

CustNo

Name1

CustName

Customer_T

_tblCust

NOTE:

Use the drop down list to help you.

c. To close the dialog box, choose OK .

9. Set the default values for the proxy fields as follows

Proxy field

Default value

CustNo

“”

CustName

“A*”

10. Save your application with File Save All and build once more. We use the SAP Login Form to provide SAP user name/password authentication support.

11. From the Visual Studio .net menu, choose Project Add New Item

12. Select the SAP Login Form template and add it to your project with OK

13. In this step, we set the destination properties that will establish the connection to the SAP system. Switch to your newly added SAP Login Form (for example, SAPLogin1.aspx). Drag the (SAP) server node to the login page to set the destination properties.

14. From the SAP Proxy section of the VS.NET toolbox, drag and drop the SAPProxy1 proxy item from the SAP Toolbox to the Webform1.aspx design surface.

15. On the designer for Webform1, select SAPProxy11 and set the properties as follows:

Property

Value

(name)

sapProxy11

Connection

...from Login Form

CustName

A*

CustNo

Modifiers

Protected

tblCust

sapProxy11.tblCust

16. On Webfom1, set these data-binding properties on the following components:

Web form component

Data source

Data member

DataGrid1

sapProxy11

tblCust

TextBox1 (text property)

Page.SAPProxy11

CustName

NOTE:

We do not databind Customer No. to anything, but instead use the default value “”.

17. To call RFC_CUSTOMER_GET and return results, write code in the Button1_Click event handler, as shown below.

NOTE:

We use the overload method that uses no parameters. These parameters are instead obtained from the proxy fields, tblCust, CustNo and CustName that we created and data-bound before.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

SapProxy11.Rfc_Customer_Get()

Me.DataBind()

End Sub

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

{

sapProxy11.Rfc_Customer_Get();

this.DataBind();

}

18. Test your application with Debug Start.

When the application starts you should be redirected to the SAP Login form. If you are not redirected, check the web.config file. The following sections should appear:

19. Enter a customer search argument, for example A*, and choose Search.

A list of customers in the data grid component appears.

reiner_hille-doering
Active Contributor
0 Kudos

Hm, a bit of strange. Here some questions to bring light in the dust:

- Do you have the SAP Proxy is the same (ASP.NET) Project or in an external one?

- Do you see you SAPProxy5 class in the Class View (not Solution Explorer)?

- Can you try to create an instance of SAPProxy5 manually:

--Create a protected member variable of SAPProxy5 somewhere in your code, e.g. Dim myProxy as SAPProxy5

-- In the InitializeComponent method (normally hidden), initialize the variable, e.g. myProxy = new SAPProxy5()

- Does the code compile? Do you now see an icon for myProxy in the ASPX designer?