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

Calling servlet through RFC Function Module ?

sivaganesh_krishnan
Contributor
0 Likes
895

hi everyone ,

Is it possible to call a servlet file from local system or file stored in sap and execute through the browser ? Could you please provide some ideas on how to carry out this .

Regards,

Sivaganesh

1 ACCEPTED SOLUTION
Read only

Katan
Active Participant
0 Likes
812

Hi Sivaganesh,

Normally your servlet wil be hosted on apache tomcat server.  If such a server were accessible by the SAP system the RFC will be hosted on, then you could create a HTTP request in your RFC enabled FM to call and execute your servlet.

Check out the following SAP Help link that shows you how to excute a HTTP request.  You can create new request object host or by HTTP destination in SM59.

http://help.sap.com/saphelp_nw70/helpdata/en/1f/93163f9959a808e10000000a114084/content.htm

Hope that helps you out.

Katan

6 REPLIES 6
Read only

Katan
Active Participant
0 Likes
813

Hi Sivaganesh,

Normally your servlet wil be hosted on apache tomcat server.  If such a server were accessible by the SAP system the RFC will be hosted on, then you could create a HTTP request in your RFC enabled FM to call and execute your servlet.

Check out the following SAP Help link that shows you how to excute a HTTP request.  You can create new request object host or by HTTP destination in SM59.

http://help.sap.com/saphelp_nw70/helpdata/en/1f/93163f9959a808e10000000a114084/content.htm

Hope that helps you out.

Katan

Read only

0 Likes
812

hi katan,

Thanks for your reply ,

Consider that i have already created a RFC which is already used as web service now i just want to call the same RFC through servlet url in SAP.

and what exactly should i do in sm59 ?

Regards,

Sivaganesh

Read only

Katan
Active Participant
0 Likes
812

Hi Sivaganesh,

Ah.  I misunderstood your requirement. 

If you have already created the RFC as a Web Service, then surely it is possible for you to execute the Web Service from your Servlet. 

I'm not totally clear on your architecture, but you can call a Web Service from Java by following this tutorial. 

Creating a Simple Web Service and Client with JAX-WS - The Java EE 5 Tutorial

If your Servlet is hosted on NW Java..take a look at this

http://help.sap.com/saphelp_nw73/helpdata/en/4b/96e16c4d8e584de10000000a42189c/content.htm

Read only

0 Likes
812

hi katan,

I am not using NW java , we are using SAP NW. I am trying to create a web service for servlets in SAP.

As i am new in creating Web service for servlets , i tend to ask more questions So please do help me out, Thanks .!!!

Regards,

Sivaganesh

Read only

Katan
Active Participant
0 Likes
812

Hi Sivaganesh,

I'm still not totally clear what you are trying to achieve. 

Are you trying to create a Web Service from your SAP ABAP NW system based on an existing FM? 

Thanks,

Katan

Read only

0 Likes
812

Thank u so much katan patel .. Actually i was also bit confused ... You cleared my doudt very well thank you ..

My actual scenario was that i wanted to get the changed values in my RFC and i should update other Server using servlets.

Regards,

Sivaganesh