cancel
Showing results for 
Search instead for 
Did you mean: 

How to call SAP BAPI function ASP. Net C# WEB API??

vgkk
Discoverer
0 Kudos

I have created ASP.net Web API and called the SAP BAPI function. It is working fine after being hosted to a Windows server with SAP user name and password but it does not work with the Kerberos SSO after the Host the Web API in the Windows server IIS.

The Web API will call by the end user using a frontend Web application. he will insert his data into SAP with the help of ASP.Net Web API.

I need one centralized solution all users will access the Web application with SAP SSO.

My Web Application Flow :

End User (Web Browser) => Authenticate in Azure AD => Login to Web Application Portal => User Post Data to SAP system using BAPI function.

Can anyone please help me here to call the SAP BAPI function in ASP.net Web API for multiple users??

Please provide details of the configuration and SAP Software installation.

View Entire Topic
tim_alsop
Active Contributor
0 Kudos

My company has implemented exactly what you describe for some of our customers, using Kerberos. So, it is possible.

vgkk
Discoverer
0 Kudos

Hi Tim,

Thanks for your response.

I am able to invoke the SAP BAPI function in ASP.Net C# Web API and it's working fine with username and password credentials but I don't want to implement the same with the username & password. We are passing the parameter to RfcConfigParameters class. Please see the below values.

parms.Add(RfcConfigParameters.AppServerHost, "eayqsapXXX");

parms.Add(RfcConfigParameters.LogonGroup, "SUPPORT");

parms.Add(RfcConfigParameters.SystemNumber, "25");

parms.Add(RfcConfigParameters.SystemID, "QEX");

parms.Add(RfcConfigParameters.User, "3283832");

parms.Add(RfcConfigParameters.Password, "EYTestingXXXXXXX");

parms.Add(RfcConfigParameters.Client, "200");

parms.Add(RfcConfigParameters.Language, "EN");

parms.Add(RfcConfigParameters.PoolSize, "10");

Using the above parameters it working. But I don't want to go with User credentials. It should authenticate with a User ID. Like below parameters .

parms.Add(RfcConfigParameters.MessageServerHost, "EAYQSAPXXX");

parms.Add(RfcConfigParameters.LogonGroup, "SUPPORT");

parms.Add(RfcConfigParameters.SystemID, "QEX");

parms.Add(RfcConfigParameters.User, _userEmpId);

parms.Add(RfcConfigParameters.Password, string.Empty);

parms.Add(RfcConfigParameters.Client, "200");

parms.Add(RfcConfigParameters.Language, "EN");

parms.Add(RfcConfigParameters.PoolSize, "10");

parms.Add(RfcConfigParameters.SncMode, "1");

parms.Add(RfcConfigParameters.SncMyName, "p:CN=QG785XZ@US.NA.EY.NET");

parms.Add(RfcConfigParameters.SncPartnerName, "p:CN=SAP/KerberosQE2@EY.NET");

Can you please provide a code example in ASP.net WEB API C# ??

tim_alsop
Active Contributor
0 Kudos

Instead of username and password, a Kerberos ticket can be used. I am unable to share any code on here, sorry.

vgkk
Discoverer
0 Kudos

Hi Tim,

Can you please shear any document or link for reference ??

tim_alsop
Active Contributor
0 Kudos

I can help but I am not able to share our company proprietary information on SCN.

RAI9
Discoverer
0 Kudos

Hello Tim,

 

Can you please share your email id.

RAI9
Discoverer
0 Kudos

Hello Tim,

 

We are also looking out for the same solution.

can you please share your contact details so that we can reachout to you / Company for this solution