cancel
Showing results for 
Search instead for 
Did you mean: 

SAP .Net Connector working.....

Former Member
0 Kudos

Dear All,

Can anyone pls explain me the working of SAP .Net Connector.

Let me tell you what exactly is the confusion.

And pls forgive me if i made a mistake as i am not used to SAP, but only DOT NET.

What actually i want to know is that -->

1) We have a SAP at one end.

2) We have .Net at other end.

3) SAP .Net Connector acts a middle layer between SAP and .Net.

But if i want to use the functionality of SAP, lets say a Function Module of SAP into .Net, how can I do that????

And what am trying in my code in C#.Net is as follows:

i have added refernece of SAP BAPI Control and SAP Login Control in my WebForm.

The code is:

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

{

SAPBAPIControlLib.SAPBAPIControlClass obj=new SAPBAPIControlClass();

}

SAPLogonCtrl.SAPLogonControlClass log=new SAPLogonControlClass();

SAPBAPIControlLib.SAPBAPIControlClass obj;

obj.Connection =log.NewConnection();

log.ApplicationServer ="132.186.124.31";

log.System="00";

log.User="9999sde";

log.Password ="snehad";

log.Client="800";

log.Language="EN";

//Check if the connection was succesfully established

if(log.Logon(0,false)=false)

{

StringBuilder str= new StringBuilder();

str.Append("<script language='javascript'>");

str.Append("alert('Connection Failed')");

str.Append("</script>");

RegisterStartupScript("Msg", str.ToString());

}

else

{

StringBuilder str= new StringBuilder();

str.Append("<script language='javascript'>");

str.Append("alert('Connection Sucessful')");

str.Append("</script>");

RegisterStartupScript("Msg", str.ToString());

}

}

But am getting error at the if condition.

Also, do i need a SAP Proxy Class to connect with SAP???

Cant i connect to SAP with the above code???

i will be grateful if anyone can help me out instead of suggesting any new link of SAP.

pls help me out.

Its urgent.

Thanks & Regards,

Muskaan.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I have a deployment environment where i don't have VS .NET 2003, but i have the framework and and some connections to SAP with RFC, but when I deply the application, it gives-me this error :

File or Assembly name SAP.Connector.RFC, or one its dependencies, was not found

Any help would apreciated

reiner_hille-doering
Active Contributor
0 Kudos

You need to deploy

-SAP.Connector.dll and SAP.Connector.Rfc.dll to your application folder or GAC.

- LIBRFC32.DLL to application folder or System32.

Former Member
0 Kudos

> //Check if the connection was succesfully

> established

> if(log.Logon(0,false)=false)

> {

> StringBuilder str= new StringBuilder();

> str.Append("<script language='javascript'>");

> str.Append("alert('Connection Failed')");

> str.Append("</script>");

> RegisterStartupScript("Msg", str.ToString());

> }

> else

> {

> StringBuilder str= new StringBuilder();

> str.Append("<script language='javascript'>");

> str.Append("alert('Connection Sucessful')");

> str.Append("</script>");

> RegisterStartupScript("Msg", str.ToString());

> }

>

> }

>

> But am getting error at the if condition.

>

> Thanks & Regards,

> Muskaan.

Are you sure your if condition is right ?

if(log.Logon(0,false)<b>==</b>false)

of if (!log.Logon(0,false))

Sorry I'm primarily java so...

Former Member
0 Kudos

Dear All,

i want to use SAP modules into .Net through SAP .NET Connector.

I have 2 operating systems on my machine.

and the Connector is installed by the client side at the MS Windows Server OS.

But when i try to add a SAP COnnector Class in my .Net Application, its not visible,

i.e. am not able to locate SAP Connector Class in my .Net Application so that i can add it and then it may prompt me the wizard to procced further.

Cud anyone tell me what excatly is the prblem.

Thanks & Regards,

Muskaan.

Former Member
0 Kudos

Hi Muskaan,

I would start with a few trivial questions.

Can you tell me which version of SAP.Net connector have you installed?

1.If you have installed SAP.Net Connector version 2.0 and if its has been installed successfully,you would be able to see a logo of SAP.Net connector in the certificate that is displayed at the time you start VS.Net 2003 along with others like Micr0soft visual C#.NET, Microsoft Visual VB.NET etc.

2. Once this is done, open a new project and try adding a component. There you should get a SAP Connector proxy(not Sap Connector class, this was the name in the earlier version) along with other options like Web Form, Web Service, Class etc.

Let me know this so that I could try helping you further.

Regards,

Ankit

Former Member
0 Kudos

Thanks a lot Ankit,

Actually the client has given the connector in the form of a DLL.

Now when i will add this dll of connector in my .Net application, will i get a wizard that will guide me step by step how to proceed further???

or i will have to do it by myself???

and if i will be doing it by myself, then cud you pls guide me how will i do that???

coz i dont know a bit about SAP.

then how can i know which module of SAP i need to call in my application???

also, what is the difference between SAP Connector CLass and SAP Connector Proxy????

ALso, what exactly is the difference between SAP .Net Connector 1.0 and 2.0???

Thanks in advance.

Regards,

Muskaan.

Former Member
0 Kudos

Hi Muskaan,

1.The SAP .Net connector is a setup file that opens as a wizard and you just need to press "next" all the time to install it, its as simple as that. As far as I know SAP .Net connector does not come as a dll file.

When you install SAP.Net connector, it automatically upgrades VS.Net and includes two SAP files i.e. SAP connector proxy and SAP Login form.

I think you should contact your client and get it clarified that what you have is SAP.Net connector only or ask them to get you the setup file.

2. SAP.Net connector version 2.0 is an upgrade of version 1.0 and they have just simplified connecting to SAP server using the SAP Connector proxy. It also has some other advantages but I don't think we need to know that as of now.

3. Sap Connector class and SAP connector proxy are conceptually the same, however they differ in the way you connect to the SAP server.

As far as calling the SAP modules are concerned, I think if we have these things in place first then only we should proceed further.

I may not be able to reply on SDN today so in case u reply to this message then mark a copy to ankitbhansali2000@yahoo.com

Regards,

Ankit Bhansali

Former Member
0 Kudos

Thanks a lot Ankit...

As soon as i will proceed further, i'll let you know about the updates.

Meanwhile, cud you pls tell me which area of .Net shud i more concentrate for this kind of project as i am new to .Net.

In my project, i have to test the client's tool made in C#.Net, and chek whether it is working properly or not.

That is, whether it is fetching proper data from SAP or not?

Thanks & Regards,

Muskaan.

Former Member
0 Kudos

Muskaan I think since you are new to .Net, just get familiar with the .Net framework. May be just open a web application and try out some permutation combinations to know how it exactly works.

If you try your hands at some C#.net application, you can find all the required help in MSDN.

Since the application is in C#.Net, it would be good if you practice more of object oriented programming. Otherwise, it may jst happen that you are able to connect to the SAP but are stuck in some trivial problem related to object oriented programming. I know this as it happened to me :-).

Also, please let me know whether you are developing a web application or a web service.

Regards,

Ankit Bhansali

Former Member
0 Kudos

Hi

Go through the below document and you will get an idea about SAP .NET connector.

https://websmp202.sap-ag.de/~sapidb/011000358700008636572002E/RTM_DNC_10_rename.pdf

Thanks & Regards,

Govind.

Former Member
0 Kudos

I don't know what is SAPBAPIControlClass and SAPLogonControlClass.

Are they some control offer by SAP?

And the normal way is generate a BAPI/RFC proxy class though wizard, in your dotnet side. And call the sap function though proxy.

You can find some sample code in the connector install directory. Hope it will be helpful

Former Member
0 Kudos

Thanks but could you please tell me how can i do that.

Like i have to first download SAP DOT Net Connector and then what do i need to do?

Do i need to add the Proxy Class?

and what does that Proxy Class will contain?

Can you pls give me some sample code for that?

Regards,

Muskaan.

reiner_hille-doering
Active Contributor
0 Kudos

If you download NCo 2.x, it comes with samples, walkthrouhs and full documentation. Note the the documentation is contained as Visual Studio online help. The PDF mentioned before is for 1.x version of NCo.

Former Member
0 Kudos

As I know you need the Proxy class.

Former Member
0 Kudos

Thanks for your great help.

Also, can anyone tell me that is SAP Net Connector 2.0 supported for SAP 4.7 and VS.Net 2003?

What else are the prerequisite for Connector?

Regards,

Msukaan.

reiner_hille-doering
Active Contributor
0 Kudos

-Windows 2000, XP, or 2003

-Visual Studio .NET 2003 Professional or Enterprise Architect

- .NET Framework 1.1 (comes with VS)

- Sun Java Runtime Environment 1.3 or 1.4

- SAP ABAP System 4.0B or higher.

- SAP Developer Client License (this is the license to develop software with SAP, regardless if this is done in ABAP, Java or .NET.

Former Member
0 Kudos

Also, cud you pls tell me is SAP .Net Connector avaialbale for CRM and BW of SAP????

Thanks & Regards,

Muskaan.

reiner_hille-doering
Active Contributor
0 Kudos

Applications like CRM or BW are usualy implemented in ABAP and thus expose funcionality if form a BAPIs ore RFC function modules. Some newer applications expose different kinds of API, e.g. BW also exposes WebServices and special XML formats. Applications or application pars that are developed in Java cannot be used with NCo, but usually with the standard MS WebService Client.

Former Member
0 Kudos

AM sorry but i didnt get you.

you mean to say that SAP .Net COnnector is not available for CRM and BW???

Is it?

Also, cud you tell me from where i can get the data which will help me to develop a connector.

Thanks & Regards,

Muskaan.

reiner_hille-doering
Active Contributor
0 Kudos

> you mean to say that SAP .Net COnnector is not

> available for CRM and BW???

No. NCo can be used for and BAPI or RFC, regardless if it is exposed from R/3, BW, CRM.

I can't tell you which APIs are availabe in BW or CRM and if they are exposed as BAPI or in a different technology. You would best go to course that is specific to the application that you want to connect with. Each application also provides some kind of documentation. Note that this kind of information is not .NET-specific but specific to the Application (like BW or CRM), so I really don't know details. For BW there is also a document in our .NET area ( https://www.sdn.sap.com/sdn/search.sdn?contenttype=url&content=/irj/servlet/prt/portal/prtroot/pcd!3... )

e.g. this one:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/unkown/access sap bw ods bapi using c-sharp and sap .net connector 2.0.pdf

Former Member
0 Kudos

Hi, Reiner Hille-Doering,

.NET Connector 2.0 document indicate that the deployment system can be W2K, XP, but not mentioned Windows 2003 server. (My SAP support people told me that, it will not work with Win2003.) Does it work with Win2k3?

I'm experiencing a .NET Code access security issue when I ran the .NET application, which call SAP .NET Connector 2.0 from MS SQL reporting service customer DPE in reporting server installed on Win2003 server. The error message is "Required permissions cannot be acquired."

But the same code works in my workstation, vs.net 2003, development env. which is on XP.

The sample code, work with Windows Application which I deploy to same Windows 2003 server. And I already grant permission (Full Trust) to my .NET application for code access security.

Thanks.

Tony