Sep 29

Turn any SAP remote-enabled function module into a Web Service – Part 1

It still amazes me that not a lot of developers know that you can turn any existing SAP remote enable function module into a Web Service.  It may sound like a challenging task, but it is just one of those things that you either know how to do it or you don’t.  And to know how to do it only takes 15min to understand.

I have broken this down into 2 blogs
Part 1 will show how to create the simple structured web service
Part 2 will show how to configure and test the web service using SOAMANAGER and WSNAV

For this scenario, I created a really simple function module with one input and one output that will send back a response of “Response successful from test”   This will only create one operation for this service.  However, if you want to create multiple operations for a Service you can also generate the service from a function group.

pic_1

You will need to ensure that the attribute is set as Remote-enabled in the function module.

pic_2

Now go to transaction SE80 and right-click–>Create–>Web Service

pic_3

Since SAP will be hosting this web service we will want to select  “Service Provider”

pic_4

Select the radio button “Existing ABAP Object(Inside Out)”

Since we are building this web service from a Function Module.  The difference between and inside out vs. an outside is approach is where the structure is built.  From a design perspective, it is recommended that you use an Outside-in approach whenever possible.  This means that you would build out  the structure in the ESR and then implement the code behind it in SAP..  However, there will be cases when you will want to turn a Standard SAP remote enable function module into a Web Service, thus using this approach, the Inside out approach..)

pic_5

Give a name to what you want to call your Enterprise service and specify that the endpoint will be a function module.

pic_6

Enter the name of the Function module that the web service will call in the backend.

pic_7

Here you will have to specify which authentication you want this service to have.  For this example I have set it to no authentication.

pic_8

pic_9

Now you are complete with building this web service.  However at this point you have just built the Web Service but you will now need to configure it so that an external application can call this web service.

pic_10

This will come in my next Blog for configuring the newly created Web Service and as well as testing this  service.

About The Author

7 Comments

  1. Avatar
    Subani Shaik
    October 1, 2009 at 4:54 am · Reply

    Hi Steve Park, How are you doing?

    I this blog is really good, Much appreciate if you can provide next blog. URL for Part 2 will show how to configure and test the web service using SOAMANAGER and WSNAV.

    If i can suggest, please place URL of subsequent blog to navigation easily. Please assist me.

    Thanks A lot.

    Best wishes,
    subani shaik

  2. Avatar
    Kevin O
    November 3, 2009 at 3:26 am · Reply

    Appreciate if you can provide the second part of the blog. It is indeed very useful. Thank you.

  3. […] Steve Park, wrote a two part blog explaining how to turn any ABAP function into a web service.  (Find Part 1 here.  Find Part 2 here.)  But, what happens when you change the function module interface as my […]

  4. Avatar
    Mikey
    June 17, 2010 at 8:32 am · Reply

    Really good article…Do you know if this is available for SAP WAS 6.20 I’ve been told it does support web services but there is no option for Web Service in SE80 and bo SOAMANAGER?

  5. Avatar
    james
    February 27, 2013 at 3:38 pm · Reply

    Steve,

    Nice article. I have a question. I have created a function module which is remotely enabled. I want to expose this function module as web service in SAP R/3 4.7 WAS 6.20. How do I do this? Any help.

    Keep up the good work.

    Thanks,

    James

Leave a reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

This site uses Akismet to reduce spam. Learn how your comment data is processed.